protected void lblGLAccNoCr_TextChanged(object sender, EventArgs e) { TextBox b = (TextBox)sender; GridViewRow r = (GridViewRow)b.NamingContainer; TextBox glacccr = (TextBox)gvDetailInfo.Rows[r.RowIndex].Cells[4].FindControl("lblGLAccNoCr"); TextBox glacccrDesc = (TextBox)gvDetailInfo.Rows[r.RowIndex].Cells[5].FindControl("lblGLAccNoCrDesc"); Label Oglacccr = (Label)gvDetailInfo.Rows[r.RowIndex].Cells[11].FindControl("OrgGLAccNoCr"); int GLCode; A2ZCGLMSTDTO glObj = new A2ZCGLMSTDTO(); string input1 = Converter.GetString(glacccr.Text).Length.ToString(); if (input1 == "6") { GLCode = Converter.GetInteger(glacccr.Text); glObj = (A2ZCGLMSTDTO.GetOldCodeInformation(GLCode)); } else { GLCode = Converter.GetInteger(glacccr.Text); glObj = (A2ZCGLMSTDTO.GetInformation(GLCode)); } if (glObj.GLAccNo > 0) { CtrlRecType.Text = Converter.GetString(glObj.GLRecType); if (CtrlRecType.Text != "2") { InvalidGlCode(); glacccr.Text = Oglacccr.Text; glacccr.Focus(); return; } string GlAccType1 = Oglacccr.Text.Substring(0, 1); string GlAccType2 = glacccr.Text.Substring(0, 1); if (GlAccType1 != GlAccType2) { InvalidGlCode(); glacccr.Text = Oglacccr.Text; glacccr.Focus(); return; } glacccr.Text = Converter.GetString(glObj.GLAccNo); glacccrDesc.Text = Converter.GetString(glObj.GLAccDesc); } else { InvalidGlCode(); glacccr.Text = Oglacccr.Text; glacccr.Focus(); return; } }
protected void txtGLBankCode_TextChanged(object sender, EventArgs e) { try { if (txtGLBankCode.Text != string.Empty) { int GLCode; A2ZCGLMSTDTO getDTO = new A2ZCGLMSTDTO(); string input1 = Converter.GetString(txtGLBankCode.Text).Length.ToString(); if (input1 == "6") { GLCode = Converter.GetInteger(txtGLBankCode.Text); getDTO = (A2ZCGLMSTDTO.GetOldCodeInformation(GLCode)); } else { GLCode = Converter.GetInteger(txtGLBankCode.Text); getDTO = (A2ZCGLMSTDTO.GetInformation(GLCode)); } if (getDTO.GLAccNo > 0) { lblStatus.Text = Converter.GetString(getDTO.Status); CtrlRecType.Text = Converter.GetString(getDTO.GLRecType); hdnGLSubHead.Text = Converter.GetString(getDTO.GLSubHead); //CtrlContraAType.Text = Converter.GetString(getDTO.GLAccType); if (lblStatus.Text == "99") { txtGLBankCode.Text = string.Empty; txtGLBankCode.Focus(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Closed GL Code');", true); return; } if (CtrlRecType.Text != "2") { txtGLBankCode.Text = string.Empty; txtGLBankCode.Focus(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Not Trans. Header Record');", true); return; } if (ddlTrnType.SelectedValue == "2" && (hdnGLSubHead.Text != "10106000" && hdnGLSubHead.Text != "20801000")) { txtGLBankCode.Text = string.Empty; txtGLBankCode.Focus(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Invalid GL Bank Code');", true); return; } txtGLBankCode.Text = Converter.GetString(getDTO.GLAccNo); ddlGLBankCode.SelectedValue = Converter.GetString(getDTO.GLAccNo); } else { txtGLBankCode.Text = string.Empty; txtGLBankCode.Focus(); } } } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.txtGLCashCode_TextChanged Problem');</script>"); //throw ex; } }
protected void txtGLContraCode_TextChanged(object sender, EventArgs e) { try { int GLCode; A2ZCGLMSTDTO glObj = new A2ZCGLMSTDTO(); string input1 = Converter.GetString(txtGLContraCode.Text).Length.ToString(); if (input1 == "6") { GLCode = Converter.GetInteger(txtGLContraCode.Text); glObj = (A2ZCGLMSTDTO.GetOldCodeInformation(GLCode)); } else { GLCode = Converter.GetInteger(txtGLContraCode.Text); glObj = (A2ZCGLMSTDTO.GetInformation(GLCode)); } if (glObj.GLAccNo > 0) { lblStatus.Text = Converter.GetString(glObj.Status); CtrlRecType.Text = Converter.GetString(glObj.GLRecType); hdnGLSubHead2.Text = Converter.GetString(glObj.GLSubHead); lblAccMode.Text = Converter.GetString(glObj.GLAccMode); if (lblStatus.Text == "99") { txtGLContraCode.Text = string.Empty; txtGLContraCode.Focus(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Closed GL Code');", true); return; } if (CtrlRecType.Text != "2") { txtGLContraCode.Text = string.Empty; txtGLContraCode.Focus(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Not Trans. Header Record');", true); return; } if (lblAccMode.Text == "1") { txtGLContraCode.Text = string.Empty; txtGLContraCode.Focus(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Non GL Account');", true); return; } if (hdnGLSubHead2.Text == "10101000") { txtGLContraCode.Text = string.Empty; txtGLContraCode.Focus(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Invalid GL Code');", true); return; } else { lblGLCodeDesc.Text = Converter.GetString(glObj.GLAccDesc); txtDescription.Focus(); } } else { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('GL Code - Does Not Exists');", true); txtGLContraCode.Text = string.Empty; txtGLContraCode.Focus(); return; } } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.txtTrnsactionCode_TextChanged Problem');</script>"); //throw ex; } }
protected void txtCashCode_TextChanged(object sender, EventArgs e) { //// Cheaking 8 digit - GL Account Code //if (txtCashCode.Text.Length != 8) //{ // //String csname1 = "PopupScript"; // //Type cstype = GetType(); // //ClientScriptManager cs = Page.ClientScript; // //if (!cs.IsStartupScriptRegistered(cstype, csname1)) // //{ // // String cstext1 = "alert('Invalid - GL Account Code');"; // // cs.RegisterStartupScript(cstype, csname1, cstext1, true); // //} // txtCashCode.Text = string.Empty; // txtCashCode.Focus(); // ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Invalid - GL Account Code');", true); // return; //} //// Cheaking - GL Cash Account Code //string glno = txtCashCode.Text; //string glAccno = glno.Substring(0, 5); //string qry = "SELECT GLAccNo FROM A2ZCGLMST WHERE Left(GLAccNo,5)='" + glAccno + "'"; //DataTable dt = DataAccessLayer.BLL.CommonManager.Instance.GetDataTableByQuery(qry, "A2ZGLMCUS"); //if (dt.Rows.Count == 0) //{ // //String csname1 = "PopupScript"; // //Type cstype = GetType(); // //ClientScriptManager cs = Page.ClientScript; // //if (!cs.IsStartupScriptRegistered(cstype, csname1)) // //{ // // String cstext1 = "alert('Invalid - GL Cash Code');"; // // cs.RegisterStartupScript(cstype, csname1, cstext1, true); // //} // txtCashCode.Text = string.Empty; // txtCashCode.Focus(); // ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Invalid - GL Cash Code');", true); // return; //} int GLCode; A2ZCGLMSTDTO glObj = new A2ZCGLMSTDTO(); string input1 = Converter.GetString(txtCashCode.Text).Length.ToString(); if (input1 == "6") { GLCode = Converter.GetInteger(txtCashCode.Text); glObj = (A2ZCGLMSTDTO.GetOldCodeInformation(GLCode)); } else { GLCode = Converter.GetInteger(txtCashCode.Text); glObj = (A2ZCGLMSTDTO.GetInformation(GLCode)); } if (glObj.GLAccNo > 0) { txtCashCode.Text = Converter.GetString(glObj.GLAccNo); lblCodeDesc.Text = Converter.GetString(glObj.GLAccDesc); hdnGLSubHead1.Text = Converter.GetString(glObj.GLSubHead); if (hdnGLSubHead1.Text != "10101000") { txtCashCode.Text = string.Empty; txtCashCode.Focus(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Invalid - GL Cash Code');", true); return; } } else { txtCashCode.Text = string.Empty; txtCashCode.Focus(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Invalid - GL Cash Code');", true); return; } ////----------------------------------------------------- //string qry1 = "SELECT GLAccDesc FROM A2ZCGLMST where GLAccNo='" + txtCashCode.Text + "'"; //DataTable dt1 = DataAccessLayer.BLL.CommonManager.Instance.GetDataTableByQuery(qry1, "A2ZGLMCUS"); //if (dt1.Rows.Count > 0) //{ // lblCodeDesc.Text = Converter.GetString(dt1.Rows[0]["GLAccDesc"]); // txtCashCode.Focus(); //} }
protected void txtGLCode_TextChanged(object sender, EventArgs e) { try { int GLCode; A2ZCGLMSTDTO glObj = new A2ZCGLMSTDTO(); string input1 = Converter.GetString(txtGLCode.Text).Length.ToString(); if (input1 == "6") { GLCode = Converter.GetInteger(txtGLCode.Text); glObj = (A2ZCGLMSTDTO.GetOldCodeInformation(GLCode)); } else { GLCode = Converter.GetInteger(txtGLCode.Text); glObj = (A2ZCGLMSTDTO.GetInformation(GLCode)); } if (glObj.GLAccNo > 0) { CtrlRecType.Text = Converter.GetString(glObj.GLRecType); if (CtrlRecType.Text != "2") { InvalidGlCode(); txtGLCode.Text = string.Empty; txtGLCode.Focus(); } else { txtGLCode.Text = Converter.GetString(glObj.GLAccNo); CtrlAccType.Text = Converter.GetString(glObj.GLAccType); glMainHead.Text = Converter.GetString(glObj.GLMainHead); glSubHead.Text = Converter.GetString(glObj.GLSubHead); if (HdnModule.Text == "6") { if (glSubHead.Text == "10101000" && txtGLCode.Text != lblCashCode.Text) { txtGLCode.Text = string.Empty; txtGLCode.Text = lblCashCode.Text; txtGLCode.Focus(); InvalidCode(); return; } else if (glSubHead.Text != "10106000" && glSubHead.Text != "20801000") { txtGLCode.Text = string.Empty; txtGLCode.Text = lblCashCode.Text; txtGLCode.Focus(); InvalidCode(); return; } else { ddlGLCode.SelectedValue = Converter.GetString(txtGLCode.Text); return; } } hdnTranHead1.Text = "1"; hdnTranHead2.Text = "0"; hdnTranHead3.Text = "0"; hdnTranHead4.Text = "0"; hdnTranCode.Text = Converter.GetString(txtGLCode.Text); TranCodeDropDown(); hdnTranHead2.Text = hdnTranCode.Text; hdnTranHead3.Text = "0"; hdnTranHead4.Text = "0"; hdnTranCode.Text = Converter.GetString(txtGLCode.Text); TranCodeDropDown(); hdnTranHead2.Text = hdnTranCode.Text; hdnTranHead3.Text = hdnTranCode.Text; hdnTranHead4.Text = "0"; hdnTranCode.Text = Converter.GetString(txtGLCode.Text); TranCodeDropDown(); hdnTranHead2.Text = hdnTranCode.Text; hdnTranHead3.Text = hdnTranCode.Text; hdnTranHead4.Text = hdnTranCode.Text; ddlGLCode.SelectedValue = Converter.GetString(txtGLCode.Text); TranCodeDropDown(); //ddlContra.SelectedValue = Converter.GetString(glObj.GLAccNo); ddlGLCode_SelectedIndexChanged(this, EventArgs.Empty); } } else { Validity(); txtGLCode.Text = string.Empty; txtGLCode.Focus(); } } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.txtTrnsactionCode_TextChanged Problem');</script>"); //throw ex; } }