protected void BtnCreUnionSubmit_Click(object sender, EventArgs e) { try { A2ZCUNIONDTO objDTO = new A2ZCUNIONDTO(); A2ZMEMBERDTO MemDTO = new A2ZMEMBERDTO(); MemDTO.CreditUnionNo = Converter.GetInteger(txtCreditUNo.Text); MemDTO.MemberName = Converter.GetString(txtCreUName.Text); MemDTO.MemType = 1; objDTO.CreditUnionNo = Converter.GetInteger(txtCreditUNo.Text); objDTO.CreditUnionName = Converter.GetString(txtCreUName.Text); //DateTime date = DateTime.ParseExact(txtCuOpenDate.Text, "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture); if (txtCuOpenDate.Text != string.Empty) { DateTime opdate = DateTime.ParseExact(txtCuOpenDate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); objDTO.opendate = opdate; MemDTO.OpenDate = opdate; } else { objDTO.opendate = Converter.GetDateTime(System.DateTime.Now.ToLongDateString()); } //objDTO.opendate = Converter.GetDateTime(System.DateTime.Now.ToLongDateString()); objDTO.MemberFlag = Converter.GetSmallInteger(ddlCuMemberFlag.SelectedValue); objDTO.MemberType = Converter.GetSmallInteger(ddlCuMemberType.SelectedValue); objDTO.CertificateNo = Converter.GetInteger(txtCuCertificateNo.Text); objDTO.AddressL1 = Converter.GetString(txtCuAddressL1.Text); objDTO.AddressL2 = Converter.GetString(txtCuAddressL2.Text); objDTO.AddressL3 = Converter.GetString(txtCuAddressL3.Text); objDTO.TelephoneNo = Converter.GetString(txtCuTelNo.Text); objDTO.MobileNo = Converter.GetString(txtCuMobileNo.Text); objDTO.Fax = Converter.GetString(txtCuFax.Text); objDTO.email = Converter.GetString(txtCuEmail.Text); objDTO.Division = Converter.GetInteger(ddlDivision.SelectedValue); objDTO.District = Converter.GetInteger(ddlDistrict.SelectedValue); objDTO.Thana = Converter.GetInteger(ddlThana.SelectedValue); int row = A2ZMEMBERDTO.Insert(MemDTO); int roweffect = A2ZCUNIONDTO.InsertInformation(objDTO); if (roweffect > 0) { CreditUnionDropdown(); txtCreditUNo.Text = string.Empty; ddlCuMemberFlag.SelectedValue = "0"; ddlCuMemberType.SelectedValue = "0"; clearInfo(); txtCreditUNo.Focus(); } } catch (Exception ex) { throw ex; } }
protected void BtnApprove_Click(object sender, EventArgs e) { try { A2ZRECCTRLDTO getDTO = (A2ZRECCTRLDTO.GetLastRecords(1)); lblNewSRL.Text = Converter.GetString(getDTO.CtrlRecLastNo); A2ZCUNIONDTO MemDTO = new A2ZCUNIONDTO(); A2ZMEMBERDTO Mem1DTO = new A2ZMEMBERDTO(); A2ZACCOUNTDTO Mem2DTO = new A2ZACCOUNTDTO(); Button b = (Button)sender; GridViewRow r = (GridViewRow)b.NamingContainer; Label CTyNo = (Label)gvCUInfo.Rows[r.RowIndex].Cells[5].FindControl("lblcutype"); Label CrNo = (Label)gvCUInfo.Rows[r.RowIndex].Cells[6].FindControl("lblcno"); int a = Converter.GetSmallInteger(CTyNo.Text); int c = Converter.GetSmallInteger(CrNo.Text); Int16 CuType = Converter.GetSmallInteger(a); int CNo = Converter.GetSmallInteger(c); lblCuType.Text = Converter.GetString(CuType); lblCuNo.Text = Converter.GetString(CNo); A2ZCUAPPLICATIONDTO objDTO = (A2ZCUAPPLICATIONDTO.GetInformation(CuType, CNo)); if (objDTO.CreditUnionNo > 0) { objDTO.CuType = CuType; objDTO.CreditUnionNo = CNo; MemDTO.CuType = Converter.GetSmallInteger(objDTO.CuType); MemDTO.CuTypeName = Converter.GetString(objDTO.CuTypeName); MemDTO.CreditUnionNo = Converter.GetInteger(lblNewSRL.Text); MemDTO.CreditUnionName = Converter.GetString(objDTO.CreditUnionName); MemDTO.opendate = Converter.GetDateTime(objDTO.opendate); MemDTO.MemberFlag = Converter.GetSmallInteger(objDTO.MemberFlag); MemDTO.CertificateNo = Converter.GetInteger(objDTO.CertificateNo); MemDTO.AddressL1 = Converter.GetString(objDTO.AddressL1); MemDTO.AddressL2 = Converter.GetString(objDTO.AddressL2); MemDTO.AddressL3 = Converter.GetString(objDTO.AddressL3); MemDTO.TelephoneNo = Converter.GetString(objDTO.TelephoneNo); MemDTO.MobileNo = Converter.GetString(objDTO.MobileNo); MemDTO.Fax = Converter.GetString(objDTO.Fax); MemDTO.email = Converter.GetString(objDTO.email); MemDTO.Division = Converter.GetInteger(objDTO.Division); MemDTO.District = Converter.GetInteger(objDTO.District); MemDTO.Upzila = Converter.GetInteger(objDTO.Upzila); MemDTO.Thana = Converter.GetInteger(objDTO.Thana); MemDTO.GLCashCode = Converter.GetInteger(objDTO.GLCashCode); MemDTO.CuStatusDate = Converter.GetDateTime(objDTO.CuStatusDate); MemDTO.ValueDate = Converter.GetDateTime(objDTO.ValueDate); MemDTO.CreateDate = Converter.GetDateTime(objDTO.CreateDate); objDTO.CuProcFlag = Converter.GetSmallInteger(13); objDTO.CuProcDesc = "Approved"; objDTO.ApprovBy = Converter.GetSmallInteger(SessionStore.GetValue(Params.SYS_USER_ID)); A2ZCSPARAMETERDTO dto = A2ZCSPARAMETERDTO.GetParameterValue(); objDTO.ApprovByDate = Converter.GetDateTime(dto.ProcessDate); MemDTO.CuProcFlag = Converter.GetSmallInteger(objDTO.CuProcFlag); MemDTO.ApprovBy = Converter.GetSmallInteger(objDTO.ApprovBy); MemDTO.ApprovByDate = Converter.GetDateTime(objDTO.ApprovByDate); MemDTO.InputBy = Converter.GetSmallInteger(objDTO.InputBy); MemDTO.VerifyBy = Converter.GetSmallInteger(objDTO.VerifyBy); MemDTO.InputByDate = Converter.GetDateTime(objDTO.InputByDate); MemDTO.VerifyByDate = Converter.GetDateTime(objDTO.VerifyByDate); objDTO.VerifyBy = Converter.GetSmallInteger(MemDTO.VerifyBy); objDTO.VerifyByDate = Converter.GetDateTime(MemDTO.VerifyByDate); Mem1DTO.CuType = Converter.GetSmallInteger(MemDTO.CuType); Mem1DTO.CreditUnionNo = Converter.GetInteger(MemDTO.CreditUnionNo); Mem1DTO.MemberName = Converter.GetString(MemDTO.CreditUnionName); Mem1DTO.OpenDate = Converter.GetDateTime(MemDTO.opendate); Mem1DTO.MemType = 1; Mem2DTO.CuType = Converter.GetSmallInteger(MemDTO.CuType); Mem2DTO.CuNo = Converter.GetInteger(MemDTO.CreditUnionNo); Mem2DTO.AccType = 99; Mem2DTO.AccNo = 0; Mem2DTO.MemberNo = 0; Mem2DTO.Opendate = Converter.GetDateTime(MemDTO.opendate); Mem2DTO.AccStatus = 1; Mem2DTO.AccAtyClass = 6; int roweffect = A2ZCUAPPLICATIONDTO.UpdateInformation2(objDTO); if (roweffect > 0) { int row = A2ZCUNIONDTO.InsertInformation(MemDTO); int row1 = A2ZMEMBERDTO.Insert(Mem1DTO); InsertMiscRecord(); //int row2 = A2ZACCOUNTDTO.Insert(Mem2DTO); DisplayMessage(); gvVerify(); string CheckQuery = "SELECT CuType,CuTypeName,CuNo,CuName,CuOpDt,CuProcDesc FROM A2ZCUAPPLICATION Where CuProcFlag = '12' OR CuProcFlag = '22' and CuStatus !='99'"; DataTable dt = new DataTable(); dt = CommonManager.Instance.GetDataTableByQuery(CheckQuery, "A2ZCSMCUS"); if (dt.Rows.Count <= 0) { DivGridViewCancle.Visible = false; lblmsg1.Visible = true; lblmsg2.Visible = true; } } } } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.BtnApprove_Click Problem');</script>"); //throw ex; } }