Esempio n. 1
0
        protected void VerifyTransactionCode()
        {
            try
            {
                CtrlMsgFlag.Text = "0";

                A2ZCGLMSTDTO glObj = A2ZCGLMSTDTO.GetInformation(Converter.GetInteger(txtTrnsactionCode.Text));

                if (glObj.GLAccNo > 0)
                {
                    CtrlRecType.Text = Converter.GetString(glObj.GLRecType);
                    if (CtrlRecType.Text != "2")
                    {
                        InvalidGlCode();
                        CtrlMsgFlag.Text = "1";
                        return;
                    }
                    else
                    {
                    }
                }
                else
                {
                    Validity();
                    CtrlMsgFlag.Text = "1";
                    return;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        protected void txtGlCashCode_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (txtGlCashCode.Text != string.Empty)
                {
                    int          GLCode = Converter.GetInteger(txtGlCashCode.Text);
                    A2ZCGLMSTDTO getDTO = (A2ZCGLMSTDTO.GetInformation(GLCode));

                    if (getDTO.GLAccNo > 0)
                    {
                        txtGlCashCode.Text          = Converter.GetString(getDTO.GLAccNo);
                        ddlGLCashCode.SelectedValue = Converter.GetString(getDTO.GLAccNo);
                    }
                    else
                    {
                        txtGlCashCode.Text = string.Empty;
                        txtGlCashCode.Focus();
                    }
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.txtGlCashCode_TextChanged Problem');</script>");
                //throw ex;
            }
        }
        protected void txtGLCashCode_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (txtGLCashCode.Text != string.Empty)
                {
                    int          GLCode = Converter.GetInteger(txtGLCashCode.Text);
                    A2ZCGLMSTDTO getDTO = (A2ZCGLMSTDTO.GetInformation(GLCode));

                    if (getDTO.GLAccNo > 0)
                    {
                        txtGLCashCode.Text          = Converter.GetString(getDTO.GLAccNo);
                        ddlGLCashCode.SelectedValue = Converter.GetString(getDTO.GLAccNo);
                    }
                    else
                    {
                        txtGLCashCode.Text = string.Empty;
                        txtGLCashCode.Focus();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 4
0
        protected void txtWarehouse_TextChanged(object sender, EventArgs e)
        {
            int          GLCode = Converter.GetInteger(txtWarehouse.Text);
            A2ZCGLMSTDTO getDTO = (A2ZCGLMSTDTO.GetInformation(GLCode));

            if (getDTO.GLAccNo > 0)
            {
                lblRecType.Text = Converter.GetString(getDTO.GLRecType);
                lblSubHead.Text = Converter.GetString(getDTO.GLSubHead);

                if (lblRecType.Text != "2")
                {
                    txtWarehouse.Text = string.Empty;
                    txtWarehouse.Focus();
                    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Not Trans. Header Record');", true);
                    return;
                }

                if (lblSubHead.Text != "10101000")
                {
                    txtWarehouse.Text = string.Empty;
                    txtWarehouse.Focus();
                    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Invalid Warehouse Code');", true);
                    return;
                }

                ddlWarehouse.SelectedValue = txtWarehouse.Text;
            }
        }
        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;
            }
        }
Esempio n. 6
0
        protected void BtnHdrSelect_Click(object sender, EventArgs e)
        {
            try
            {
                Button      b     = (Button)sender;
                GridViewRow r     = (GridViewRow)b.NamingContainer;
                Label       lblId = (Label)gvDetailInfo.Rows[r.RowIndex].Cells[0].FindControl("lblId");

                lblSelectedId.Text = lblId.Text;

                DataTable dt = DataAccessLayer.BLL.CommonManager.Instance.GetDataTableByQuery("SELECT FuncNo,FuncDesc,GroupCode,SubGroupCode,PayType,TrnType,TrnMode,GLAccNoDr,GLAccNoCr,TrnRecDesc FROM A2ZSTTRNCTRL Where Id = " + lblId.Text + "", "A2ZSTMCUS");

                if (dt.Rows.Count > 0)
                {
                    btnSubmit.Visible = false;
                    btnUpdate.Visible = true;

                    ddlFuncNo.SelectedValue = Converter.GetString(dt.Rows[0]["FuncNo"]);
                    ddlGroup.SelectedValue  = Converter.GetString(dt.Rows[0]["GroupCode"]);
                    SubGroupDropdown();
                    ddlCategory.SelectedValue = Converter.GetString(dt.Rows[0]["SubGroupCode"]);
                    ddlPayType.SelectedValue  = Converter.GetString(dt.Rows[0]["PayType"]);
                    ddlTrnType.SelectedValue  = Converter.GetString(dt.Rows[0]["TrnType"]);
                    ddlTrnMode.SelectedValue  = Converter.GetString(dt.Rows[0]["TrnMode"]);
                    txtTrnDebitCode.Text      = Converter.GetString(dt.Rows[0]["GLAccNoDr"]);
                    txtTrnCreditCode.Text     = Converter.GetString(dt.Rows[0]["GLAccNoCr"]);
                    txtTrnRecDesc.Text        = Converter.GetString(dt.Rows[0]["TrnRecDesc"]);

                    if (txtTrnDebitCode.Text != string.Empty)
                    {
                        A2ZCGLMSTDTO dto = A2ZCGLMSTDTO.GetInformation(Converter.GetInteger(txtTrnDebitCode.Text));
                        if (dto.GLAccDesc != null)
                        {
                            lblDebitCd.Text = Converter.GetString(dto.GLAccDesc);
                        }
                    }

                    if (txtTrnCreditCode.Text != string.Empty)
                    {
                        A2ZCGLMSTDTO dto = A2ZCGLMSTDTO.GetInformation(Converter.GetInteger(txtTrnCreditCode.Text));
                        if (dto.GLAccDesc != null)
                        {
                            lblCreditCd.Text = Converter.GetString(dto.GLAccDesc);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.BtnEdit_Click Problem');</script>");
                //throw ex;
            }
        }
Esempio n. 7
0
        protected void ddlTrnsactionCode_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (ddlTrnsactionCode.SelectedValue == "-Select-")
                {
                    txtTrnsactionCode.Text = string.Empty;
                    return;
                }

                txtTrnsactionCode.Text = Converter.GetString(ddlTrnsactionCode.SelectedValue);

                if (txtTrnsactionCode.Text == txtContra.Text)
                {
                    DuplicateGLCode();
                    txtTrnsactionCode.Text          = string.Empty;
                    ddlTrnsactionCode.SelectedIndex = 0;
                    txtTrnsactionCode.Focus();
                    return;
                }


                A2ZCGLMSTDTO glObj = A2ZCGLMSTDTO.GetInformation(Converter.GetInteger(txtTrnsactionCode.Text));
                if (glObj.GLAccNo > 0)
                {
                    CtrlRecType.Text = Converter.GetString(glObj.GLRecType);
                    CtrlAccType.Text = Converter.GetString(glObj.GLAccType);
                    txtDescription.Focus();

                    if (CtrlRecType.Text != "2")
                    {
                        InvalidGlCode();
                        txtTrnsactionCode.Text = string.Empty;
                        txtTrnsactionCode.Focus();
                    }
                }
                else
                {
                    Validity();
                    txtTrnsactionCode.Text = string.Empty;
                    txtTrnsactionCode.Focus();
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.ddlTrnsactionCode_SelectedIndexChanged Problem');</script>");
                //throw ex;
            }
        }
Esempio n. 8
0
 protected void txtTrnCreditCode_TextChanged(object sender, EventArgs e)
 {
     if (txtTrnCreditCode.Text != string.Empty)
     {
         A2ZCGLMSTDTO dto = A2ZCGLMSTDTO.GetInformation(Converter.GetInteger(txtTrnCreditCode.Text));
         if (dto.GLAccDesc != null)
         {
             lblCreditCd.Text = Converter.GetString(dto.GLAccDesc);
         }
         else
         {
             txtTrnCreditCode.Text = string.Empty;
             lblCreditCd.Text      = string.Empty;
             txtTrnCreditCode.Focus();
         }
     }
 }
        protected void ddlGLCashCode_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (ddlGLCashCode.SelectedValue != "-Select-")
                {
                    int          GLCode = Converter.GetInteger(ddlGLCashCode.SelectedValue);
                    A2ZCGLMSTDTO getDTO = (A2ZCGLMSTDTO.GetInformation(GLCode));

                    if (getDTO.GLAccNo > 0)
                    {
                        txtGLCashCode.Text = Converter.GetString(getDTO.GLAccNo);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 10
0
        protected void ddlGLCashCode_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (ddlGLCashCode.SelectedValue != "-Select-")
                {
                    int          GLCode = Converter.GetInteger(ddlGLCashCode.SelectedValue);
                    A2ZCGLMSTDTO getDTO = (A2ZCGLMSTDTO.GetInformation(GLCode));

                    if (getDTO.GLAccNo > 0)
                    {
                        txtGLCashCode.Text = Converter.GetString(getDTO.GLAccNo);
                    }
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.ddlGLCashCode_SelectedIndexChanged Problem');</script>");
                throw ex;
            }
        }
Esempio n. 11
0
        protected void ddlContra_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlContra.SelectedValue == "-Select-")
            {
                //ClearInfoAdd();
                txtContra.Text = string.Empty;
                return;
            }

            //refresh();
            try
            {
                txtContra.Text = Converter.GetString(ddlContra.SelectedValue);

                A2ZCGLMSTDTO glObj = A2ZCGLMSTDTO.GetInformation(Converter.GetInteger(txtContra.Text));
                if (glObj.GLAccNo > 0)
                {
                    CtrlRecType.Text     = Converter.GetString(glObj.GLRecType);
                    CtrlContraAType.Text = Converter.GetString(glObj.GLAccType);
                    txtTrnsactionCode.Focus();
                    if (CtrlRecType.Text != "2")
                    {
                        InvalidGlCode();
                        txtContra.Text = string.Empty;
                        txtContra.Focus();
                    }
                }
                else
                {
                    Validity();
                    txtContra.Text = string.Empty;
                    txtContra.Focus();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 12
0
        protected void txtTrnsactionCode_TextChanged(object sender, EventArgs e)
        {
            try
            {
                A2ZCGLMSTDTO glObj = A2ZCGLMSTDTO.GetInformation(Converter.GetInteger(txtTrnsactionCode.Text));

                if (glObj.GLAccNo > 0)
                {
                    CtrlRecType.Text = Converter.GetString(glObj.GLRecType);
                    if (CtrlRecType.Text != "2")
                    {
                        InvalidGlCode();
                        txtTrnsactionCode.Text = string.Empty;
                        txtTrnsactionCode.Focus();
                    }
                    else
                    {
                        txtTrnsactionCode.Text = Converter.GetString(glObj.GLAccNo);
                        CtrlAccType.Text       = Converter.GetString(glObj.GLAccType);

                        ddlTrnsactionCode.SelectedValue = Converter.GetString(glObj.GLAccNo);

                        ddlTrnsactionCode_SelectedIndexChanged(this, EventArgs.Empty);
                        txtDescription.Focus();
                    }
                }
                else
                {
                    Validity();
                    txtTrnsactionCode.Text = string.Empty;
                    txtTrnsactionCode.Focus();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 13
0
        protected void txtContra_TextChanged(object sender, EventArgs e)
        {
            try
            {
                A2ZCGLMSTDTO glObj = A2ZCGLMSTDTO.GetInformation(Converter.GetInteger(txtContra.Text));

                if (glObj.GLAccNo > 0)
                {
                    CtrlRecType.Text = Converter.GetString(glObj.GLRecType);
                    if (CtrlRecType.Text != "2")
                    {
                        InvalidGlCode();
                        txtContra.Text = string.Empty;
                        txtContra.Focus();
                    }
                    else
                    {
                        txtContra.Text       = Converter.GetString(glObj.GLAccNo);
                        CtrlContraAType.Text = Converter.GetString(glObj.GLAccType);

                        ddlContra.SelectedValue = Converter.GetString(glObj.GLAccNo);
                        ddlContra_SelectedIndexChanged(this, EventArgs.Empty);
                        txtTrnsactionCode.Focus();
                    }
                }
                else
                {
                    Validity();
                    txtContra.Text = string.Empty;
                    txtContra.Focus();
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.txtContra_TextChanged Problem');</script>");
                //throw ex;
            }
        }
        protected void CashGLAccBalance()
        {
            ValidityFlag.Text = "0";

            var prm = new object[4];

            A2ZGLPARAMETERDTO dto   = A2ZGLPARAMETERDTO.GetParameterValue();
            DateTime          date  = Converter.GetDateTime(dto.ProcessDate);
            string            Tdate = date.ToString("dd/MM/yyyy");

            int Code = Converter.GetInteger(lblCashCode.Text);
            int UId  = Converter.GetInteger(hdnID.Text);

            prm[0] = Code;
            prm[1] = Converter.GetDateToYYYYMMDD(Tdate);
            prm[2] = Converter.GetDateToYYYYMMDD(Tdate);
            prm[3] = UId;

            int result = Converter.GetInteger(CommonManager.Instance.GetScalarValueBySp("Sp_GlGenerateAccountBalanceSingle", prm, "A2ZGLMCUS"));

            A2ZCGLMSTDTO glObj = A2ZCGLMSTDTO.GetInformation(Code);

            if (glObj.GLAccNo > 0)
            {
                lblGLAccBal.Text      = Converter.GetString(String.Format("{0:0,0.00}", glObj.GLClBal));
                lblGLBalanceType.Text = Converter.GetString(glObj.GLBalanceType);
                double AvailAmt = Converter.GetDouble(lblGLAccBal.Text);
                double InputAmt = Converter.GetDouble(lblVchAmt.Text);

                if (lblGLBalanceType.Text != "1" && InputAmt > AvailAmt)
                {
                    ValidityFlag.Text = "2";
                    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;
            }
        }
Esempio n. 16
0
        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;
            }
        }
Esempio n. 17
0
        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();
            //}
        }
Esempio n. 18
0
        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;
            }
        }
Esempio n. 19
0
        protected void btnSumbit_Click(object sender, EventArgs e)
        {
            try
            {
                int            EmpID  = Converter.GetInteger(txtEmpNo.Text);
                A2ZEMPLOYEEDTO getDTO = (A2ZEMPLOYEEDTO.GetInformation(EmpID));
                if (getDTO.EmployeeID > 0)
                {
                    txtEmpNo.ReadOnly = true;
                    txtNewPromotionDate.Focus();
                    lblName.Text = Converter.GetString(getDTO.EmployeeName);

                    int            Area    = Converter.GetInteger(getDTO.EmpArea);
                    A2ZDISTRICTDTO get1DTO = (A2ZDISTRICTDTO.GetInfo(Area));
                    if (get1DTO.DistrictCode > 0)
                    {
                        lblLastAreaCode.Text     = Converter.GetString(get1DTO.DistrictOrgCode);
                        lblLastArea.Text         = Converter.GetString(get1DTO.DistrictDescription);
                        ddlNewArea.SelectedValue = Converter.GetString(get1DTO.DistrictOrgCode);
                    }

                    int        Location = Converter.GetInteger(getDTO.EmpLocation);
                    A2ZAREADTO get7DTO  = (A2ZAREADTO.GetInformation(Location));
                    if (get7DTO.AreaCode > 0)
                    {
                        lblLastLocationCode.Text     = Converter.GetString(get7DTO.AreaCode);
                        lblLastLocation.Text         = Converter.GetString(get7DTO.AreaDescription);
                        ddlNewLocation.SelectedValue = Converter.GetString(get7DTO.AreaCode);
                    }

                    Int16         Section = Converter.GetSmallInteger(getDTO.EmpSection);
                    A2ZSECTIONDTO get2DTO = (A2ZSECTIONDTO.GetInformation(Section));
                    if (get2DTO.SectionCode > 0)
                    {
                        lblLastSectionCode.Text     = Converter.GetString(get2DTO.SectionCode);
                        lblLastSection.Text         = Converter.GetString(get2DTO.SectionName);
                        ddlNewSection.SelectedValue = Converter.GetString(get2DTO.SectionCode);
                    }

                    Int16            Department = Converter.GetSmallInteger(getDTO.EmpDepartment);
                    A2ZDEPARTMENTDTO get3DTO    = (A2ZDEPARTMENTDTO.GetInformation(Department));
                    if (get3DTO.DepartmentCode > 0)
                    {
                        lblLastDepartmentCode.Text     = Converter.GetString(get3DTO.DepartmentCode);
                        lblLastDepartment.Text         = Converter.GetString(get3DTO.DepartmentName);
                        ddlNewDepartment.SelectedValue = Converter.GetString(get3DTO.DepartmentCode);
                    }

                    Int16             Desig   = Converter.GetSmallInteger(getDTO.EmpDesignation);
                    A2ZDESIGNATIONDTO get4DTO = (A2ZDESIGNATIONDTO.GetInformation(Desig));
                    if (get4DTO.DesignationCode > 0)
                    {
                        lblLastDesignationCode.Text     = Converter.GetString(get4DTO.DesignationCode);
                        lblLastDesignation.Text         = Converter.GetString(get4DTO.DesignationDescription);
                        ddlNewDesignation.SelectedValue = Converter.GetString(get4DTO.DesignationCode);
                    }

                    lblLastServiceTypeCode.Text = Converter.GetString(getDTO.ServiceType);
                    lblLastServiceType.Text     = Converter.GetString(getDTO.EmpSTypeDesc);

                    if (lblLastServiceTypeCode.Text == string.Empty || lblLastServiceTypeCode.Text == "0")
                    {
                        ddlNewServiceType.SelectedIndex = 0;
                    }
                    else
                    {
                        ddlNewServiceType.SelectedValue = Converter.GetString(getDTO.ServiceType);
                    }

                    lblLastProjectCode.Text = Converter.GetString(getDTO.EmpProject);
                    if (lblLastProjectCode.Text == string.Empty || lblLastProjectCode.Text == "0")
                    {
                        ddlNewProject.SelectedIndex = 0;
                    }
                    else
                    {
                        ddlNewProject.SelectedValue = Converter.GetString(getDTO.EmpProject);
                    }

                    lblLastProject.Text = Converter.GetString(ddlNewProject.SelectedItem.Text);


                    int          cashcode = Converter.GetInteger(getDTO.EmpCashCode);
                    A2ZCGLMSTDTO get5DTO  = (A2ZCGLMSTDTO.GetInformation(cashcode));
                    if (get5DTO.GLAccNo > 0)
                    {
                        lblLastCashCode.Text         = Converter.GetString(get5DTO.GLAccNo);
                        lblLastCashCodeDesc.Text     = Converter.GetString(get5DTO.GLAccDesc);
                        ddlNewCashCode.SelectedValue = Converter.GetString(get5DTO.GLAccNo);
                    }


                    lblLastBaseGradeCode.Text = Converter.GetString(getDTO.EmpBaseGrade);
                    if (lblLastBaseGradeCode.Text == string.Empty || lblLastBaseGradeCode.Text == "0")
                    {
                        ddlNewBaseGrade.SelectedIndex = 0;
                    }
                    else
                    {
                        ddlNewBaseGrade.SelectedValue = Converter.GetString(getDTO.EmpBaseGrade);
                    }

                    lblLastBaseGrade.Text = Converter.GetString(ddlNewBaseGrade.SelectedItem.Text);



                    lblLastGrade.Text     = Converter.GetString(getDTO.EmpGrade);
                    lblLastGradeDesc.Text = Converter.GetString(getDTO.EmpGradeDesc);
                    txtNewGrade.Text      = Converter.GetString(getDTO.EmpGrade);
                    lblNewGradeDesc.Text  = Converter.GetString(getDTO.EmpGradeDesc);

                    lblBaseGrade.Text = lblLastBaseGradeCode.Text;
                    lblGrade.Text     = lblLastGrade.Text;
                    PayScaleDesc();
                    lblLastPayScale.Text = lblPayScale.Text;

                    lblBaseGrade.Text = ddlNewBaseGrade.SelectedValue;
                    lblGrade.Text     = txtNewGrade.Text;
                    PayScaleDesc();
                    txtNewPayScale.Text = lblPayScale.Text;


                    lblLastPayLabel.Text = Converter.GetString(getDTO.EmpPayLabel);
                    txtNewPayLabel.Text  = Converter.GetString(getDTO.EmpPayLabel);

                    if (txtNewPayLabel.Text == string.Empty || txtNewPayLabel.Text == "0")
                    {
                        txtNewPayLabel.Text = "1";
                    }

                    lblPayLabel.Text = lblLastPayLabel.Text;
                    PayLabelBasic();
                    lblLastBasic.Text = lblBasic.Text;

                    lblPayLabel.Text = txtNewPayLabel.Text;
                    PayLabelBasic();
                    txtNewBasic.Text = lblBasic.Text;


                    if (getDTO.EmpLastPromotionDate == DateTime.MinValue)
                    {
                        txtLastPromotionDate.Text = string.Empty;
                    }
                    else
                    {
                        DateTime dt   = Converter.GetDateTime(getDTO.EmpLastPromotionDate);
                        string   date = dt.ToString("dd/MM/yyyy");
                        txtLastPromotionDate.Text = date;
                    }
                }
                else
                {
                    txtEmpNo.Text = string.Empty;
                    txtEmpNo.Focus();
                    InvalidEmpCodeMSG();
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.btnSumbit_Click Problem');</script>");
                //throw ex;
            }
        }
Esempio n. 20
0
        private void TranCodeDropDown()
        {
            try
            {
                if (hdnTranHead1.Text == "0")
                {
                    btnBack2.Visible = false;
                }
                else
                {
                    btnBack2.Visible = true;
                }


                if (hdnTranHead1.Text == "0")
                {
                    hdnTranHead1.Text = Converter.GetString(hdnTranCode.Text);
                    string sqlQueryTran = @"SELECT GLHead, LTRIM (GLHeadDesc) as GLHeadDesc FROM A2ZCGLMST WHERE GLRecType = 1 AND GLSubHead = 0 GROUP BY GLHead,GLHeadDesc ORDER BY GLHeadDesc ASC ";
                    ddlGLCode = CommonManager.Instance.FillDropDownList(sqlQueryTran, ddlGLCode, "A2ZGLMCUS");
                    ddlGLCode.SelectedItem.Text = "-Select Header Code-";
                    //txtTrnsactionCode.Text = string.Empty;
                }
                else if (hdnTranHead2.Text == "0")
                {
                    hdnTranHead2.Text = Converter.GetString(hdnTranCode.Text);
                    string input2    = hdnTranCode.Text;
                    string sub3      = input2.Substring(0, 1);
                    string sqlquery1 = @"SELECT GLAccNo, LTRIM (GLAccDesc) as GLAccDesc FROM A2ZCGLMST WHERE  GLPrtPos = 1 AND GLAccType = '" + sub3 + "' GROUP BY GLAccNo,GLAccDesc ORDER BY GLAccDesc ASC ";
                    ddlGLCode = CommonManager.Instance.FillDropDownList(sqlquery1, ddlGLCode, "A2ZGLMCUS");
                    ddlGLCode.SelectedItem.Text = "-Select Main Head Code-";
                    //txtTrnsactionCode.Text = string.Empty;
                }
                else if (hdnTranHead3.Text == "0")
                {
                    hdnTranHead3.Text = Converter.GetString(hdnTranCode.Text);
                    string inputMHead = hdnTranCode.Text;
                    string subMHead   = hdnTranCode.Text.Substring(0, 1);
                    string sub4       = inputMHead.Substring(0, 3);
                    string sqlquery1  = @"SELECT GLAccNo, LTRIM (GLAccDesc) as GLAccDesc FROM A2ZCGLMST WHERE  GLPrtPos = 2 AND GLAccType = '" + subMHead + "' AND LEFT(GLAccNo,3)='" + sub4 + "' GROUP BY GLAccNo,GLAccDesc Order By GLAccDesc ASC ";
                    ddlGLCode = CommonManager.Instance.FillDropDownList(sqlquery1, ddlGLCode, "A2ZGLMCUS");
                    ddlGLCode.SelectedItem.Text = "-Select Sub Head Code-";
                    //txtTrnsactionCode.Text = string.Empty;
                }
                else if (hdnTranHead4.Text == "0")
                {
                    hdnTranHead4.Text = Converter.GetString(hdnTranCode.Text);
                    string inputMHead = hdnTranCode.Text;
                    string subMHead   = hdnTranCode.Text.Substring(0, 1);
                    string sub4       = inputMHead.Substring(0, 5);
                    string sqlquery1  = @"SELECT GLAccNo, LTRIM (GLAccDesc) as GLAccDesc FROM A2ZCGLMST WHERE  GLPrtPos = 6 AND GLAccType = '" + subMHead + "' AND LEFT(GLAccNo,5)='" + sub4 + "' GROUP BY GLAccNo,GLAccDesc Order By GLAccDesc ASC";
                    ddlGLCode = CommonManager.Instance.FillDropDownList(sqlquery1, ddlGLCode, "A2ZGLMCUS");
                    ddlGLCode.SelectedItem.Text = "-Select Details Code-";
                    //txtTrnsactionCode.Text = string.Empty;
                }
                else
                {
                    txtGLCode.Text = Converter.GetString(ddlGLCode.SelectedValue);

                    int Code = Converter.GetInteger(ddlGLCode.SelectedValue);

                    A2ZCGLMSTDTO glObj = A2ZCGLMSTDTO.GetInformation(Code);
                    if (glObj.GLAccNo > 0)
                    {
                        CtrlRecType.Text = Converter.GetString(glObj.GLRecType);
                        CtrlAccType.Text = Converter.GetString(glObj.GLAccType);

                        if (CtrlRecType.Text != "2")
                        {
                            InvalidGlCode();
                            txtGLCode.Text = string.Empty;
                            txtGLCode.Focus();
                        }
                    }
                    else
                    {
                        Validity();
                        txtGLCode.Text = string.Empty;
                        txtGLCode.Focus();
                    }
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.TranCodeDropDown Problem');</script>");
                //throw ex;
            }
        }