/// <summary> /// This function displays information about current application being worked /// </summary> public void showLoanAppInfo() { mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter(); InvestmentDSTableAdapters.GetInvestmentAppTableAdapter invApp = new InvestmentDSTableAdapters.GetInvestmentAppTableAdapter(); InvestmentDS.GetInvestmentAppDataTable tblInvApp = invApp.GetInvestmentApp(MySessionManager.InvAppID); if (tblInvApp.Rows.Count > 0) { try { this.lblapplicantName.InnerText = client.GetClientsName(MySessionManager.ClientID).ToString(); this.lblClientNo.InnerText = client.GetClientNo(MySessionManager.ClientID).ToString(); if (tblInvApp[0].IsdatInvestmentAmountNull() == false) { this.lblInvestmentAmount.InnerText = tblInvApp[0].datInvestmentAmount.ToString("c").Replace("$", ""); } if (tblInvApp[0].IsdatInvestmentNameNull() == false) { this.lblInvestmentName.InnerText = tblInvApp[0].datInvestmentName.ToString(); } if (tblInvApp[0].IsdatTermsNull() == false) { this.lblTerm.InnerText = util.displayValue("opt_terms", tblInvApp[0].datTerms.ToString()) + " days"; } if (tblInvApp[0].IsdatApplicationNumberNull() == false) { this.lblAppNo.InnerText = tblInvApp[0].datApplicationNumber.ToString(); } if (tblInvApp[0].IsdatValueDateNull() == false) { this.lblValueDate.InnerText = tblInvApp[0].datValueDate.ToString("c").Replace("$", ""); } if (tblInvApp[0].IsdatInvestmentTypeNull() == false) { this.lblInvtype.InnerText = util.displayValue("opt_investment_types", tblInvApp[0].datInvestmentType.ToString()); } if (tblInvApp[0].IsdatFrequencyOfInterestPaymentNull() == false) { this.lblAccInterest.InnerText = tblInvApp[0].datFrequencyOfInterestPayment.ToString(); } } catch (Exception ex) { } } }
public void showLoanAppInfo() { mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter(); InvestmentDSTableAdapters.GetInvestmentAppTableAdapter invApp = new InvestmentDSTableAdapters.GetInvestmentAppTableAdapter(); InvestmentDS.GetInvestmentAppDataTable tblInvApp = invApp.GetInvestmentApp(MySessionManager.InvAppID); if (tblInvApp.Rows.Count > 0) { try { this.lblapplicantName.InnerText = client.GetClientsName(MySessionManager.ClientID).ToString(); this.lblClientNo.InnerText = client.GetClientNo(MySessionManager.ClientID).ToString(); if (tblInvApp[0].IsdatInvestmentAmountNull() == false) { this.lblInvestmentAmount.InnerText = tblInvApp[0].datInvestmentAmount.ToString("c").Replace("$", ""); } if (tblInvApp[0].IsdatInvestmentNameNull() == false) { this.lblInvestmentName.InnerText = tblInvApp[0].datInvestmentName.ToString(); } if (tblInvApp[0].IsdatTermsNull() == false) { this.lblTerm.InnerText = util.displayValue("opt_terms", tblInvApp[0].datTerms.ToString()) + " days"; } if (tblInvApp[0].IsdatApplicationNumberNull() == false) { this.lblAppNo.InnerText = tblInvApp[0].datApplicationNumber.ToString(); } if (tblInvApp[0].IsdatValueDateNull() == false) { this.lblValueDate.InnerText = tblInvApp[0].datValueDate.ToString("c").Replace("$", ""); } if (tblInvApp[0].IsdatInvestmentTypeNull() == false) { this.lblInvtype.InnerText = util.displayValue("opt_investment_types", tblInvApp[0].datInvestmentType.ToString()); } if (tblInvApp[0].IsdatFrequencyOfInterestPaymentNull() == false) { this.lblAccInterest.InnerText = tblInvApp[0].datFrequencyOfInterestPayment.ToString(); } if (tblInvApp[0].IsdatValueDateNull() == false) { this.lblValueDate.InnerText = tblInvApp[0].datValueDate.ToString("dd-MM-yyyy"); } } catch (Exception ex) { } } }
public void showAccountInfomartion() { try { LoanAccountDSTableAdapters.GetLoanAccountTableAdapter loanAcc = new LoanAccountDSTableAdapters.GetLoanAccountTableAdapter(); LoanAccountDS.GetLoanAccountRow tblLoanAcc = loanAcc.GetLoanAccount(Convert.ToInt32(MySessionManager.AccountID))[0]; mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter(); lblAccNo.InnerText = " " + tblLoanAcc.datAccountNumber.ToString(); lblClienttName.InnerText = " " + tblLoanAcc.datClientFullName.ToString(); lblEmail.InnerText = " " + tblLoanAcc.datIssueDate.ToString("d MMMM yyyy"); lblloantype.InnerText = " " + util.displayValue("opt_loan_types", tblLoanAcc.datLoanType.ToString()); lblAmtOutstanding.InnerText = " " + tblLoanAcc.datOutstandingAmount.ToString("c").Replace("$", ""); lblloanAmount.InnerText = " " + tblLoanAcc.datInitialAmount.ToString("c").Replace("$", ""); lblClientNo.InnerText = " " + client.GetClientNo(tblLoanAcc.datClientID); lblDuration.InnerText = " " + tblLoanAcc.datDuration.ToString() + " month(s)"; lblIntRate.InnerText = " " + tblLoanAcc.datInterestRate.ToString("c").Replace("$", "") + "%"; } catch (Exception ex) { } }
public void showAccountInfomartion() { try { LoanAccountDSTableAdapters.GetLoanAccountTableAdapter loanAcc = new LoanAccountDSTableAdapters.GetLoanAccountTableAdapter(); LoanAccountDS.GetLoanAccountRow tblLoanAcc = loanAcc.GetLoanAccount(Convert.ToInt32(MySessionManager.AccountID))[0]; mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter(); lblAccNo.InnerText = " " + tblLoanAcc.datAccountNumber.ToString(); lblClienttName.InnerText = " " + tblLoanAcc.datClientFullName.ToString(); lblEmail.InnerText = " " + tblLoanAcc.datIssueDate.ToString("d MMMM yyyy"); lblloantype.InnerText = " " + util.displayValue("opt_loan_types", tblLoanAcc.datLoanType.ToString()); lblAmtOutstanding.InnerText = " " + tblLoanAcc.datOutstandingAmount.ToString("c").Replace("$", ""); lblloanAmount.InnerText = " " + tblLoanAcc.datInitialAmount.ToString("c").Replace("$", ""); lblClientNo.InnerText = " " + client.GetClientNo(tblLoanAcc.datClientID); lblDuration.InnerText = " " + tblLoanAcc.datDuration.ToString()+" month(s)"; lblIntRate.InnerText = " " + tblLoanAcc.datInterestRate.ToString("c").Replace("$", "") + "%"; } catch (Exception ex) { } }
public void showLoanAppInfo() { mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter(); LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter(); LoanDS.LoanApplicationsDataTable tblLoanApp = loanApp.GetLoanApplication(MySessionManager.AppID.ToString()); if (tblLoanApp.Rows.Count > 0) { try { this.lblapplicantName.InnerText = client.GetClientsName(MySessionManager.ClientID).ToString(); this.lblInterestRate.InnerText = tblLoanApp[0].datInterestRate.ToString("c").Replace("$", "") + "%"; this.lblDuration.InnerText = tblLoanApp[0].datDuration.ToString() + " month(s)"; this.lblAppNo.InnerText = tblLoanApp[0].datApplicationNumber.ToString(); this.loanAmount.InnerText = tblLoanApp[0].datLoanAmount.ToString("c").Replace("$", ""); this.lblloantype.InnerText = util.displayValue("opt_loan_types", tblLoanApp[0].datLoanType.ToString()); this.lblClientNo.InnerText = client.GetClientNo(MySessionManager.ClientID).ToString(); } catch (Exception ex) { } } }
public void showLoanAppInfo() { mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter(); LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter(); LoanDS.LoanApplicationsDataTable tblLoanApp = loanApp.GetLoanApplication(MySessionManager.AppID.ToString()); if (tblLoanApp.Rows.Count > 0) { try { this.lblapplicantName.InnerText = client.GetClientsName(MySessionManager.ClientID).ToString(); this.lblInterestRate.InnerText = tblLoanApp[0].datInterestRate.ToString("c").Replace("$", "") + "%"; this.lblDuration.InnerText = tblLoanApp[0].datDuration.ToString() + " month(s)"; this.lblAppNo.InnerText = tblLoanApp[0].datApplicationNumber.ToString(); this.loanAmount.InnerText = tblLoanApp[0].datLoanAmount.ToString("c").Replace("$", ""); this.lblloantype.InnerText = util.displayValue("opt_loan_types", tblLoanApp[0].datLoanType.ToString()); this.lblClientNo.InnerText = client.GetClientNo(MySessionManager.ClientID).ToString(); } catch (Exception ex) { } } }
protected void btnFinalize_Click(object sender, EventArgs e) { MySessionManager.cash = 0; MySessionManager.bank = 0; decimal amtDeductable= 0; decimal fees = 0; decimal amt =0; int ops =0; mTempTableAdapters.GetTransactionDetailsTableAdapter tempHolder = new mTempTableAdapters.GetTransactionDetailsTableAdapter(); mTemp.GetTransactionDetailsDataTable tblTempHolder = tempHolder.GetAccTransactions(Convert.ToInt32( MySessionManager.AccountID)); LoanDSTableAdapters.FinancialTransactionsTableAdapter fintrans = new LoanDSTableAdapters.FinancialTransactionsTableAdapter(); int rows = tblTempHolder.Rows.Count; for (int i = 0; i < rows; i++) { int? datDebitAc = null; int? datCreditAc = null; if (tblTempHolder[i].datDebit > 0) { datDebitAc = tblTempHolder[i].datAccountID; amt=tblTempHolder[i].datDebit; amtDeductable = amtDeductable + tblTempHolder[i].datDebit; ops = 1; } else if (tblTempHolder[i].datCredit > 0) { datCreditAc = tblTempHolder[i].datAccountID; amt = tblTempHolder[i].datCredit; amtDeductable = amtDeductable - tblTempHolder[i].datCredit; ops = 2; } // if (tblTempHolder[i].datPaymentMethod == 1) { getAmtForPaymentMode(amt,"cash",ops); } else if (tblTempHolder[i].datPaymentMethod == 2) { getAmtForPaymentMode(amt, "bank", ops); } fintrans.InsertFinancialTransaction(MySessionManager.AppID, MySessionManager.ClientID, tblTempHolder[i].datAccountID, Convert.ToInt32(MySessionManager.AccountID), tblTempHolder[i].datDescription, batch(), tblTempHolder[i].datPaymentMethod, MySessionManager.CurrentUser.BranchID, tblTempHolder[i].datCredit, tblTempHolder[i].datDebit, datCreditAc, datDebitAc, 0, MySessionManager.CurrentUser.UserID); } mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter(); LoanAccountDSTableAdapters.GetLoanAccountTableAdapter loanAcc = new LoanAccountDSTableAdapters.GetLoanAccountTableAdapter(); LoanAccountDS.GetLoanAccountDataTable tblLoaonAcc = loanAcc.GetLoanAccount(Convert.ToInt32(MySessionManager.AccountID)); LoanAccountDSTableAdapters.GetAllLoanRepaymentsTableAdapter repayment = new LoanAccountDSTableAdapters.GetAllLoanRepaymentsTableAdapter(); if(tblLoaonAcc.Rows.Count>0) { repayment.InsertLoanRepayment(receiptNo(), DateTime.Now, tblLoaonAcc[0].datID, tblLoaonAcc[0].datAccountNumber.ToString(), client.GetClientNo(Convert.ToInt32(MySessionManager.AccountID)), tblLoaonAcc[0].datIssueDate, tblLoaonAcc[0].datInterestRate, MySessionManager.cash, MySessionManager.bank, (MySessionManager.cash + MySessionManager.bank), fees, tblLoaonAcc[0].datLoanType, tblLoaonAcc[0].datPurpose, tblLoaonAcc[0].datTeamID, MySessionManager.CurrentUser.UserID); } loanAcc.UpdateNewAmtOutstanding(amtDeductable,Convert.ToInt32(MySessionManager.AccountID)); decimal outstanding=Convert.ToDecimal(loanAcc.GetAmtOutstanding(Convert.ToInt32(MySessionManager.AccountID))); if (outstanding <= 0) { loanAcc.UpdateCloseAccount(Convert.ToInt32(MySessionManager.AccountID)); } tempHolder.DeleteTempTransByAccID(Convert.ToInt32(MySessionManager.AccountID)); }
protected void btnFinalize_Click(object sender, EventArgs e) { MySessionManager.cash = 0; MySessionManager.bank = 0; decimal amtDeductable = 0; decimal fees = 0; decimal amt = 0; int ops = 0; mTempTableAdapters.GetTransactionDetailsTableAdapter tempHolder = new mTempTableAdapters.GetTransactionDetailsTableAdapter(); mTemp.GetTransactionDetailsDataTable tblTempHolder = tempHolder.GetAccTransactions(Convert.ToInt32(MySessionManager.AccountID)); LoanDSTableAdapters.FinancialTransactionsTableAdapter fintrans = new LoanDSTableAdapters.FinancialTransactionsTableAdapter(); int rows = tblTempHolder.Rows.Count; for (int i = 0; i < rows; i++) { int?datDebitAc = null; int?datCreditAc = null; if (tblTempHolder[i].datDebit > 0) { datDebitAc = tblTempHolder[i].datAccountID; amt = tblTempHolder[i].datDebit; amtDeductable = amtDeductable + tblTempHolder[i].datDebit; ops = 1; } else if (tblTempHolder[i].datCredit > 0) { datCreditAc = tblTempHolder[i].datAccountID; amt = tblTempHolder[i].datCredit; amtDeductable = amtDeductable - tblTempHolder[i].datCredit; ops = 2; } // if (tblTempHolder[i].datPaymentMethod == 1) { getAmtForPaymentMode(amt, "cash", ops); } else if (tblTempHolder[i].datPaymentMethod == 2) { getAmtForPaymentMode(amt, "bank", ops); } fintrans.InsertFinancialTransaction(MySessionManager.AppID, MySessionManager.ClientID, tblTempHolder[i].datAccountID, Convert.ToInt32(MySessionManager.AccountID), tblTempHolder[i].datDescription, batch(), tblTempHolder[i].datPaymentMethod, MySessionManager.CurrentUser.BranchID, tblTempHolder[i].datCredit, tblTempHolder[i].datDebit, datCreditAc, datDebitAc, 0, MySessionManager.CurrentUser.UserID); } mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter(); LoanAccountDSTableAdapters.GetLoanAccountTableAdapter loanAcc = new LoanAccountDSTableAdapters.GetLoanAccountTableAdapter(); LoanAccountDS.GetLoanAccountDataTable tblLoaonAcc = loanAcc.GetLoanAccount(Convert.ToInt32(MySessionManager.AccountID)); LoanAccountDSTableAdapters.GetAllLoanRepaymentsTableAdapter repayment = new LoanAccountDSTableAdapters.GetAllLoanRepaymentsTableAdapter(); if (tblLoaonAcc.Rows.Count > 0) { repayment.InsertLoanRepayment(receiptNo(), DateTime.Now, tblLoaonAcc[0].datID, tblLoaonAcc[0].datAccountNumber.ToString(), client.GetClientNo(Convert.ToInt32(MySessionManager.AccountID)), tblLoaonAcc[0].datIssueDate, tblLoaonAcc[0].datInterestRate, MySessionManager.cash, MySessionManager.bank, (MySessionManager.cash + MySessionManager.bank), fees, tblLoaonAcc[0].datLoanType, tblLoaonAcc[0].datPurpose, tblLoaonAcc[0].datTeamID, MySessionManager.CurrentUser.UserID); } loanAcc.UpdateNewAmtOutstanding(amtDeductable, Convert.ToInt32(MySessionManager.AccountID)); decimal outstanding = Convert.ToDecimal(loanAcc.GetAmtOutstanding(Convert.ToInt32(MySessionManager.AccountID))); if (outstanding <= 0) { loanAcc.UpdateCloseAccount(Convert.ToInt32(MySessionManager.AccountID)); } tempHolder.DeleteTempTransByAccID(Convert.ToInt32(MySessionManager.AccountID)); }