//protected void dropdown()
        //{
        //    string sqlquery = "SELECT ProductCode,ProductCode from A2ZACCCTRL group by ProductCode";
        //    ddlAccount = DataAccessLayer.BLL.CommonManager.Instance.FillDropDownList(sqlquery, ddlAccount, "A2ZCSMCUS");

        //}
        protected void BtnAccountOpenSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                A2ZACCCTRLDTO objDTO = new A2ZACCCTRLDTO();

                objDTO.ProductCode = Converter.GetSmallInteger(txtAccType.Text);
                objDTO.ControlCode = Converter.GetSmallInteger(ddlFlagCheck.SelectedValue);

                int      roweffect = 0;
                CheckBox chk       = new CheckBox();
                for (int i = 0; i < gvDescription.Rows.Count; i++)
                {
                    chk = (CheckBox)gvDescription.Rows[i].Cells[0].FindControl("chkDescription");
                    int flag = 1;
                    if (chk.Checked)
                    {
                        Label2.Text        = Convert.ToString(flag);
                        Label1.Text        = Converter.GetString(gvDescription.Rows[i].Cells[0].Text);
                        Label3.Text        = Converter.GetString(gvDescription.Rows[i].Cells[1].Text);
                        objDTO.Description = Converter.GetString(Label3.Text);
                        objDTO.RecordCode  = Converter.GetSmallInteger(Label1.Text);
                        objDTO.RecordFlag  = Converter.GetSmallInteger(Label2.Text);
                        roweffect          = A2ZACCCTRLDTO.InsertInformation(objDTO);
                        chk.Checked        = false;
                    }

                    else
                    {
                        flag               = 0;
                        Label2.Text        = Convert.ToString(flag);
                        Label1.Text        = Converter.GetString(gvDescription.Rows[i].Cells[0].Text);
                        Label3.Text        = Converter.GetString(gvDescription.Rows[i].Cells[1].Text);
                        objDTO.Description = Converter.GetString(Label3.Text);
                        objDTO.RecordCode  = Converter.GetSmallInteger(Label1.Text);
                        objDTO.RecordFlag  = Converter.GetSmallInteger(Label2.Text);
                        roweffect          = A2ZACCCTRLDTO.InsertInformation(objDTO);
                        chk.Checked        = false;
                    }
                }


                if (roweffect > 0)
                {
                    txtAccType.Focus();

                    clearinfo();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void btnAccountUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                string qry = "DELETE FROM A2ZACCCTRL WHERE ProductCode = '" + txtAccType.Text + "' AND ControlCode = 2";
                int    row = Converter.GetInteger(DataAccessLayer.BLL.CommonManager.Instance.ExecuteNonQuery(qry, "A2ZCSMCUS"));

                A2ZACCCTRLDTO objDTO = new A2ZACCCTRLDTO();

                //objDTO.ProductCode = Converter.GetSmallInteger(ddlAccount.SelectedValue);
                objDTO.ProductCode = Converter.GetSmallInteger(txtAccType.Text);
                objDTO.ControlCode = Converter.GetSmallInteger(ddlFlagCheck.SelectedValue);
                int roweffect = 0;
                for (int i = 0; i < gvDescription.Rows.Count; i++)
                {
                    CheckBox chk  = (CheckBox)gvDescription.Rows[i].Cells[0].FindControl("chkDescription");
                    int      flag = 1;
                    if (chk.Checked)
                    {
                        Label2.Text = Convert.ToString(flag);
                    }
                    else
                    {
                        flag        = 0;
                        Label2.Text = Convert.ToString(flag);
                    }

                    Label1.Text        = Converter.GetString(gvDescription.Rows[i].Cells[0].Text);
                    objDTO.RecordCode  = Converter.GetSmallInteger(Label1.Text);
                    Label3.Text        = Converter.GetString(gvDescription.Rows[i].Cells[1].Text);
                    objDTO.Description = Converter.GetString(Label3.Text);
                    objDTO.RecordFlag  = Converter.GetSmallInteger(Label2.Text);
                    roweffect          = A2ZACCCTRLDTO.InsertInformation(objDTO);
                    chk.Checked        = false;
                }

                if (roweffect > 0)
                {
                    txtAccType.Focus();
                    //ddlAccount.SelectedValue = "-Select-";
                    clearinfo();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void txtAccType_TextChanged(object sender, EventArgs e)
        {
            if (txtAccType.Text != string.Empty)
            {
                Int16         MainCode = Converter.GetSmallInteger(txtAccType.Text);
                A2ZACCTYPEDTO getDTO   = (A2ZACCTYPEDTO.GetInformation(MainCode));

                if (getDTO.AccTypeCode > 0)
                {
                    txtAccType.Text          = Converter.GetString(getDTO.AccTypeCode);
                    ddlAccount.SelectedValue = Converter.GetString(getDTO.AccTypeCode);
                    txtAccType.Focus();
                }
                else
                {
                    ddlAccount.SelectedValue = "-Select-";
                    String csname1         = "PopupScript";
                    Type   cstype          = GetType();
                    ClientScriptManager cs = Page.ClientScript;

                    if (!cs.IsStartupScriptRegistered(cstype, csname1))
                    {
                        String cstext1 = "alert('This Account Code Does not Exist in file');";
                        cs.RegisterStartupScript(cstype, csname1, cstext1, true);
                        txtAccType.Focus();
                        gvDescription.Visible        = true;
                        gvDetails.Visible            = false;
                        BtnAccountOpenSubmit.Visible = true;
                        btnAccountUpdate.Visible     = false;
                    }
                    return;
                }
            }

            if (txtAccType.Text != string.Empty)
            {
                Int16 code = Converter.GetSmallInteger(txtAccType.Text);
                //string sqlquery = "SELECT ProductCode, RecordCode,Description from A2ZACCCTRL where ProductCode='" + code + "'and ControlCode='2'";
                //gvDetails = DataAccessLayer.BLL.CommonManager.Instance.FillGridViewList(sqlquery, gvDetails, "A2ZCSMCUS");

                A2ZACCCTRLDTO getDTO = new A2ZACCCTRLDTO();
                for (int i = 0; i < gvDescription.Rows.Count; i++)
                {
                    //Int16 pcode = Converter.GetSmallInteger(txtProductCode.Text);
                    Int16 rcode = Converter.GetSmallInteger(gvDescription.Rows[i].Cells[0].Text);
                    Int16 ccode = 2;
                    getDTO = (A2ZACCCTRLDTO.GetInformation(code, ccode, rcode));
                    if (getDTO.ProductCode > 0 && getDTO.RecordCode > 0)
                    {
                        Label4.Text = Converter.GetString(getDTO.RecordFlag);
                        ddlAccount.SelectedValue     = Converter.GetString(getDTO.ProductCode);
                        BtnAccountOpenSubmit.Visible = false;
                        btnAccountUpdate.Visible     = true;
                        //gvDescription.Visible = false;
                        //gvDetails.Visible = true;
                        ddlAccount.Focus();

                        CheckBox chk = (CheckBox)gvDescription.Rows[i].Cells[0].FindControl("chkDescription");

                        if (Label4.Text == "1")
                        {
                            chk.Checked = true;
                        }
                        else
                        {
                            chk.Checked = false;
                        }
                    }

                    else
                    {
                        CheckBox chk = (CheckBox)gvDescription.Rows[i].Cells[0].FindControl("chkDescription");
                        chk.Checked = false;
                    }
                }
            }
        }
        protected void ddlAccount_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlAccount.SelectedValue != "-Select-")
            {
                Int16         MainCode = Converter.GetSmallInteger(ddlAccount.SelectedValue);
                A2ZACCTYPEDTO getDTO   = (A2ZACCTYPEDTO.GetInformation(MainCode));
                if (getDTO.AccTypeCode > 0)
                {
                    txtAccType.Text = Converter.GetString(getDTO.AccTypeCode);
                    txtAccType.Focus();
                    gvDescription.Visible        = true;
                    gvDetails.Visible            = false;
                    BtnAccountOpenSubmit.Visible = true;
                    btnAccountUpdate.Visible     = false;
                }
            }

            if (ddlAccount.SelectedValue == "-Select-")
            {
                gvDescription.Visible        = true;
                gvDetails.Visible            = false;
                BtnAccountOpenSubmit.Visible = true;
                btnAccountUpdate.Visible     = false;
                txtAccType.Text = string.Empty;
                txtAccType.Focus();
            }
            try
            {
                if (ddlAccount.SelectedValue != "-Select-")
                {
                    Int16 code  = Converter.GetSmallInteger(ddlAccount.SelectedValue);
                    Int16 ccode = 2;

                    //string sqlquery = "SELECT ProductCode, RecordCode,Description from A2ZACCCTRL where ProductCode='" + code + "' and ControlCode='2'";
                    //gvDetails = DataAccessLayer.BLL.CommonManager.Instance.FillGridViewList(sqlquery, gvDetails, "A2ZCSMCUS");



                    for (int i = 0; i < gvDescription.Rows.Count; i++)
                    {
                        A2ZACCCTRLDTO getDTO = new A2ZACCCTRLDTO();
                        //Int16 pcode = Converter.GetSmallInteger(ddlAccount.SelectedValue);
                        Int16 rcode = Converter.GetSmallInteger(gvDescription.Rows[i].Cells[0].Text);
                        getDTO = (A2ZACCCTRLDTO.GetInformation(code, ccode, rcode));
                        if (getDTO.ProductCode > 0 && getDTO.RecordCode > 0)
                        {
                            Label4.Text     = Converter.GetString(getDTO.RecordFlag);
                            txtAccType.Text = Converter.GetString(code);
                            //gvDescription.Visible = false;
                            //gvDetails.Visible = true;
                            BtnAccountOpenSubmit.Visible = false;
                            btnAccountUpdate.Visible     = true;

                            CheckBox chk = (CheckBox)gvDescription.Rows[i].Cells[0].FindControl("chkDescription");

                            if (Label4.Text == "1")
                            {
                                chk.Checked = true;
                            }
                            else
                            {
                                chk.Checked = false;
                            }
                        }

                        else
                        {
                            CheckBox chk = (CheckBox)gvDescription.Rows[i].Cells[0].FindControl("chkDescription");
                            chk.Checked = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #5
0
        //protected void dropdown()
        //{
        //    string sqlquery = "SELECT ProductCode,ProductCode from A2ZACCCTRL group by ProductCode";
        //    ddlAccount = DataAccessLayer.BLL.CommonManager.Instance.FillDropDownList(sqlquery, ddlAccount, "A2ZCSMCUS");

        //}
        protected void BtnAccountOpenSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                A2ZACCCTRLDTO objDTO = new A2ZACCCTRLDTO();

                objDTO.ProductCode = Converter.GetSmallInteger(txtAccType.Text);
                objDTO.ControlCode = Converter.GetSmallInteger(ddlFlagCheck.SelectedValue);

                int      roweffect = 0;
                CheckBox chk       = new CheckBox();
                CheckBox chk1      = new CheckBox();
                for (int i = 0; i < gvDescription.Rows.Count; i++)
                {
                    chk  = (CheckBox)gvDescription.Rows[i].Cells[0].FindControl("chkDescription");
                    chk1 = (CheckBox)gvDescription.Rows[i].Cells[0].FindControl("chk1Description");
                    int flag  = 1;
                    int flag1 = 1;
                    if (chk.Checked)
                    {
                        Label2.Text        = Convert.ToString(flag);
                        Label5.Text        = Convert.ToString(flag1);
                        Label1.Text        = Converter.GetString(gvDescription.Rows[i].Cells[0].Text);
                        Label3.Text        = Converter.GetString(gvDescription.Rows[i].Cells[1].Text);
                        objDTO.Description = Converter.GetString(Label3.Text);
                        objDTO.RecordCode  = Converter.GetSmallInteger(Label1.Text);
                        objDTO.RecordFlag  = Converter.GetSmallInteger(Label2.Text);
                        chk.Checked        = false;

                        if (chk1.Checked)
                        {
                            objDTO.FuncFlag = Converter.GetSmallInteger(Label5.Text);
                            chk1.Checked    = false;
                        }

                        roweffect = A2ZACCCTRLDTO.InsertInformation(objDTO);
                    }

                    else
                    {
                        flag               = 0;
                        flag1              = 0;
                        Label2.Text        = Convert.ToString(flag);
                        Label5.Text        = Convert.ToString(flag1);
                        Label1.Text        = Converter.GetString(gvDescription.Rows[i].Cells[0].Text);
                        Label3.Text        = Converter.GetString(gvDescription.Rows[i].Cells[1].Text);
                        objDTO.Description = Converter.GetString(Label3.Text);
                        objDTO.RecordCode  = Converter.GetSmallInteger(Label1.Text);
                        objDTO.RecordFlag  = Converter.GetSmallInteger(Label2.Text);
                        objDTO.FuncFlag    = Converter.GetSmallInteger(Label5.Text);
                        roweffect          = A2ZACCCTRLDTO.InsertInformation(objDTO);
                        chk.Checked        = false;
                        chk1.Checked       = false;
                    }
                }


                if (roweffect > 0)
                {
                    txtAccType.Focus();

                    clearinfo();
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.BtnAccountOpenSubmit_Click Problem');</script>");

                //throw ex;
            }
        }
Beispiel #6
0
        protected void txtAccType_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (txtAccType.Text != string.Empty)
                {
                    Int16         MainCode = Converter.GetSmallInteger(txtAccType.Text);
                    A2ZACCTYPEDTO getDTO   = (A2ZACCTYPEDTO.GetInformation(MainCode));

                    if (getDTO.AccTypeCode > 0)
                    {
                        txtAccType.Text          = Converter.GetString(getDTO.AccTypeCode);
                        ddlAccount.SelectedValue = Converter.GetString(getDTO.AccTypeCode);
                        txtAccType.Focus();
                    }
                    else
                    {
                        ddlAccount.SelectedValue = "-Select-";
                        ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('This Account Code Does not Exist in file');", true);

                        //String csname1 = "PopupScript";
                        //Type cstype = GetType();
                        //ClientScriptManager cs = Page.ClientScript;

                        //if (!cs.IsStartupScriptRegistered(cstype, csname1))
                        //{
                        //    String cstext1 = "alert('This Account Code Does not Exist in file');";
                        //    cs.RegisterStartupScript(cstype, csname1, cstext1, true);
                        txtAccType.Focus();
                        gvDescription.Visible        = true;
                        gvDetails.Visible            = false;
                        BtnAccountOpenSubmit.Visible = true;
                        btnAccountUpdate.Visible     = false;

                        //}
                        return;
                    }
                }


                if (txtAccType.Text != string.Empty)
                {
                    Int16  code     = Converter.GetSmallInteger(txtAccType.Text);
                    string sqlquery = "SELECT ProductCode, RecordCode,Description from A2ZACCCTRL where ProductCode='" + code + "'and ControlCode='1'";
                    gvDetails = DataAccessLayer.BLL.CommonManager.Instance.FillGridViewList(sqlquery, gvDetails, "A2ZCSMCUS");
                    A2ZACCCTRLDTO getDTO = new A2ZACCCTRLDTO();
                    for (int i = 0; i < gvDetails.Rows.Count; i++)
                    {
                        //Int16 pcode = Converter.GetSmallInteger(txtProductCode.Text);
                        Int16 rcode = Converter.GetSmallInteger(gvDetails.Rows[i].Cells[0].Text);
                        Int16 ccode = 1;
                        getDTO = (A2ZACCCTRLDTO.GetInformation(code, ccode, rcode));
                        if (getDTO.ProductCode > 0 && getDTO.RecordCode > 0)
                        {
                            Label4.Text = Converter.GetString(getDTO.RecordFlag);
                            Label5.Text = Converter.GetString(getDTO.FuncFlag);
                            ddlAccount.SelectedValue     = Converter.GetString(getDTO.ProductCode);
                            BtnAccountOpenSubmit.Visible = false;
                            btnAccountUpdate.Visible     = true;
                            gvDescription.Visible        = false;
                            gvDetails.Visible            = true;
                            ddlAccount.Focus();
                        }
                        //else
                        //{

                        //    ddlAccount.SelectedValue = "-Select-";
                        //    gvDescription.Visible = true;
                        //    gvDetails.Visible = false;
                        //    BtnAccountOpenSubmit.Visible = true;
                        //    btnAccountUpdate.Visible = false;


                        //}


                        CheckBox chk  = (CheckBox)gvDetails.Rows[i].Cells[0].FindControl("chkUpdate");
                        CheckBox chk1 = (CheckBox)gvDetails.Rows[i].Cells[0].FindControl("chk1Update");

                        if (Label4.Text == "1")
                        {
                            chk.Checked = true;
                        }
                        else
                        {
                            chk.Checked = false;
                        }
                        if (Label5.Text == "1")
                        {
                            chk1.Checked = true;
                        }
                        else
                        {
                            chk1.Checked = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.txtAccType_TextChanged Problem');</script>");

                //throw ex;
            }
        }
Beispiel #7
0
        protected void txtAccType_TextChanged(object sender, EventArgs e)
        {
            if (txtAccType.Text != string.Empty)
            {
                A2ZACCTYPEDTO objDTO  = new A2ZACCTYPEDTO();
                Int16         typecls = Converter.GetSmallInteger(txtAccType.Text);
                objDTO = (A2ZACCTYPEDTO.GetInformation(typecls));
                if (objDTO.AccTypeCode > 0)
                {
                    Visible();
                    lbltypecls.Text          = Converter.GetString(objDTO.AccTypeClass);
                    lblType.Text             = Converter.GetString(objDTO.AccTypeCode);
                    ddlAccType.SelectedValue = Converter.GetString(objDTO.AccTypeCode);
                }

                //Response.Write("<script>alert('dsadasd');</script>");
            }

            GetInfo();
            try
            {
                Int16 code = Converter.GetSmallInteger(txtAccType.Text);
                //string sqlquery = "SELECT ProductCode, RecordCode,RecordFlag from A2ZACCCTRL where ProductCode='" + code + "'and ControlCode='2'";
                //gvHidden = DataAccessLayer.BLL.CommonManager.Instance.FillGridViewList(sqlquery, gvHidden, "A2ZCSMCUS");
                A2ZACCCTRLDTO getDTO = new A2ZACCCTRLDTO();
                for (int i = 0; i < gvHidden.Rows.Count; i++)
                {
                    Int16 rcode = Converter.GetSmallInteger(gvHidden.Rows[i].Cells[1].Text);
                    Int16 ccode = 2;
                    getDTO = (A2ZACCCTRLDTO.GetInformation(code, ccode, rcode));
                    if (getDTO.ProductCode > 0 && getDTO.RecordCode > 0)
                    {
                        Label4.Text = Converter.GetString(getDTO.RecordFlag);
                    }

                    if (Label4.Text == "1")
                    {
                        switch (rcode)
                        {
                        case 1:
                            ddlCalPeriod.Visible = true;
                            lblCalPeriod.Visible = true;
                            break;

                        case 2:
                            ddlCalMethod.Visible = true;
                            lblCalMethod.Visible = true;
                            break;

                        case 3:
                            ddlLoanCalMethod.Visible = true;
                            lblLoanCalMethod.Visible = true;
                            break;

                        case 4:
                            txtInterestRate.Visible = true;
                            lblInterestRate.Visible = true;
                            break;

                        case 5:
                            txtFundRate.Visible = true;
                            lblFundRate.Visible = true;
                            break;

                        case 6:
                            ddlProdCondition.Visible = true;
                            lblProdCondition.Visible = true;
                            break;

                        case 7:
                            ddlProdIntType.Visible = true;
                            lblProdIntType.Visible = true;
                            break;

                        case 8:
                            txtMinDepositAmt.Visible = true;
                            lblMinDepositAmt.Visible = true;
                            break;

                        case 9:
                            ddlRoundFlag.Visible = true;
                            lblRoundFlag.Visible = true;
                            break;

                        case 10:
                            txtIntWithdrDays.Visible = true;
                            lblIntWithdrDays.Visible = true;
                            break;

                        case 11:
                            txtAccProcFees.Visible = true;
                            lblAccProcFees.Visible = true;
                            break;

                        case 12:
                            txtAccClosingFees.Visible = true;
                            lblAccClosingFees.Visible = true;
                            break;

                        case 13:
                            txtPeriod.Visible = true;
                            lblPeriod.Visible = true;
                            break;

                        case 99:
                            BtnSlab.Visible = true;
                            lblSlab.Visible = true;
                            break;
                        }
                    }
                }
                if (BtnUpdate.Visible == true)
                {
                    lblTest.Text    = "1";
                    Session["Test"] = lblTest.Text;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }