protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                AccTypedropdown1();
                MemberDropdown();

                ddlAccNo.Visible = false;

                ItxtMemNo.Focus();



                hdnID.Text = DataAccessLayer.Utility.Converter.GetString(SessionStore.GetValue(Params.SYS_USER_ID));
                string Ctrflag = (string)Session["flag"];
                lblCtrlFlag.Text = Ctrflag;
            }
        }
        protected void ItxtMemNo_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (ItxtMemNo.Text != string.Empty)
                {
                    Int16 CuType    = Converter.GetSmallInteger(lblCuType.Text);
                    int   CNo       = Converter.GetSmallInteger(lblCuNo.Text);
                    int   MemNumber = Converter.GetInteger(ItxtMemNo.Text);
                    int   CuNumber  = Converter.GetInteger(hdnCuNumber.Text);

                    A2ZMEMBERDTO getDTO = new A2ZMEMBERDTO();

                    getDTO = (A2ZMEMBERDTO.GetInformation(CuType, CNo, MemNumber));

                    //A2ZMEMBERDTO getDTO = new A2ZMEMBERDTO();
                    //getDTO = (A2ZMEMBERDTO.GetInfoMember(CuType, CNo, CuNumber, MemNumber));

                    if (getDTO.NoRecord > 0)
                    {
                        ItxtMemNo.Text             = Converter.GetString(getDTO.MemberNo);
                        ddlLoanMemNo.SelectedValue = Converter.GetString(getDTO.MemberNo);
                        txtAccType.Focus();
                    }
                    else
                    {
                        ItxtMemNo.Text             = string.Empty;
                        ddlLoanMemNo.SelectedIndex = 0;
                        ItxtMemNo.Focus();
                        InvalidMemMSG();
                    }
                }
            }

            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "scriptkey", "<script>alert('System Error.txtMemNo_TextChanged Problem');</script>");
                //throw ex;
            }
        }
        protected void BtnNewSanction_Click(object sender, EventArgs e)
        {
            try
            {
                if (ItxtMemNo.Text == string.Empty)
                {
                    ItxtMemNo.Text = string.Empty;
                    ItxtMemNo.Focus();
                    InvalidMemMSG();
                    return;
                }

                if (ddlIAccType.SelectedValue == "-Select-")
                {
                    InvalidAccTypeMSG();
                    return;
                }

                if (ItxtIncreaseSanctionAmount.Text == string.Empty)
                {
                    ItxtIncreaseSanctionAmount.Text = string.Empty;
                    ItxtIncreaseSanctionAmount.Focus();
                    InvalidSancAmtMSG();
                    return;
                }

                if (ItxtNewInterestRate.Text == string.Empty)
                {
                    ItxtNewInterestRate.Text = string.Empty;
                    ItxtNewInterestRate.Focus();
                    InvalidIntRateMSG();
                    return;
                }

                A2ZLOANHSTDTO objDTO = new A2ZLOANHSTDTO();
                objDTO.AccType  = Converter.GetInteger(ddlIAccType.SelectedValue);
                objDTO.AccNo    = Converter.GetLong(ItxtAccNo.Text);
                objDTO.CuType   = Converter.GetSmallInteger(0);
                objDTO.CuNo     = Converter.GetInteger(0);
                objDTO.MemberNo = Converter.GetInteger(ItxtMemNo.Text);
                A2ZCSPARAMETERDTO dto = A2ZCSPARAMETERDTO.GetParameterValue();
                objDTO.SanctionDate       = Converter.GetDateTime(dto.ProcessDate);
                objDTO.PrevSanctionAmount = Converter.GetDecimal(IlblExSancAmt.Text);
                objDTO.PrevIntRate        = Converter.GetDecimal(IlblExIntRate.Text);

                objDTO.PrevNoInstl          = Converter.GetInteger(IlblExNoInstl.Text);
                objDTO.PrevLoanInstlAmt     = Converter.GetDecimal(lblExistInstlAmt.Text);
                objDTO.PrevLoanLastInstlAmt = Converter.GetDecimal(lblExistLastInstlAmt.Text);

                objDTO.ApproveBy = Converter.GetSmallInteger(hdnID.Text);


                int result = A2ZLOANHSTDTO.InsertRSInformation(objDTO);
                if (result > 0)
                {
                    string strQuery  = "UPDATE A2ZACCOUNT SET  AccLoanSancAmt = '" + ItxtIncreaseSanctionAmount.Text + "',AccDisbAmt = '" + lblDisbAmt.Text + "', AccLoanInstlAmt= '" + ItxtNewInstalAmt.Text + "',AccLoanLastInstlAmt= '" + ItxtNewLastInstalAmt.Text + "',AccNoInstl= '" + ItxtNewNoInstal.Text + "',AccIntRate= '" + ItxtNewInterestRate.Text + "' WHERE  CuType=0 AND CuNo=0 AND MemNo='" + ItxtMemNo.Text + "' AND  AccType='" + ddlIAccType.SelectedValue + "' AND AccNo='" + ItxtAccNo.Text + "'";
                    int    rowEffect = Converter.GetInteger(DataAccessLayer.BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZCSMCUS"));


                    Success();


                    ClearInfo();

                    ItxtMemNo.Focus();
                }
            }

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