protected void txtLoanAppAmount_TextChanged(object sender, EventArgs e) { A2ZSTAFFLOANDTO getDTO = new A2ZSTAFFLOANDTO(); getDTO.LoanApplicationAmount = Converter.GetDecimal(txtLoanAppAmount.Text); txtLoanAppAmount.Text = Converter.GetString(String.Format("{0:0,0.00}", getDTO.LoanApplicationAmount)); txtNoInstallment.Focus(); }
protected void BtnUpdate_Click(object sender, EventArgs e) { try { A2ZSTAFFLOANDTO UpDTO = new A2ZSTAFFLOANDTO(); UpDTO.LoanApplicationNo = Converter.GetInteger(txtLoanAppNo.Text); UpDTO.LoanAccountType = Converter.GetSmallInteger(ddlAccType.SelectedValue); if (txtLoanAppDate.Text != string.Empty) { DateTime apdate = DateTime.ParseExact(txtLoanAppDate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); UpDTO.LoanApplicationDate = apdate; } else { UpDTO.LoanApplicationDate = Converter.GetDateTime(System.DateTime.Now.ToShortDateString()); } UpDTO.LoanMemberNo = Converter.GetInteger(ddlLoanMemNo.SelectedValue); UpDTO.LoanApplicationAmount = Converter.GetDecimal(txtLoanAppAmount.Text); UpDTO.LoanInterestRate = Converter.GetDecimal(txtLoanInterestRate.Text); UpDTO.LoanInstallmentAmount = Converter.GetDecimal(txtLoanInstallmentAmount.Text); UpDTO.LoanLastInstallmentAmount = Converter.GetDecimal(txtLoanLastInstlAmount.Text); UpDTO.LoanNoInstallment = Converter.GetInteger(txtNoInstallment.Text); if (txtLoanExpDate.Text != string.Empty) { DateTime Expdate = DateTime.ParseExact(txtLoanExpDate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); UpDTO.LoanExpDate = Expdate; } else { UpDTO.LoanExpDate = Converter.GetDateTime(System.DateTime.Now.ToShortDateString()); } UpDTO.LoanPurpose = Converter.GetSmallInteger(ddlLoanPurpose.SelectedValue); UpDTO.LoanCategory = Converter.GetSmallInteger(ddlLoanCategory.SelectedValue); int roweffect = A2ZSTAFFLOANDTO.UpdateInformation(UpDTO); if (roweffect > 0) { txtLoanAppNo.Text = string.Empty; clearinfo(); BtnUpdate.Visible = false; txtLoanAppNo.Focus(); } } catch (Exception ex) { throw ex; } }
protected void BtnSubmit_Click(object sender, EventArgs e) { try { if (ddlLoanMemNo.SelectedValue != "-Select-" && ddlAccType.SelectedValue != "-Select-") { A2ZSTAFFLOANDTO objDTO = new A2ZSTAFFLOANDTO(); A2ZRECCTRLDTO getDTO = (A2ZRECCTRLDTO.GetLastRecords(6)); objDTO.LoanApplicationNo = Converter.GetInteger(getDTO.CtrlRecLastNo); lblNewAppNo.Text = Converter.GetString(getDTO.CtrlRecLastNo); if (txtLoanAppDate.Text != string.Empty) { DateTime apdate = DateTime.ParseExact(txtLoanAppDate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); objDTO.LoanApplicationDate = apdate; } else { objDTO.LoanApplicationDate = Converter.GetDateTime(System.DateTime.Now.ToShortDateString()); } objDTO.LoanAccountType = Converter.GetSmallInteger(ddlAccType.SelectedValue); objDTO.AccTypeMode = Converter.GetSmallInteger(lblAccTypeMode.Text); objDTO.LoanMemberNo = Converter.GetInteger(ddlLoanMemNo.SelectedValue); objDTO.LoanApplicationAmount = Converter.GetDecimal(txtLoanAppAmount.Text); objDTO.LoanInterestRate = Converter.GetDecimal(txtLoanInterestRate.Text); objDTO.LoanInstallmentAmount = Converter.GetDecimal(txtLoanInstallmentAmount.Text); objDTO.LoanLastInstallmentAmount = Converter.GetDecimal(txtLoanLastInstlAmount.Text); objDTO.LoanNoInstallment = Converter.GetInteger(txtNoInstallment.Text); objDTO.LoanPurpose = Converter.GetSmallInteger(ddlLoanPurpose.SelectedValue); objDTO.LoanCategory = Converter.GetSmallInteger(ddlLoanCategory.SelectedValue); objDTO.LoanSuretyMemberNo = Converter.GetInteger(txtSuretyMemNo.Text); if (txtLoanExpDate.Text != string.Empty) { DateTime Expdate = DateTime.ParseExact(txtLoanExpDate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); objDTO.LoanExpDate = Expdate; } else { objDTO.LoanExpDate = Converter.GetDateTime(System.DateTime.Now.ToShortDateString()); } objDTO.LoanProcFlag = 11; int roweffect = A2ZSTAFFLOANDTO.InsertInformation(objDTO); if (roweffect > 0) { // A2ZRECCTRLDTO getDTO = (A2ZRECCTRLDTO.ReadLastRecords(4)); lblLastAppNo.Text = Converter.GetString(getDTO.CtrlRecLastNo); clearinfo(); DisplayMessage(); } } else { //InvalidInputMSG(); ddlAccType.Focus(); } } catch (Exception ex) { throw ex; } }
protected void txtLoanAppNo_TextChanged(object sender, EventArgs e) { if (txtLoanAppNo.Text != string.Empty) { A2ZSTAFFLOANDTO getDTO = new A2ZSTAFFLOANDTO(); Int16 AppNumber = Converter.GetSmallInteger(txtLoanAppNo.Text); getDTO = (A2ZSTAFFLOANDTO.GetInformation(AppNumber)); if (getDTO.LoanApplicationNo > 0) { if (getDTO.LoanStatus == 99) { AppCancelMSG(); txtLoanAppNo.Text = string.Empty; txtLoanAppNo.Focus(); return; } if (getDTO.LoanProcFlag == 13) { AppApproveMSG(); txtLoanAppNo.Text = string.Empty; txtLoanAppNo.Focus(); return; } DateTime dt = Converter.GetDateTime(getDTO.LoanApplicationDate); string date = dt.ToString("dd/MM/yyyy"); txtLoanAppDate.Text = date; ddlAccType.SelectedValue = Converter.GetString(getDTO.LoanAccountType); txtLoanMemNo.Text = Converter.GetString(getDTO.LoanMemberNo); ddlLoanMemNo.SelectedValue = Converter.GetString(txtLoanMemNo.Text); Int16 MainCode = Converter.GetSmallInteger(ddlAccType.SelectedValue); A2ZACCTYPEDTO gDTO = (A2ZACCTYPEDTO.GetInformation(MainCode)); if (gDTO.AccTypeCode > 0) { lblTypeCls.Text = Converter.GetString(gDTO.AccTypeClass); } if (lblTypeCls.Text == "5") { txtNoInstallment.Visible = false; txtLoanInstallmentAmount.Visible = false; txtLoanLastInstlAmount.Visible = false; lblNoInstallment.Visible = false; lblLoanInstallmentAmount.Visible = false; lblLoanLastInstlAmount.Visible = false; lblLoanStatDate.Visible = false; txtLoanExpDate.Visible = false; } else { txtNoInstallment.Visible = true; txtLoanInstallmentAmount.Visible = true; txtLoanLastInstlAmount.Visible = true; lblNoInstallment.Visible = true; lblLoanInstallmentAmount.Visible = true; lblLoanLastInstlAmount.Visible = true; lblLoanStatDate.Visible = true; txtLoanExpDate.Visible = true; } txtLoanAppAmount.Text = Converter.GetString(string.Format("{0:0,0.00}", getDTO.LoanApplicationAmount)); txtLoanInterestRate.Text = Converter.GetString(string.Format("{0:0,0.00}", getDTO.LoanInterestRate)); txtLoanInstallmentAmount.Text = Converter.GetString(string.Format("{0:0,0.00}", getDTO.LoanInstallmentAmount)); txtLoanLastInstlAmount.Text = Converter.GetString(string.Format("{0:0,0.00}", getDTO.LoanLastInstallmentAmount)); txtNoInstallment.Text = Converter.GetString(getDTO.LoanNoInstallment); ddlLoanPurpose.SelectedValue = Converter.GetString(getDTO.LoanPurpose); ddlLoanCategory.SelectedValue = Converter.GetString(getDTO.LoanCategory); txtSuretyMemNo.Text = Converter.GetString(getDTO.LoanSuretyMemberNo); //txtLoanStatus.Text = Converter.GetString(getDTO.LoanStatus); DateTime dt2 = Converter.GetDateTime(getDTO.LoanExpDate); string date2 = dt2.ToString("dd/MM/yyyy"); txtLoanExpDate.Text = date2; // txtLoanStatNote.Text = Converter.GetString(getDTO.LoanStatusNote); BtnUpdate.Visible = true; txtLoanAppDate.Focus(); } else { AppInvalidMSG(); clearinfo(); BtnUpdate.Visible = false; txtLoanAppNo.Focus(); } } }