protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UserName"] == null) { Response.Redirect("FrmLogin.aspx"); } autoglname.ContextKey = Session["BRCD"].ToString(); DdlReturnType.Focus(); BD.BindReasons(DdlReason); IO.GetSumGrid(GrdDetails, Session["BRCD"].ToString(), Session["EntryDate"].ToString(), "ZONEGRID"); ////added by ankita on 20/07/2017 TxtCheqDate.Text = Session["EntryDate"].ToString(); ////added by ankita on 20/07/2017 ENDN(false); NEWENDN(false); } }
protected void Clear() { DdlReturnType.SelectedValue = "0"; TxtAccType.Text = ""; TxtAcctypeName.Text = ""; TxtAccNo.Text = ""; TxtAccName.Text = ""; TxtCheqNo.Text = ""; TxtCheqDate.Text = ""; TxtBankCD.Text = ""; TxtBankName.Text = ""; TxtBRCD.Text = ""; TxtBRCDName.Text = ""; TxtCAmount.Text = ""; TxtNarration.Text = ""; // TxtRes.Text = ""; // TxtResName.Text = ""; DdlReason.SelectedValue = "0"; DdlReturnType.Focus(); }
protected void DdlReturnType_TextChanged(object sender, EventArgs e) { try { if (DdlReturnType.SelectedValue == "1") { SetData("I"); } else { lblMessage.Text = ""; lblMessage.Text = "Select Return Type .........!"; ModalPopup.Show(this.Page); DdlReturnType.Focus(); } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
protected void Submit_Click(object sender, EventArgs e) { try { string FL = ""; if (DdlReturnType.SelectedValue == "1") { FL = "I"; } else if (DdlReturnType.SelectedValue == "2") { FL = "O"; } string CHCNT = ""; CHCNT = RI.GetChqCount(Session["BRCD"].ToString(), TxtCheqNo.Text, FL, Session["EntryDate"].ToString(), TxtAccType.Text, TxtAccNo.Text, "ACCH"); if (Convert.ToInt32(CHCNT) <= 0) { string TRXTYPE = "", PMTMD = "", ACT = "", PAYMAST = "", CD = "", NARR = "";; string SetN = BD.GetSetNo(Session["EntryDate"].ToString(), "InOutSetno", Session["BRCD"].ToString()).ToString(); int SETNO = Convert.ToInt32(SetN); if (DdlReturnType.SelectedValue == "1") { TRXTYPE = "1"; PMTMD = "IC"; ACT = "31"; PAYMAST = "IC"; CD = "C"; NARR = TxtNarration.Text + " IW/R CLG " + TxtAccType.Text + "-" + TxtAccNo.Text + ""; } else if (DdlReturnType.SelectedValue == "2") { TRXTYPE = "2"; PMTMD = "OC"; ACT = "32"; PAYMAST = "OC"; CD = "D"; NARR = TxtNarration.Text + " OW/R CLG " + TxtAccType.Text + "-" + TxtAccNo.Text + ""; } if (ViewState["GL"] == null || ViewState["GL"].ToString() == "") { string [] CDD = BD.GetAccTypeGL(TxtAccType.Text, Session["BRCD"].ToString()).ToString().Split('_'); ViewState["GL"] = CDD[1].ToString(); } int RESULT = RI.InOutReturn(DdlReturnType.SelectedValue, Session["EntryDate"].ToString(), ViewState["GL"].ToString(), TxtAccType.Text, TxtAccNo.Text, NARR.ToString(), TxtCAmount.Text, TRXTYPE.ToString(), ACT.ToString(), SETNO.ToString(), PMTMD.ToString(), TxtCheqNo.Text, TxtCheqDate.Text, TxtBankCD.Text, TxtBRCD.Text, "1001", Session["BRCD"].ToString(), Session["MID"].ToString(), PAYMAST.ToString(), ViewState["CUSTNO"].ToString(), ViewState["CUSTNAME"].ToString(), "3", "", CD.ToString(), DdlReason.SelectedValue, "ORT"); ViewState["GL"] = ""; if (RESULT > 0) { //lblMessage.Text = " Return Voucher Number '" + SETNO; //ModalPopup.Show(this.Page); if (DdlReturnType.SelectedValue == "1") { BindReturn("I", "C"); LBL_IO.Text = "Inward Return"; } else if (DdlReturnType.SelectedValue == "2") { BindReturn("O", "D"); LBL_IO.Text = "Outward Return"; } Clear(); DdlReturnType.Focus(); WebMsgBox.Show(" Return Voucher Number " + SetN + " ", this.Page); FL = "Insert"; //Dhanya 15/09/2017 string Res = CLM.LOGDETAILS(FL, Session["BRCD"].ToString(), Session["MID"].ToString(), "ReturnIO_" + SetN + "_" + Session["LOGINCODE"].ToString() + "", "00", Session["MID"].ToString()); } } else { WebMsgBox.Show("Chq No. " + TxtCheqNo.Text + " is Already Returned...! ", this.Page); Clear(); DdlReturnType.Focus(); } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); } }
protected void TxtAccNo_TextChanged(object sender, EventArgs e) { try { string AT = ""; // AT = BD.GetStage1(TxtAccno.Text, Session["BRCD"].ToString(), ViewState["Flag"].ToString()); AT = BD.Getstage1(TxtAccNo.Text, Session["BRCD"].ToString(), TxtAccType.Text); if (AT != null) { if (AT != "1003") { lblMessage.Text = "Sorry Customer not Authorise.........!!"; ModalPopup.Show(this.Page); Clear(); } else { if (TxtAccNo.Text == "") { TxtAccName.Text = ""; goto ext; } DataTable dt1 = new DataTable(); if (TxtAccNo.Text != "" & TxtAccType.Text != "") { string PRD = ""; string[] CN; PRD = TxtAccType.Text; CN = customcs.GetAccountName(TxtAccNo.Text.ToString(), PRD, Session["BRCD"].ToString()).Split('_'); ViewState["CUSTNO"] = CN[0].ToString(); TxtAccName.Text = CN[1].ToString(); if (TxtAccName.Text == "" & TxtAccNo.Text != "") { WebMsgBox.Show("Please enter valid Account number", this.Page); TxtAccNo.Text = ""; TxtAccNo.Focus(); return; } string FL = ""; if (DdlReturnType.SelectedValue == "1") { FL = "I"; } else if (DdlReturnType.SelectedValue == "2") { FL = "O"; } string CHCNT = ""; CHCNT = RI.GetChqCount(Session["BRCD"].ToString(), TxtCheqNo.Text, FL, Session["EntryDate"].ToString(), TxtAccType.Text, TxtAccNo.Text, "ACCH"); if (Convert.ToInt32(CHCNT) <= 0) { DataTable DT = new DataTable(); DT = RI.GetInfo(Session["BRCD"].ToString(), DdlReturnType.SelectedValue.ToString(), TxtAccType.Text, TxtAccNo.Text, TxtCheqNo.Text, TxtCheqDate.Text, Session["EntryDate"].ToString()); if (DT.Rows.Count > 0) { TxtAccType.Text = DT.Rows[0]["PRDUCT_CODE"].ToString(); TxtAccNo.Text = DT.Rows[0]["ACC_NO"].ToString(); TxtBankCD.Text = DT.Rows[0]["BANK_CODE"].ToString(); TxtBankName.Text = DT.Rows[0]["BankName"].ToString(); TxtBRCD.Text = DT.Rows[0]["BRANCH_CODE"].ToString(); TxtBRCDName.Text = DT.Rows[0]["BranchName"].ToString(); TxtNarration.Text = DT.Rows[0]["PARTICULARS"].ToString(); TxtCheqDate.Text = DT.Rows[0]["INSTRUDATE"].ToString().Replace("12:00:00", ""); TxtCheqNo.Text = DT.Rows[0]["INSTRU_NO"].ToString(); TxtCAmount.Text = DT.Rows[0]["INSTRU_AMOUNT"].ToString(); ViewState["CUSTNO"] = DT.Rows[0]["CUSTNO"].ToString(); ViewState["CUSTNAME"] = DT.Rows[0]["CUSTNAME"].ToString(); NEWENDN(false); ////added by ankita on 20/07/2017 SumIwOw(); Photo_Sign(); } else { WebMsgBox.Show("No Records Found.....!", this.Page); Clear(); } } else { WebMsgBox.Show("Chq No. " + TxtCheqNo.Text + " is Already Returned...! ", this.Page); Clear(); DdlReturnType.Focus(); } } if (TxtAccNo.Text == "" || TxtAccType.Text == "") { TxtAccName.Text = ""; goto ext; } dt1 = customcs.GetAccNoAccType(TxtAccType.Text, TxtAccNo.Text, Session["BRCD"].ToString()); if (dt1 != null && dt1.Rows.Count != 0) { } else { } ext :; } } else { WebMsgBox.Show("Enter Valid Account number!...", this.Page); TxtAccNo.Text = ""; TxtAccNo.Focus(); } } catch (Exception Ex) { ExceptionLogging.SendErrorToText(Ex); //Response.Redirect("FrmLogin.aspx", true); } }