Public class login form

Public School loginForm

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses okButton2.Click

Try

: mappDB.Password = passwordTextBox.Text

Contact mappDB.connect()

MainForm.Show()

Find ex As Exception

Contact showError(ex.Message)

End Try

End Sub

Private Sub Button1_Click(ByVal sender As Item, ByVal e As System.EventArgs) Handles Button1.Click

If MessageBox.Show("you may not wish to stop today?", strApplicationName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then Application.Exit()

End Sub

Private Sub loginForm_Load(ByVal sender As Item, ByVal e As System.EventArgs) Handles Me.Load

Me.Text = strApplicationName & " Login"

passwordTextBox.Text = String.Empty

'todo when start remove

usernameTextBox.Text = "admin"

passwordTextBox.Text = "7151epeN"

End Sub

End Class

Imports System.Data.OleDb

Imports System.Configuration

Public Class MainForm

_gridFilter that is construction

Gray _sql As String

Gray _criteria As String

Dim As String

End Design

Gray gridFilter As New _gridFilter

Gray cmdLocal As OleDbCommand

Gray blIsActiveLoan As Boolean

Dim As New BindingSource

Private Sub exitToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

If MessageBox.Show("Quit software today?", strApplicationName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then Application.Exit()

End Sub

Private Sub MainForm_Activated(ByVal sender As Item, ByVal e As System.EventArgs) Addresses Me.Activated

loginForm.Visible = False

End Sub

Private Sub MainForm_FormClosing(ByVal sender As Item, ByVal e As System.Windows.Forms.FormClosingEventArgs) Addresses Me.FormClosing

Contact mappDB.close(): Contact mappDB.dispose()

mappDB = Nothing

End Sub

Private Sub NewLoanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses NewLoanToolStripMenuItem.Click

borrowForm.ShowDialog()

End Sub

Private Sub BorrowerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses BorrowerToolStripMenuItem.Click

borrowerForm.ShowDialog()

End Sub

Private Sub MainForm_Load(ByVal sender As Item, ByVal e As System.EventArgs) Handles Me.Load

Me.Text = strApplicationName " for " & ConfigurationManager.AppSettings ("customer").ToString

'dateLabel.Text = System.DateTime.Now.ToString("MMM dd yyyy")

loginUserNameLabel.Text = mappDB.UserName

loginsinceLabel.Text = System.DateTime.Now.ToString("MMM dd yyyy hh:mm tt")

filtercriteriaComboBox.SelectedIndex = 1

With glSumTotalDataGridView

True

.Rows.Add() : .Rows.Add() : .Rows.Add()

.Item(0, 0).Value = "Total Cr"

.Item(0, 1).Value = "Total Doctor"

.Item(0, 2).Value = "Balance "

.Columns(0).Width = 550

.Columns(1).Width = 150

.Cursor = Cursors.Hand

.SelectionMode = DataGridViewSelectionMode.FullRowSelect

End With

End Sub

Private Sub searchfilterButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses searchfilterButton.Click

Me.Cursor = Cursors.WaitCursor

gridFilter._sql = "SELECT pk_borrowerID,lastname as [Last name],firstname as [First-Name] FROM tblborrower"

gridFilter._orderBy = " ORDER BY lastname"

Select Event filtercriteriaComboBox.SelectedIndex

The firstname of circumstance 0

gridFilter._criteria = " WHERE firstname like '" & filtervalueTextBox.Text & "%'"

Case 1 'lastname

gridFilter._criteria = " WHERE lastname like '" & filtervalueTextBox.Text & "%'"

Case 2 'organization

gridFilter._criteria = " WHERE organization like '" & filtervalueTextBox.Text & "%'"

End Select

Contact fillGrid(gridFilter._ Sql GridFilter._, requirements orderBy, searchBrDataGridView, Accurate)

Me.Cursor = Cursors.Default

End Sub

Private Sub refreshGLSumToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses glsum_refreshToolStripButton.Click

Me.Cursor = Cursors.WaitCursor

gridFilter._sql = " CHOOSE fk_borrowerid,fullname as [Customer Title],sumofcr as [Amount Of Cr], sumofdr as [Amount Of Doctor], Stability FROM qGLsummary "

Or Even incZeroBalToolStripButton.Checked Then

gridFilter._ Requirements = ""

Otherwise

gridFilter._criteria = " WHERE balance > 0 "

End If

gridFilter._orderBy = " ORDER BY Fullname "

Contact fillGrid(gridFilter._ Sql GridFilter._, requirements orderBy, glSumDataGridView, Accurate, bsGLSummary)

glsumRowCountToolStripLabel.Text = "of " & glSumDataGridView.Rows.Count - 1

Contact firstToolStripButton_Click(sender, e)

Contact glsum_totals()

Me.Cursor = Cursors.Default

'Contact TotalOfGLSum()

End Sub

Private Sub Label9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses drtotalal_glsumLabel.Click

End Sub

Private Sub viewGLSummaryToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses glsum_openToolStripButton.Click

Try

Me.Cursor = Cursors.WaitCursor

Contact TabControl1.SelectTab(1)

gridFilter._sql = " Choose pk_mloanid, pk_loanref as [Mortgage Ref],isactive as [Effective], Dated FROM tblloanmaster "

gridFilter._orderBy = " ORDER BY dated DESC "

gridFilter._criteria = " WHEREVER fk_borrowerid=" & glSumDataGridView(0, glSumDataGridView.CurrentRow.Index).Value.ToString

Contact fillGrid(gridFilter._ Sql GridFilter._, requirements orderBy, brloanlistDataGridView, Accurate)

brloanlistDataGridView.Columns(2).Width = 40

brloanlistDataGridView.Columns(3).Width = 40

brloanlistDataGridView.Columns(3).DefaultCellStyle.Format = "MMM dd yyyy"

= glSumDataGridView that is brNameToolStripLabel.Text (1, glSumDataGridView.CurrentRow.Index).Value.ToString

'generalledgerDataGridView.DataSource = Nothing

Find ex As Exception

Contact showError(ex.Message.ToString)

Finally

Me.Cursor = Cursors.Default

End Try

End Sub

Private Sub borrowerDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Addresses searchBrDataGridView.CellContentClick

End Sub

Private Sub borrowerDataGridView_CellDoubleClick(ByVal sender As Item, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Addresses searchBrDataGridView.CellDoubleClick

gridFilter._sql = " CHOOSE fk_borrowerid,fullname as [Customer Title],sumofcr as [Amount Of Cr], sumofdr as [Amount Of Doctor], Stability FROM qGLsummary "

gridFilter._criteria = " WHEREVER fk_borrowerid =" & searchBrDataGridView(0, searchBrDataGridView.CurrentRow.Index).Value.ToString

gridFilter._orderBy = " ORDER BY Fullname "

Contact fillGrid(gridFilter._ Sql GridFilter._, requirements orderBy, glSumDataGridView, Accurate)

'Contact TotalOfGLSum()

Contact glsum_totals()

End Sub

Private Sub borrowerloanDataGridView_CellDoubleClick(ByVal sender As Item, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Addresses brloanlistDataGridView.CellContentDoubleClick

End Sub

Private Sub generalledgersummaryDataGridView_CellDoubleClick(ByVal sender As Item, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Addresses glSumDataGridView.CellDoubleClick

Contact viewGLSummaryToolStripButton1_Click(sender, e)

End Sub

Private Sub upd_newToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses upd_newToolStripButton.Click

Try

upd_datedDateTimePicker.Value = Now

upd_ToComboBox.SelectedIndex = 1

upd_isactiveCheckBox.Checked = True

Contact combolist("CHOOSE pk_accntID,pk_code FROM tblaccount ORDER BY explanation", "pk_accntid", "pk_code", upd_AccntComboBox)

Contact upd_AccntComboBox_SelectionChangeCommitted(sender, e)

'upd_AmtNumericUpDown.Value = 0

upd_nextduedateDateTimePicker.Value = DateAdd(DateInterval.Month, 1, CType(duedateTextBox.Text.ToString, Day))

'upd_statusComboBox.SelectedIndex = 0

Contact toggleOnUpdate()

Find ex As Exception

Contact showError(ex.ToString)

End Try

End Sub

Private Sub upd_editToolStripButton_Click(ByVal sender As Item, ByVal e As System.EventArgs) Addresses upd_editToolStripButton.Click

Try

Gray a brloanDetailsDataGridView.CurrentRow.Index that is As Integer =

Contact combolist("CHOOSE pk_accntID,pk_code FROM tblaccount ORDER BY explanation", "pk_accntid", "pk_code", upd_AccntComboBox)

Contact toggleOnUpdate()

With brloanDetailsDataGridView

upd_recidLabel.Text = .Item(0, a).Value.ToString

upd_AccntComboBox.Text = .Item(1, a).Value.ToString

upd_datedDateTimePicker.Value = CType(.Item(2, a).Value, Date)

If CType(.Item(3, a).Value, Double) > 0 Then 'accessibility is Cr

upd_ToComboBox.Text = "Cr"

upd_AmtNumericUpDown.Value = CType(.Item(3, a).Value, Decimal)

Otherwise

upd_ToComboBox.Text = "Doctor"

upd_AmtNumericUpDown.Value = CType(.Item(4, a).Value, Decimal)

End If

upd_nextduedateDateTimePicker.Value = CType(duedateTextBox.Text.ToString, Day)

upd_isactiveCheckBox.Checked = isactiveCheckBox.Checked

End With

Find ex As Exception

If Err.Number = 91 Subsequently

Contact showError("Please press accessibility Generally Ledger Specifics and press change.")

Otherwise

Contact showError(Err.Number & " " & ex.Message)

End If

End Try

End Sub

Private Sub upd_applyToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses upd_applyToolStripButton.Click

If Not IsNumeric(upd_recidLabel.Text) Then

MessageBox.Show(" select accessibility from GL Specifics. Press okay to continue.", strApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information)

Exit Sub

End If

If upd_AmtNumericUpDown.Value = 0 Then

Contact showError("Enter quantity worth.")

Exit Sub

End If

Dim i As Integer, _PostAmountTo As String = String.Empty

If MessageBox.Show("are records appropriate?", strApplicationName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Subsequently

Try

If upd_ToComboBox.Text.ToUpper = "DOCTOR" _PostAmountTo = "dr" _PostAmountTo = "Cr"

If upd_recidLabel.Text = " " Then that is 0

cmdLocal = New OleDbCommand("INSERT INTO tblloandetails(fk_mloanid,fk_accntid,dated," & _PostAmountTo & ") VALUES(@fk_mloanid,@fk_accntid,@dated,@amt)", mappDB.conn)

Otherwise

cmdLocal = New OleDbCommand("UPDATE tblloandetails ESTABLISHED fk_mloanid=@fk_mloanid,fk_accntid=@fk_accntid,dated=@dated," & _PostAmountTo & "=@amt WHEREVER pk_dloanid=" & upd_recidLabel.Text.ToString, mappDB.conn)

End If

With cmdLocal.Parameters

.Add("@ fk_mloanid", 0, OleDbType.Integer, "fk_mloanid").Value = recIDLabel.Text

.Add("@ fk_accntid", 0, OleDbType.Integer, "fk_accntid").Value = upd_AccntComboBox.SelectedValue

.Add("@dated", OleDbType.Date, 0, "dated").Value = upd_datedDateTimePicker.Value.ToString("MMM/dd/yyyy")

.Add("@ amt", OleDbType.Decimal, 0, _PostAmountTo).Value = upd_AmtNumericUpDown.Value

End With

i = cmdLocal.ExecuteNonQuery

gridFilter._sql = " CHOOSE pk_dloanid,pk_code as Specific,Old,Cr,Doctor FROM qloandetails "

gridFilter._criteria = " WHEREVER fk_mloanid =" & brloanlistDataGridView(0, brloanlistDataGridView.CurrentRow.Index).Value.ToString

gridFilter._orderBy = " ORDER BY old,pk_dloanid "

Contact fillGrid(gridFilter._ Sql GridFilter._, requirements orderBy, brloanDetailsDataGridView, Accurate)

Contact gldetails_totals()

blIsActiveLoan = False

For i = 0 To brLoanDetailsSumDataGridView.Rows.Count - 1

If CType(brLoanDetailsSumDataGridView.Item(4, i).Value, Double) > 0 Then

blIsActiveLoan = True

Exit For

End If

Next

cmdLocal = New OleDbCommand("UPDATE tblloanmaster ESTABLISHED isactive=@isactive WHEREVER pk_mloanid=" & recIDLabel.Text.ToString, mappDB.conn)

With cmdLocal.Parameters

.Add("@ isactive", OleDbType.Boolean, 0, "isactive").Value = blIsActiveLoan

End With

cmdLocal.ExecuteNonQuery()

brloanlistDataGridView.Item(2, brloanlistDataGridView.CurrentRow.Index).Value = blIsActiveLoan

'end position check

If blIsActiveLoan And MessageBox.Show("Update deadline?", strApplicationName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Subsequently

'update loan deadline

cmdLocal = New OleDbCommand("UPDATE tblloanmaster ESTABLISHED duedate=@duedate WHEREVER pk_mloanid=" & recIDLabel.Text.ToString, mappDB.conn)

With cmdLocal.Parameters

.Add("@duedate", OleDbType.Date, 0, "duedate").Value = upd_nextduedateDateTimePicker.Value.ToString("MMM dd yyyy")

End With

cmdLocal.ExecuteNonQuery()

End If

Contact toggleOnUpdate()

MessageBox.Show(brNameToolStripLabel.Text.ToUpper & " ledger update achievement. Press okay to continue.", strApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information)

Find ex As Exception

Contact showError(ex.ToString)

Finally

i = Nothing

cmdLocal = Nothing

mappDB.close()

End Try

End If

End Sub

Private Sub gldetails_totals()

With brloanDetailsDataGridView

.Columns(2).DefaultCellStyle.Format = "MMM dd yyyy"

.Columns(3).Width = 80

.Columns(3).DefaultCellStyle.Format = "0,0.00"

.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight

.Columns(4).Width = 80

.Columns(4).DefaultCellStyle.Format = "0,0.00"

.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight

End With

gridFilter._sql = " CHOOSE fk_mloanid,pk_code as Specific, sumofcr as Cr, sumofDr as Doctor,Stability FROM qloandetailssum "

gridFilter._criteria = " WHEREVER fk_mloanid =" & brloanlistDataGridView(0, brloanlistDataGridView.CurrentRow.Index).Value.ToString

gridFilter._orderBy = " "

Contact fillGrid(gridFilter._ Sql GridFilter._, requirements orderBy, brLoanDetailsSumDataGridView, Accurate)

With brLoanDetailsSumDataGridView

'.Columns(2).DefaultCellStyle.Format = "MMM dd yyyy"

For i As Integer = 2

.Columns(i).Width = 80

.Columns(i).DefaultCellStyle.Format = " 0.00", 0

.Columns(i).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight

Next

End With

End Sub

Private Sub glsum_totals()

Gray _totalCr As 0

Gray _totalDr As 0

Try

For i As Integer = 0 To glSumDataGridView.Rows.Count - 1

_totalCr += CType(glSumDataGridView.Item(2, i).Value, Increase)

_totalDr += CType(glSumDataGridView.Item(3, i).Value, Increase)

Next

Capture

End Try

Try

'add grid format

With glSumDataGridView

.Columns(1).Width = 350

.Columns(2).DefaultCellStyle.Format = "0,0.00"

.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight

.Columns(3).DefaultCellStyle.Format = "0,0.00"

.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight

.Columns(4).DefaultCellStyle.Format = "0,0.00"

.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight

End With

With glSumTotalDataGridView

.Item(1, 0).Value = FormatNumber(_totalCr, 2)

.Item(1, 1).Value = FormatNumber(_totalDr, 2)

.Item(1, 2).Value = FormatNumber(_totalCr - _totalDr, 2)

.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight

End With

Find ex As Exception

Contact showError(ex.Message)

End Try

End Sub

Private Sub upd_calcToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses upd_calcToolStripButton.Click

Try

System.Diagnostics.Process.Start("calc")

Find ex As Exception

Contact showError(ex.ToString)

End Try

End Sub

Sub haltKeys(ByVal sender As Item, ByVal e As KeyPressEventArgs) Addresses datedTextBox.KeyPress, duedateTextBox.KeyPress, _

ComakerTextBox.KeyPress payableTextBox.KeyPress monthlypenaltyTextBox.KeyPress

MonthlyintTextBox.KeyPress, principalTextBox.KeyPress, monthlypenaltyTextBox.KeyPress

e.Handled = True

End Sub

Private Sub export_glsumToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses glsum_exportToolStripButton.Click

If (glSumDataGridView.Rows.Count - INCH) < 0 Then Exit Sub

Gray H-as Integer = 0, r As Integer = 4

excelApp = New Excel.Application

excelWB = excelApp.Workbooks.Open(Application.StartupPath & "templatesglsummary.xlt")

excelWS = CType(excelWB.Sheets(1), Excel.Worksheet)

With excelWS

For h = 0 To glSumDataGridView.Rows.Count - 1

R h + 4 '4 may be the foundation strip

.Cells(r, 1) = h + 1 'sn

.Cells(r, 2) = glSumDataGridView.Item(1, h).Value.ToString

.Cells(r, 3) = glSumDataGridView.Item(2, h).Value.ToString

.Cells(r, 4) = glSumDataGridView.Item(3, h).Value.ToString

.Cells(r, 5) = glSumDataGridView.Item(4, h).Value.ToString

Next

'balance

'.Cells(6, ExcelColumns.colE) = "=C" & r & "-N" & r

r += 1

.Cells(r, ExcelColumns.colC) = "=SUM(C4:C" & r - 1 & ")" 'Cr total

.Cells(r, ExcelColumns.colD) = "=SUM(D4:D" & r - 1 & ")" 'Dr Total

.Cells(r, ExcelColumns.colE) = "=C" & r & "-N" & r 'Stability Total

.Cells(r, ExcelColumns.colA) = "Whole"

.Range("A" & r & ":W" & r).Merge()

.Range("A" & r).HorizontalAlignment = -4131

End With

Contact drawBorder("A4:E" & r)

excelApp.Visible = True

'cleanup parameters

h = Nothing

excelWS = Nothing

excelWB = Nothing

excelApp = Nothing

End Sub

Private Sub gl_viewToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses gldetails_viewToolStripButton.Click

If (brloanDetailsDataGridView.Rows.Count - INCH) < 0 Then Exit Sub

Gray H-as Integer = 0, r As Integer = 0

'Dim s As String = String.Empty

excelApp = New Excel.Application

excelWB = excelApp.Workbooks.Open(Application.StartupPath & "templatesgldetails.xlt")

excelWS = CType(excelWB.Sheets(1), Excel.Worksheet)

With excelWS

.Cells(3, ExcelColumns.colC) = brNameToolStripLabel.Text.ToString

.Cells(4, ExcelColumns.colC) = loanRefLabel.Text.ToString

.Cells(5, ExcelColumns.colC) = datedTextBox.Text.ToString

.Cells(3, ExcelColumns.colG) = principalTextBox.Text.ToString

.Cells(4, ExcelColumns.colG) = monthlyintTextBox.Text.ToString

.Cells(5, ExcelColumns.colG) = monthlypenaltyTextBox.Text.ToString

For h = 0 To brloanDetailsDataGridView.Rows.Count - 1

R h + 9 'may be the foundation strip

.Cells(r, ExcelColumns.colA) = h + 1 'sn

.Cells(r, ExcelColumns.colB) = brloanDetailsDataGridView.Item(1, h).Value.ToString

.Cells(r, ExcelColumns.colD) = CType(brloanDetailsDataGridView.Item(2, h).Value.ToString, Day).ToString("MMM dd yyyy")

.Cells(r, ExcelColumns.colE) = brloanDetailsDataGridView.Item(3, h).Value.ToString 'cr

.Cells(r, ExcelColumns.colF) = brloanDetailsDataGridView.Item(4, h).Value.ToString 'dr

' balance

If r > 10 Subsequently .Cells(r, ExcelColumns.colG) = "=G" & (r - 1) & "+E" & r & "-Y" & r

Next

r += 1

'balance

.Cells(6, ExcelColumns.colG) = "=E" & r & "-Y" & r

.Cells(r, ExcelColumns.colE) = "=SUM(E8:E" & r - 1 & ")"

.Cells(r, ExcelColumns.colF) = "=SUM(F8:F" & r - 1 & ")"

.Cells(r, ExcelColumns.colG) = "=E" & r & "-Y" & r

.Cells(r, ExcelColumns.colA) = "Whole"

.Range("A" & r & ":N" & r).Merge()

.Range("A" & r).HorizontalAlignment = -4131

End With

Contact drawBorder("A10:GARY" & r)

excelApp.Visible = True

h = Nothing

excelWS = Nothing

excelWB = Nothing

excelApp = Nothing

End Sub

Private Sub what_accntButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses what_accntButton.Click

Try

cmdLocal = New OleDbCommand("SELECT explanation from tblaccount WHEREVER pk_accntID=" & upd_AccntComboBox.SelectedValue.ToString, mappDB.conn)

Poor road As OleDbDataReader = cmdLocal.ExecuteReader

rd.Read()

If rd.HasRows Subsequently MessageBox.Show(upd_AccntComboBox.Text & " = " & rd(0).ToString & ". Press okay to continue.", strApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information)

rd = Nothing

cmdLocal = Nothing

Capture

End Try

End Sub

Private Sub AccountToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses AccountToolStripMenuItem.Click

rptAccountForm.ShowDialog()

End Sub

Sub toggleOnUpdate()

brloanlistDataGridView.Enabled = Not brloanlistDataGridView.Enabled

brloanDetailsDataGridView.Enabled = Not brloanDetailsDataGridView.Enabled

upd_newToolStripButton.Enabled = Not upd_newToolStripButton.Enabled

upd_editToolStripButton.Enabled = Not upd_editToolStripButton.Enabled

upd_applyToolStripButton.Enabled = Not upd_applyToolStripButton.Enabled

upd_cancelToolStripButton.Enabled = Not upd_cancelToolStripButton.Enabled

End Sub

Private Sub upd_cancelToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses upd_cancelToolStripButton.Click

If MessageBox.Show("Stop update?", strApplicationName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Subsequently

upd_recidLabel.Text = "0"

Contact toggleOnUpdate()

End If

End Sub

Private Sub borrowerloanDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Addresses brloanlistDataGridView.CellContentClick

End Sub

Private Sub TabControl1_Click(ByVal sender As Item, ByVal e As System.EventArgs) Addresses TabControl1.Click

If upd_applyToolStripButton.Enabled = True Then

MessageBox.Show("Please finish upgrading/stop GL of " & brNameToolStripLabel.Text.ToUpper ". Press okay to continue.", strApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information)

TabControl1.SelectedIndex = 1

End If

End Sub

Private Sub DueDateToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses DueDateToolStripMenuItem.Click

rptDueDateForm.ShowDialog()

End Sub

Private Sub rptBorrowerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses rptBorrowerToolStripMenuItem.Click

Me.Cursor = Cursors.WaitCursor

Dim r As Integer = 4

excelApp = New Excel.Application

excelWB = excelApp.Workbooks.Open(Application.StartupPath & "templatesborrower.xlt")

excelWS = CType(excelWB.Sheets(1), Excel.Worksheet)

cmdLocal = New OleDbCommand("SELECT * from tblborrower ORDER BY lastname", mappDB.conn)

Poor road As OleDbDataReader = cmdLocal.ExecuteReader

Although rd.Read

With excelWS

.Cells(r, ExcelColumns.colA) = r - 3

.Cells(r, ExcelColumns.colB) = road("lastname").ToString

.Cells(r, ExcelColumns.colC) = road("firstname").ToString

.Cells(r, ExcelColumns.colD) = rd("jobtitle").ToString & " - " & road("organization").ToString

.Cells(r, ExcelColumns.colE) = road("contactnos").ToString

.Cells(r, ExcelColumns.colF) = road("handle").ToString

r += 1

End With

End While

If r > 4 Then Contact drawBorder("A5:Y" & r - 1)

excelApp.Visible = True

mappDB.close()

rd = Nothing

cmdLocal = Nothing

r = Nothing

excelWS = Nothing

excelWB = Nothing

excelApp = Nothing

Me.Cursor = Cursors.Default

End Sub

Private Sub AccountToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses AccountToolStripMenuItem1.Click

accountForm.ShowDialog()

End Sub

Private Sub LogOffToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses LogOffToolStripMenuItem.Click

Me.Visible = False

loginForm.Show()

End Sub

Private Sub borrowerloanDataGridView_CellEnter(ByVal sender As Item, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Addresses brloanlistDataGridView.CellEnter

Gray road As OleDbDataReader

recIDLabel.Text = "0"

Try

gridFilter._sql = " CHOOSE pk_dloanid,pk_code as Specific,Old,Cr,Doctor FROM qloandetails "

gridFilter._criteria = " WHEREVER fk_mloanid =" & brloanlistDataGridView(0, brloanlistDataGridView.CurrentRow.Index).Value.ToString

gridFilter._orderBy = " ORDER BY old,pk_dloanid "

Contact fillGrid(gridFilter._ Sql GridFilter._, requirements orderBy, brloanDetailsDataGridView, Accurate)

cmdLocal = New OleDbCommand("SELECT * FROM tblloanmaster WHEREVER pk_mloanid=" & brloanlistDataGridView(0, brloanlistDataGridView.CurrentRow.Index).Value.ToString, mappDB.conn)

rd = cmdLocal.ExecuteReader

rd.Read()

If

recIDLabel.Text = road("pk_mloanid").ToString

loanRefLabel.Text = road("pk_loanref").ToString

datedTextBox.Text = CType(road("dated").ToString, Day).ToString("MMM dd yyyy")

duedateTextBox.Text = CType(road("duedate").ToString, Day).ToString("MMM dd yyyy")

comakerTextBox.Text = road("comaker").ToString

remarkTextBox.Text = road("comment").ToString

principalTextBox.Text = FormatNumber(road("primary").ToString, 2).ToString

monthlyintTextBox.Text = FormatNumber(road("curiosity").ToString, 2).ToString

monthlypenaltyTextBox.Text = FormatNumber(road("fee").ToString, 2).ToString

isactiveCheckBox.Checked = CType(road("isactive"), Boolean)

'monthInterestNumericUpDown.Value = CType(rd("interest").ToString, Decimal)

payableTextBox.Text = FormatNumber(CType(principalTextBox.Text, Double) * (CType(monthlyintTextBox.Text, Double) / 100), 2).ToString

'monthPenaltyNumericUpDown.Value = CType(rd("penalty").ToString, Decimal)

End If

Contact gldetails_totals()

Find ex As Exception

Contact showError(ex.Message)

Finally

mappDB.close()

rd = Nothing

End Try

End Sub

Private Sub quitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses quitToolStripMenuItem.Click

If MessageBox.Show("you may not wish to stop today?", strApplicationName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then Application.Exit()

End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

nowToolStripLabel.Text = System.DateTime.Now.ToString("MMM dd yyyy HH:mm:ss tt")

End Sub

Private Sub previousToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses previousToolStripButton.Click

bsGLSummary.MovePrevious()

End Sub

Private Sub generalledgersummaryDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Addresses glSumDataGridView.CellContentClick

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

brloanDetailsDataGridView.Rows(1).Selected = True

End Sub

Private Sub BackupDatabaseToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses BackupDatabaseToolStripMenuItem.Click

End Sub

Private Sub ToolStripLabel8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub upd_isactiveCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses upd_isactiveCheckBox.CheckedChanged

End Sub

Private Sub upd_isactiveCheckBox_CheckStateChanged(ByVal sender As Item, ByVal e As System.EventArgs) Addresses upd_isactiveCheckBox.CheckStateChanged

End Sub

Private Sub upd_isactiveCheckBox_Click(ByVal sender As Item, ByVal e As System.EventArgs) Addresses upd_isactiveCheckBox.Click

If upd_ToComboBox.Text.ToUpper = "DOCTOR" Then

upd_isactiveCheckBox.Checked = True

GoTo near

End If

Dim x As 0

For i As Integer = 0 To brLoanDetailsSumDataGridView.Rows.Count - 1

x += CType(brLoanDetailsSumDataGridView.Item(2, i).Value, Dual)

Next

If x - upd_AmtNumericUpDown.Value > 0 Then

upd_isactiveCheckBox.Checked = True

GoTo near

End If

Exit Sub

Near:

MessageBox.Show("Zero stability mortgage CAn't be close.", strApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information)

End Sub

Private Sub upd_AccntComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses upd_AccntComboBox.SelectedIndexChanged

End Sub

Private Sub upd_AccntComboBox_SelectionChangeCommitted(ByVal sender As Item, ByVal e As System.EventArgs) Addresses upd_AccntComboBox.SelectionChangeCommitted

'get stability of account

For i As Integer = 0 To brLoanDetailsSumDataGridView.Rows.Count - 1

If brLoanDetailsSumDataGridView.Item(1, i).Value.ToString = upd_AccntComboBox.Text.ToString Then

upd_AmtNumericUpDown.Value = CType(brLoanDetailsSumDataGridView.Item(4, i).Value, Decimal)

Exit For

End If

Next

End Sub

Private Sub generalledgersummaryDataGridView_CellEnter(ByVal sender As Item, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Addresses glSumDataGridView.CellEnter

Try

selectedrowindexToolStripTextBox.Text = CStr(e.RowIndex + 1)

Capture

End Try

End Sub

Private Sub filtervalueTextBox_KeyDown(ByVal sender As Item, ByVal e As System.Windows.Forms.KeyEventArgs) Addresses filtervalueTextBox.KeyDown

If e.KeyCode = Keys.Enter Then Contact searchfilterButton_Click(sender, e)

End Sub

Private Sub nextToolStripButton_Click(ByVal sender As Item, ByVal e As System.EventArgs) Addresses nextToolStripButton.Click

bsGLSummary.MoveNext()

End Sub

Private Sub firstToolStripButton_Click(ByVal sender As Item, ByVal e As System.EventArgs) Addresses firstToolStripButton.Click

bsGLSummary.MoveFirst()

End Sub

Private Sub lastToolStripButton_Click(ByVal sender As Item, ByVal e As System.EventArgs) Addresses lastToolStripButton.Click

bsGLSummary.MoveLast()

End Sub

Private Sub incZeroBalToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses incZeroBalToolStripButton.Click

incZeroBalToolStripButton.Checked = Not incZeroBalToolStripButton.Checked

End Sub

Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses ToolStripButton1.Click

Dim s As String = strApplicationName

s += vbCrLf & ConfigurationManager.AppSettings("customer").ToString

s += vbCrLf & vbCrLf & "Focused On:"

S += vbCrLf & " Ethan Althea "

s += vbCrLf & vbCrLf & "Developed By:" & vbCrLf & "SoftIndex Options 2009"

s += vbCrLf & "Jonathan Bantang"

MessageBox.Show(s, strApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information)

End Sub

End Class

Imports System.Data.OleDb

Public School accountForm

Gray oadmainLocal As OleDbDataAdapter

Gray dtmaindatatable As DataTable

Dim bs As New BindingSource

Private Sub accountForm_Load(ByVal sender As Item, ByVal e As System.EventArgs) Handles Me.Load

Contact fillGrid("CHOOSE pk_accntid, pk_code as Signal, Explanation FROM tblaccount", "")

End Sub

Private Sub mainDataGridView_CellEnter(ByVal sender As Item, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Addresses mainDataGridView.CellEnter

Try

selectedrowindexToolStripTextBox.Text = CStr(e.RowIndex + 1)

Capture

End Try

End Sub

Private Sub closeToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses closeToolStripButton.Click

Me.Close()

End Sub

Private Sub saveToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses saveToolStripButton.Click

Gray cmdblder As OleDbCommandBuilder = New OleDbCommandBuilder(oadmainLocal)

Gray _msg As String = String.Empty

Try

oadmainLocal.Update(dtmaindatatable)

_msg = "Update success. Press OK to carry on"

Find ex As Exception

_msg = "ERROR : " & ex.Message

Finally

MessageBox.Show(_msg, strApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information)

cmdblder = Nothing

_msg = Nothing

End Try

End Sub

Private Sub fillGrid(ByVal _sql As String, ByVal _criteria As String)

oadmainLocal = New OleDbDataAdapter(_sql + _criteria + " ORDER BY pk_code", mappDB.conn)

dtmaindatatable = New DataTable

Try

oadmainLocal.Fill(dtmaindatatable)

bs = New BindingSource

bs.DataSource = dtmaindatatable

With mainDataGridView

.DataSource = Nothing

'.DataSource = dtmaindatatable

.DataSource = bs

'format grid

.Columns(0).Visible = False

.Columns(1).Width = 150

.Columns(2).Width = 320

.SelectionMode = DataGridViewSelectionMode.FullRowSelect

.Cursor = Cursors.Hand

'TODO wordwrap posts that are desc

selectedrowindexToolStripTextBox.Text = "1"

totalrowsToolStripLabel.Text = "of " & .RowCount - 1

End With

'bs = Nothing

Find ex As Exception

MessageBox.Show("issue problem: " & ex.Message)

Finally

mappDB.close()

End Try

End Sub

Private Sub removeToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses removeToolStripButton.Click

Try

mainDataGridView.Rows.Remove(mainDataGridView.CurrentRow)

Find ex As Exception

Contact showError(ex.ToString)

End Try

End Sub

Private Sub previewToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses previewToolStripButton.Click

End Sub

Private Sub nextrowToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses nextrowToolStripButton.Click

bs.MoveNext()

End Sub

Private Sub firstrowToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses firstrowToolStripButton.Click

bs.MoveFirst()

End Sub

Private Sub lastrowToolStripButton_Click(ByVal sender As Item, ByVal e As System.EventArgs) Addresses lastrowToolStripButton.Click

bs.MoveLast()

End Sub

Private Sub previousrowToolStripButton_Click(ByVal sender As Item, ByVal e As System.EventArgs) Addresses previousrowToolStripButton.Click

bs.MovePrevious()

End Sub

Private Sub addToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses addToolStripButton.Click

Contact lastrowToolStripButton_Click(sender, e)

End Sub

Private Sub refreshToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses refreshToolStripButton.Click

End Sub

End Class

Imports System.Data.OleDb

Public School borrowerForm

Gray oadmainLocal As OleDbDataAdapter

Gray dtmaindatatable As DataTable

Dim bs As New BindingSource

Gray strAllTableColumns As String = "CHOOSE pk_borrowerid,lastname as [Lastname], firstname as [First-Name],jobtitle as [Job Subject], contactnos as [Contact Nos],Tackle,Organization FROM tblborrower"

Private Sub borrowerForm_FormClosing(ByVal sender As Item, ByVal e As System.Windows.Forms.FormClosingEventArgs) Addresses Me.FormClosing

oadmainLocal = Nothing

dtmaindatatable = Nothing

End Sub

Private Sub borrowerForm_Load(ByVal sender As Item, ByVal e As System.EventArgs) Handles Me.Load

Contact fillGrid(strAllTableColumns, "")

filteroptionToolStripButton.SelectedIndex = 0

End Sub

Private Sub mainDataGridView_CellEnter(ByVal sender As Item, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Addresses mainDataGridView.CellEnter

Try

currentRowToolStripTextBox.Text = CStr(e.RowIndex + 1)

Capture

End Try

End Sub

'local fillgrid. perform table update

Private Sub fillGrid(ByVal _sql As String, ByVal _criteria As String)

oadmainLocal = New OleDbDataAdapter(_sql + _criteria + " ORDER BY lastname", mappDB.conn)

dtmaindatatable = New DataTable

Try

oadmainLocal.Fill(dtmaindatatable)

bs = New BindingSource

bs.DataSource = dtmaindatatable

With mainDataGridView

.DataSource = Nothing

.DataSource = bs

'format grid

.Columns(0).Visible = False

.Columns(1).Width = 120

.Columns(2).Width = 120

.Columns(3).Width = 150

.Columns(4).Width = 120

.Columns(5).Width = 150

.Columns(6).Width = 150

.SelectionMode = DataGridViewSelectionMode.FullRowSelect

.Cursor = Cursors.Hand

'TODO wordwrap posts that are desc

'currentRowToolStripTextBox.Text = "1"

rowCountToolStripLabel.Text = "of " & .RowCount - 1

End With

Find ex As Exception

MessageBox.Show("issue problem: " & ex.Message)

Finally

mappDB.close()

End Try

End Sub

Private Sub closeToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses closeToolStripButton.Click

Me.Close()

End Sub

Private Sub saveToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses saveToolStripButton.Click

Gray cmdblder As OleDbCommandBuilder = New OleDbCommandBuilder(oadmainLocal)

Gray _msg As String = String.Empty

Try

oadmainLocal.Update(dtmaindatatable)

_msg = "Update success. Press OK to carry on"

Find ex As Exception

_msg = "ERROR : " & ex.Message

Finally

MessageBox.Show(_msg, strApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information)

cmdblder = Nothing

_msg = Nothing

End Try

End Sub

Private Sub searchmainfilterToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses searchmainfilterToolStripButton.Click

Select Event filteroptionToolStripButton.SelectedIndex

Circumstance 0 'all

Contact fillGrid(strAllTableColumns, "")

Case 1 'firstname

Contact fillGrid(strAllTableColumns, " WHERE firstname LIKE '" & filtervalueToolStripTextBox.Text.ToString & "%'")

Case 2 'lastname

Contact fillGrid(strAllTableColumns, " WHERE lastname LIKE '" & filtervalueToolStripTextBox.Text.ToString & "%'")

Case 3 'organization

Contact fillGrid(strAllTableColumns, " WHERE organization LIKE '" & filtervalueToolStripTextBox.Text.ToString & "%'")

End Select

End Sub

Private Sub removefilterToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses removefilterToolStripButton.Click

filteroptionToolStripButton.SelectedIndex = 0

Contact searchmainfilterToolStripButton_Click(sender, e)

End Sub

Private Sub removeToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses removeToolStripButton.Click

Try

mainDataGridView.Rows.Remove(mainDataGridView.CurrentRow)

Find ex As Exception

Contact showError(ex.ToString)

End Try

End Sub

Private Sub nextToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses nextToolStripButton.Click

bs.MoveNext()

End Sub

Private Sub firstToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses firstToolStripButton.Click

bs.MoveFirst()

End Sub

Private Sub lastToolStripButton_Click(ByVal sender As Item, ByVal e As System.EventArgs) Addresses lastToolStripButton.Click

bs.MoveLast()

End Sub

Private Sub previousToolStripButton_Click(ByVal sender As Item, ByVal e As System.EventArgs) Addresses previousToolStripButton3.Click

bs.MovePrevious()

End Sub

Private Sub mainDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Addresses mainDataGridView.CellContentClick

End Sub

Private Sub addToolStripButton_Click(ByVal sender As Item, ByVal e As System.EventArgs) Addresses addToolStripButton.Click

Contact lastToolStripButton_Click(sender, e)

'bs.AddNew()

End Sub

End Class

Imports System.Data.OleDb

Public School borrowForm

Gray cmdLocal As OleDbCommand

Private Sub closeToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses closeToolStripButton.Click

Me.Close()

End Sub

Private Sub applyToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses applyToolStripButton.Click

If Not IsNumeric(recIDLabel.Text) Then

MessageBox.Show("Press Fresh if you like to enter mortgage. Press okay to continue.", strApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information)

Exit Sub

End If

If that is principalNumericUpDown.Value <= 0 Then

MessageBox.Show("Primary CAn't be zero price. Press okay to carry on", strApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information)

Exit Sub

End If

If MessageBox.Show("are records appropriate?", strApplicationName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.No Then Exit Sub

Contact PayableTotal(sender, e)

Dim i As Integer = 0

Select Event CType(recIDLabel.Text.ToString, Integer)

Situation

cmdLocal = New OleDbCommand("INSERT INTO tblloanmaster(pk_loanref,fk_borrowerid,dated,duedate,comaker,remark,principal,interest,penalty) beliefs(@pk_loanref,@fk_borrowerid,@dated,duedate,comaker,remark,@principal,@interest,@penalty)", mappDB.conn)

Case Else

cmdLocal = New OleDbCommand("UPDATE tblloanmaster ESTABLISHED fk_borrowerid=@fk_borrowerid,comaker=@comaker,remark=@comment,principal=@primary,interest=@curiosity,penalty=@fee WHEREVER pk_mloanid=" & recIDLabel.Text, mappDB.conn)

GoTo update_only

End Select

With cmdLocal.Parameters

.Clear()

.Add("@ pk_loanref", OleDbType.VarChar, fifty, "pk_loanref").Value = loanRefLabel.Text

.Add("@ fk_borrowerID", 0, OleDbType.Integer, "fk_borrowerID").Value = borrowerComboBox.SelectedValue

.Add("@dated", OleDbType.Date, 0, "dated").Value = loanDateTimePicker.Value.ToString("MMM/dd/yyyy")

.Add("@duedate", OleDbType.Date, 0, "duedate").Value = duedateDateTimePicker.Value.ToString("MMM/dd/yyyy")

'.Add("@nextduedate", OleDbType.Date, 0, "nextduedate").Value = duedateDateTimePicker.Value.ToString("MMM/dd/yyyy")

.Add("@ comaker", OleDbType.VarChar, fifty, "comaker").Value = comakerTextBox.Text

.Add("@ remark", OleDbType.VarChar, fifty, "remark").Value = remarkTextBox.Text

.Add("@ principal", OleDbType.Decimal, 0, "principal").Value = principalNumericUpDown.Value

.Add("@interest", OleDbType.Decimal, 0, "interest").Value = monthInterestNumericUpDown.Value

.Add("@ penalty", OleDbType.Decimal, 0, "penalty").Value = monthPenaltyNumericUpDown.Value

End With

i = cmdLocal.ExecuteNonQuery()

Easily > 0 Then

cmdLocal = New OleDbCommand("CHOOSE pk_mloanid FROM tblloanmaster WHEREVER pk_loanref='" & loanRefLabel.Text.ToString & "'", mappDB.conn)

Poor road As OleDbDataReader = cmdLocal.ExecuteReader

rd.Read()

recIDLabel.Text = rd(0).ToString

rd = Nothing

If recIDLabel.Text "0" Then 'start the final rowid

'article to principal+due day to GL

cmdLocal = New OleDbCommand("INSERT INTO tblloandetails(fk_mloanid,fk_accntid,dated,cr) VALUES(@fk_mloanid,@fk_accntid,@dated,@cr)", mappDB.conn)

With cmdLocal.Parameters

.Add("@ fk_mloanid", 0, OleDbType.Integer, "fk_mloanid").Value = recIDLabel.Text

.Add("@ fk_accntid", 0, OleDbType.Integer, "fk_accntid").Value = principalComboBox.SelectedValue

.Add("@dated", OleDbType.Date, 0, "dated").Value = loanDateTimePicker.Value

.Add("@Cr", OleDbType.Decimal, 0, "Cr").Value = principalNumericUpDown.Value

End With

cmdLocal.ExecuteNonQuery()

'article to GL to primary interest+due day

cmdLocal = New OleDbCommand("INSERT INTO tblloandetails(fk_mloanid,fk_accntid,dated,cr) VALUES(@fk_mloanid,@fk_accntid,@dated,@cr)", mappDB.conn)

With cmdLocal.Parameters

.Add("@ fk_mloanid", 0, OleDbType.Integer, "fk_mloanid").Value = recIDLabel.Text

.Add("@ fk_accntid", 0, OleDbType.Integer, "fk_accntid").Value = interestComboBox.SelectedValue

.Add("@dated", OleDbType.Date, 0, "dated").Value = loanDateTimePicker.Value

.Add("@Cr", OleDbType.Decimal, 0, "Cr").Value = CType(payableTextBox.Text, Increase)

End With

cmdLocal.ExecuteNonQuery()

End If

cmdLocal = Nothing

End If

update_only:

mappDB.close()

If MessageBox.Show(borrowerComboBox.Text.ToUpper & " mortgage has become preserved. Create New Mortgage?", strApplicationName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Subsequently Contact newToolStripButton_Click(sender, e)

End Sub

Private Sub newLoanForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Contact combolist("SELECT * from qborrower", "pk_borrowerid", "fullname", borrowerComboBox)

End Sub

Purpose loanID() As String

cmdLocal = New OleDbCommand("SELECT COUNT(pk_mloanid) as x from tblloanmaster", mappDB.conn)

Poor road As OleDbDataReader = cmdLocal.ExecuteReader

rd.Read()

Return Date.Today.ToString("MMdd") & "-" & CStr(Format(CType(rd(0), Integer) + 1, "0000"))

rd = Nothing

cmdLocal = Nothing

mappDB.close()

End Function

Private Sub newToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses newToolStripButton.Click

loanRefLabel.Text = loanID()

recIDLabel.Text = "0"

loanDateTimePicker.Value = Now

duedateDateTimePicker.Value = DateAdd(DateInterval.Month, 1, Today)

payableTextBox.Text = "0.00"

principalNumericUpDown.Value = 0

remarkTextBox.Text = "Mortgage releasedate ."

monthInterestNumericUpDown.Value = 10

monthPenaltyNumericUpDown.Value = 3

Contact combolist("CHOOSE pk_accntID,pk_code FROM tblaccount ORDER BY explanation", "pk_accntid", "pk_code", principalComboBox)

Contact combolist("CHOOSE pk_accntID,pk_code FROM tblaccount ORDER BY explanation", "pk_accntid", "pk_code", interestComboBox)

End Sub

Sub PayableTotal(ByVal sender As Item, ByVal e As EventArgs) Addresses principalNumericUpDown.ValueChanged, monthInterestNumericUpDown.ValueChanged

payableTextBox.Text = CStr(CType(principalNumericUpDown.Value, Increase) * (CType(monthInterestNumericUpDown.Value, Increase) / 100))

End Sub

Private Sub payableTextBox_KeyPress(ByVal sender As Item, ByVal e As System.Windows.Forms.KeyPressEventArgs) Addresses payableTextBox.KeyPress

e.Handled = True

End Sub

Private Sub payableTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses payableTextBox.TextChanged

End Sub

End Class

Imports System.data.OleDb

Public School rptAccountForm

Gray cmdlocal As OleDbCommand

Gray road As OleDbDataReader

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Contact combolist("CHOOSE pk_accntid,pk_code from tblaccount", "pk_accntid", "pk_code", AccntComboBox)

End Sub

Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses ToolStripButton1.Click

Me.Cursor = Cursors.WaitCursor

Dim strCriteria As String = String.Empty

Dim i As Integer = 1

Dim r As Integer = 5

If AccntComboBox.Text.ToUpper "ALL" Then strCriteria = " AND pk_accntid=" & AccntComboBox.SelectedValue.ToString

excelApp = New Excel.Application

excelWB = excelApp.Workbooks.Open(Application.StartupPath & "templatesaccount.xlt")

excelWS = CType(excelWB.Sheets(1), Excel.Worksheet)

excelWS.Cells(1, ExcelColumns.colF) = AccntComboBox.Text.ToString

excelWS.Cells(2, ExcelColumns.colF) = fromDateTimePicker.Value.ToString("MMM dd yyyy") & Chr(10) & toDateTimePicker.Value.ToString("MMM dd yyyy")

cmdlocal = New OleDbCommand("SELECT * from qrptaccount WHEREVER dated BETWEEN #" & fromDateTimePicker.Value.ToString("MMM dd yyyy") & "# AND #" & toDateTimePicker.Value.ToString("MMM dd yyyy") & "# " & strCriteria, mappDB.conn)

rd = cmdlocal.ExecuteReader

Although rd.Read

With excelWS

.Cells(r, ExcelColumns.colA) = r - 4

.Cells(r, ExcelColumns.colB) = road("pk_code").ToString

.Cells(r, ExcelColumns.colC) = road("fullname").ToString

.Cells(r, ExcelColumns.colD) = CType(rd("dated").ToString, Date).ToString("MMM dd yyyy")

.Cells(r, ExcelColumns.colE) = road("cr").ToString

.Cells(r, ExcelColumns.colF) = road("doctor").ToString

r += 1

End With

End While

'add doctor and cr amount

excelWS.Cells(r, ExcelColumns.colE) = "=SUM(E5:E" & r - 1 & ")"

excelWS.Cells(r, ExcelColumns.colF) = "=SUM(F5:F" & r - 1 & ")"

excelWS.Cells(r, ExcelColumns.colA) = "Whole"

excelWS.Range("A" & r & ":N" & r).Merge()

excelWS.Range("A" & r).HorizontalAlignment = -4131

If r > 6 Then Contact drawBorder("A6:Y" & r)

excelApp.Visible = True

'cleanup parameters

mappDB.close()

rd = Nothing

cmdlocal = Nothing

r = Nothing

excelWS = Nothing

excelWB = Nothing

excelApp = Nothing

Me.Cursor = Cursors.Default

End Sub

Private Sub ToolStripButton2_Click(ByVal sender As Item, ByVal e As System.EventArgs) Addresses ToolStripButton2.Click

Me.Close()

End Sub

Private Sub viewAllToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses viewAllToolStripButton.Click

End Sub

End Class

Imports System.Data.OleDb

Public School rptDueDateForm

Gray cmdlocal As OleDbCommand

Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Addresses ToolStripButton1.Click

Me.Cursor = Cursors.WaitCursor

Dim r As Integer = 4

excelApp = New Excel.Application

excelWB = excelApp.Workbooks.Open(Application.StartupPath & "templatesduedate.xlt")

excelWS = CType(excelWB.Sheets(1), Excel.Worksheet)

cmdlocal = New OleDbCommand("SELECT * from qrptduedate WHEREVER duedate BETWEEN #" & fromDateTimePicker.Value.ToString("MMM dd yyyy") & "# AND #" & toDateTimePicker.Value.ToString("MMM dd yyyy") & "# ORDER BY duedate", mappDB.conn)

Poor road As OleDbDataReader = cmdlocal.ExecuteReader

Although rd.Read

With excelWS

.Cells(r, ExcelColumns.colA) = r - 3

.Cells(r, ExcelColumns.colB) = road("fullname").ToString

.Cells(r, ExcelColumns.colC) = road("pk_loanref").ToString

.Cells(r, ExcelColumns.colD) = CType(rd("duedate").ToString, Date).ToString("MMM dd yyyy")

.Cells(r, ExcelColumns.colE) = road("sumofcr").ToString

.Cells(r, ExcelColumns.colF) = road("sumofdr").ToString

.Cells(r, ExcelColumns.colG) = road("stability").ToString

r += 1

End With

End While

'add doctor and cr amount

excelWS.Cells(r, ExcelColumns.colE) = "=SUM(E4:E" & r - 1 & ")"

excelWS.Cells(r, ExcelColumns.colF) = "=SUM(F4:F" & r - 1 & ")"

excelWS.Cells(r, ExcelColumns.colG) = "=SUM(G4:G" & r - 1 & ")"

excelWS.Cells(r, ExcelColumns.colA) = "Whole"

excelWS.Range("A" & r & ":N" & r).Merge()

excelWS.Range("A" & r).HorizontalAlignment = -4131

'If r > 5 Then

'End If

Contact drawBorder("A4:GARY" & r)

excelApp.Visible = True

'cleanup parameters

mappDB.close()

rd = Nothing

cmdlocal = Nothing

r = Nothing

excelWS = Nothing

excelWB = Nothing

excelApp = Nothing

Me.Cursor = Cursors.Default

End Sub

Private Sub ToolStripButton2_Click(ByVal sender As Item, ByVal e As System.EventArgs) Addresses ToolStripButton2.Click

Me.Close()

End Sub

End Class