private void tsbPrint_Click(object sender, EventArgs e) { frmReport report = new frmReport(); report.reportType = ReportType.Receipt; clsReceiptEntry entry = new clsReceiptEntry(); entry.RegistrationNo = txtRegistrationNo.Text; entry.ClientName = txtName.Text; entry.ReceiptAmount = Convert.ToDecimal(txtReceiptAmount.Text); entry.ReceiptMode = cmbReceiptMode.Text; entry.InstrumentNumber = txtInstrumentNo.Text; entry.InstrumentDate = dtpInstrument.Value.Date; entry.DraweeBank = txtDraweeBank.Text; entry.DraweeBranch = txtDraweeBranch.Text; entry.DepositBy = txtDepositBy.Text; entry.DepositDate = dtpDeposit.Value.Date; entry.Remarks = txtRemarks.Text; entry.ReceiptDate = dtpReceived.Value.Date; entry.ReceiptNumber = txtReceiptNumber.Text; entry.FatherName = txtFatherName.Text; entry.OnAccountOf = txtAccount.Text; entry.PlotSize = txtPlotSize.Text; report.receipt = entry; report.Show(); }
private void LoadReceiptEntry() { receiptEntry = da.GetReceiptEntry(receiptId); if (receiptEntry != null) { txtRegistrationNo.Text = receiptEntry.RegistrationNo; txtName.Text = receiptEntry.ClientName; txtClientID.Text = receiptEntry.ClientID; txtReceiptAmount.Text = receiptEntry.ReceiptAmount.ToString("N2"); txtAppliedAmount.Text = receiptEntry.AppliedAmount.ToString("N2"); txtRemainingAmount.Text = receiptEntry.CurrentAmount.ToString("N2"); cmbReceiptMode.Text = receiptEntry.ReceiptMode; txtInstrumentNo.Text = receiptEntry.InstrumentNumber; dtpInstrument.Value = receiptEntry.InstrumentDate; txtDraweeBank.Text = receiptEntry.DraweeBank; txtDraweeBranch.Text = receiptEntry.DraweeBranch; cmbDepositBank.Text = receiptEntry.DepositBank; txtDepositAcc.Text = receiptEntry.DepositAccount; txtDepositBy.Text = receiptEntry.DepositBy; dtpDeposit.Value = receiptEntry.DepositDate; dtpClearance.Value = receiptEntry.ClearanceDate; txtRemarks.Text = receiptEntry.Remarks; dtpReceived.Value = receiptEntry.ReceiptDate; txtReceiptNumber.Text = receiptEntry.ReceiptNumber; txtAccount.Text = receiptEntry.OnAccountOf; cmbClearanceStatus.Text = receiptEntry.ClearStatus; //if (receiptEntry.Cleared == true) // cmbClearanceStatus.Text = "Cleared"; //else if (receiptEntry.Cleared == false) // cmbClearanceStatus.Text = "Not Cleared"; LoadMemberInstallmentPlanFromReceipt(); var info = da.GetMemberRegistrationInfo(receiptEntry.RegistrationNo); txtName.Text = info.Name; txtFatherName.Text = info.FatherOrHusband; txtPlotSize.Text = info.Plan; txtUnitID.Text = info.Plot; if (info.Plot != "" || info.Plot != null) { var unit = da.GetUnitByUnitID(info.Plot); txtPlotCategory.Text = unit.strUnitTypeID; } } }
private void LoadReceiptEntry() { receiptEntry = da.GetReceiptEntry(receiptId); if (receiptEntry != null) { txtRegistrationNo.Text = receiptEntry.RegistrationNo; txtName.Text = receiptEntry.ClientName; txtClientID.Text = receiptEntry.ClientID; txtReceiptAmount.Text = receiptEntry.ReceiptAmount.ToString("N2"); txtAppliedAmount.Text = receiptEntry.AppliedAmount.ToString("N2"); txtRemainingAmount.Text = receiptEntry.CurrentAmount.ToString("N2"); cmbReceiptMode.Text = receiptEntry.ReceiptMode; txtInstrumentNo.Text = receiptEntry.InstrumentNumber; dtpInstrument.Value = receiptEntry.InstrumentDate; cmbDraweeBank.Text = receiptEntry.DraweeBank; cmbDraweeBranch.Text = receiptEntry.DraweeBranch; cmbDepositBank.Text = receiptEntry.DepositBank; txtDepositAcc.Text = receiptEntry.DepositAccount; txtDepositBy.Text = receiptEntry.DepositBy; dtpDeposit.Value = receiptEntry.DepositDate; dtpClearance.Value = receiptEntry.ClearanceDate; txtRemarks.Text = receiptEntry.Remarks; dtpReceived.Value = receiptEntry.ReceiptDate; txtReceiptNumber.Text = receiptEntry.ReceiptNumber; if (receiptEntry.Cleared == true) { cmbClearanceStatus.Text = "Cleared"; } else if (receiptEntry.Cleared == false) { cmbClearanceStatus.Text = "Not Cleared"; } LoadMemberInstallmentPlanFromReceipt(); LoadMemberOtherPaymentPlanFromReceipt(); } }
private void tsbSave_Click(object sender, EventArgs e) { if (!ValidateBeforeSave()) { return; } clsReceiptEntry entry = new clsReceiptEntry(); entry.intId = this.receiptId; entry.RegistrationNo = txtRegistrationNo.Text; entry.ClientName = txtName.Text; entry.ClientID = txtClientID.Text; entry.ReceiptAmount = Convert.ToDecimal(txtReceiptAmount.Text); entry.AppliedAmount = Convert.ToDecimal(txtAppliedAmount.Text); entry.CurrentAmount = Convert.ToDecimal(txtRemainingAmount.Text); entry.ReceiptMode = cmbReceiptMode.Text; entry.InstrumentNumber = txtInstrumentNo.Text; entry.InstrumentDate = dtpInstrument.Value.Date; entry.DraweeBank = cmbDraweeBank.Text; entry.DraweeBranch = cmbDraweeBranch.Text; entry.DepositBank = cmbDepositBank.Text; entry.DepositAccount = txtDepositAcc.Text; entry.DepositBy = txtDepositBy.Text; entry.DepositDate = dtpDeposit.Value.Date; entry.ClearanceDate = dtpClearance.Value.Date; entry.Remarks = txtRemarks.Text; entry.ReceiptDate = dtpReceived.Value.Date; entry.ReceiptNumber = txtReceiptNumber.Text; entry.Project = cmbProjects.Text; if (receiptId == 0) { entry.SentToGP = false; } else { entry.SentToGP = this.receiptEntry.SentToGP; } if (cmbClearanceStatus.Text == "Cleared") { entry.Cleared = true; } else { entry.Cleared = false; } bool result = da.AddReceiptEntry(entry); if (result == false) { MessageBox.Show("Receipt Entry could not be saved."); return; } List <clsMemberRecoveryPlan> lst = new List <clsMemberRecoveryPlan>(); List <clsReceiptApply> lstApply = new List <clsReceiptApply>(); foreach (DataGridViewRow dgr in dgOtherRecoveryList.Rows) { if (Convert.ToBoolean(dgr.Cells["ApplyOther"].Value) == true) { clsMemberRecoveryPlan line = new clsMemberRecoveryPlan(); line.intId = Convert.ToInt32(dgr.Cells["OtherID"].Value); line.decAmountWaived = Convert.ToDecimal(dgr.Cells["TotalWaivedOther"].Value); line.decAmountApplied = Convert.ToDecimal(dgr.Cells["OtherReceivedAmount"].Value); line.decOutStandingAmount = Convert.ToDecimal(dgr.Cells["OutStandingOther"].Value); lst.Add(line); clsReceiptApply applyLine = new clsReceiptApply(); applyLine.RecoveryPlanid = Convert.ToInt32(dgr.Cells["OtherID"].Value); applyLine.RegistrationNo = txtRegistrationNo.Text; applyLine.ClientID = txtClientID.Text; applyLine.Receiptnumber = txtReceiptNumber.Text; applyLine.decAppliedAmount = Convert.ToDecimal(dgr.Cells["AppliedAmountOther"].Value); applyLine.decWaivedAmount = Convert.ToDecimal(dgr.Cells["OtherWaivedAmt"].Value); lstApply.Add(applyLine); } } foreach (DataGridViewRow dgr in dgInstallmentList.Rows) { if (Convert.ToBoolean(dgr.Cells["ApplyInstallment"].Value) == true) { clsMemberRecoveryPlan line = new clsMemberRecoveryPlan(); line.intId = Convert.ToInt32(dgr.Cells["InstallmentID"].Value); line.decAmountWaived = Convert.ToDecimal(dgr.Cells["TotalWaivedInst"].Value); line.decAmountApplied = Convert.ToDecimal(dgr.Cells["InstallmentReceivedAmount"].Value); line.decOutStandingAmount = Convert.ToDecimal(dgr.Cells["InstallmentOutStanding"].Value); lst.Add(line); clsReceiptApply applyLine = new clsReceiptApply(); applyLine.RecoveryPlanid = Convert.ToInt32(dgr.Cells["InstallmentID"].Value); applyLine.RegistrationNo = txtRegistrationNo.Text; applyLine.ClientID = txtClientID.Text; applyLine.Receiptnumber = txtReceiptNumber.Text; applyLine.decAppliedAmount = Convert.ToDecimal(dgr.Cells["AppliedAmountInst"].Value); applyLine.decWaivedAmount = Convert.ToDecimal(dgr.Cells["InstallmentWaived"].Value); lstApply.Add(applyLine); } } result = da.UpdateMemberOtherRecoveryPlan(lst); if (result == false) { MessageBox.Show("Member recovery plan could not be updated."); return; } result = da.AddReceiptApply(lstApply); if (result == false) { MessageBox.Show("Receipts apply information could not be saved."); return; } Clear(); }