protected void ClearData()
 {
     //TxtVaultType.Text = "";
     TxtNoOfNotes.Text = "";
     TxtNoteType.Text  = "";
     TxtTotal.Text     = "";
     TxtCloseBal.Text  = "";
     TxtCloseBal.Focus();
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["UserName"] == null)
            {
                Response.Redirect("FrmLogin.aspx");
            }
            TxtEntrydate.Text = Session["EntryDate"].ToString();
            TxtCloseBal.Focus();
            ViewState["Flag"]    = Request.QueryString["Flag"];
            TxtVaultType.Text    = CA.Get_Vault_Type(Session["MID"].ToString(), Session["BRCD"].ToString());
            TxtVaultType.Enabled = false;
            if (TxtVaultType.Text == null)
            {
                lblMessage.Text = "";
                lblMessage.Text = "User Not Valid!!....Change User";
                ModalPopup.Show(this.Page);
                return;
            }
            if (ViewState["Flag"].ToString() == "AD")
            {
                ltrlHeader.Text            = " Add";
                GrdCurr.Columns[5].Visible = false; //stage
                GrdCurr.Columns[6].Visible = false; //modify
                GrdCurr.Columns[7].Visible = false; //autho
                GrdCurr.Columns[8].Visible = false; //delete
                ENDN(true);
                DIVRDB.Visible = false;
                BindGrid();
            }

            else if (ViewState["Flag"].ToString() == "MD")
            {
                ltrlHeader.Text            = "Modify";
                BtnSubmit.Text             = "Modify";
                GrdCurr.Columns[5].Visible = false;
                GrdCurr.Columns[6].Visible = true;
                GrdCurr.Columns[7].Visible = false;
                GrdCurr.Columns[8].Visible = false;
                DIVRDB.Visible             = false;
                ENDN(true);
                BindGrid();
            }
            else if (ViewState["Flag"].ToString() == "DL")
            {
                ltrlHeader.Text            = "Delete";
                BtnSubmit.Text             = "Delete";
                GrdCurr.Columns[5].Visible = false;
                GrdCurr.Columns[6].Visible = false;
                GrdCurr.Columns[7].Visible = false;
                GrdCurr.Columns[8].Visible = true;
                DIVRDB.Visible             = false;
                ENDN(false);
                BindGrid();
            }
            else if (ViewState["Flag"].ToString() == "AT")
            {
                ltrlHeader.Text            = "Authorize";
                BtnSubmit.Text             = "Authorize";
                GrdCurr.Columns[5].Visible = false;
                GrdCurr.Columns[6].Visible = false;
                GrdCurr.Columns[7].Visible = true;
                GrdCurr.Columns[8].Visible = false;
                DIVRDB.Visible             = false;
                ENDN(false);
                BindGrid();
            }
            else if (ViewState["Flag"].ToString() == "VW")
            {
                ltrlHeader.Text            = "View";
                BtnSubmit.Text             = "View";
                DIV1.Visible               = false;
                DIV2.Visible               = false;
                DIV3.Visible               = false;
                GrdCurr.Columns[5].Visible = true;
                GrdCurr.Columns[6].Visible = false;
                GrdCurr.Columns[7].Visible = false;
                GrdCurr.Columns[8].Visible = false;
            }
        }
    }