protected void Page_Load(object sender, EventArgs e)
    {
        if (BaseContent.IsSessionExpired())
        {
            Response.Redirect("../Default.aspx");
            return;
        }
        bcContent = (BaseClass)Session["BCContent"];

        userObj.UserID = bcContent.LoginID.ToString();
        fundCode       = bcContent.FundCode.ToString();
        branchCode     = bcContent.BranchCode.ToString();
        // spanFundName.InnerText = opendMFDAO.GetFundName(fundCode.ToString());
        FundCodeTextBox.Text   = fundCode.ToString();
        BranchCodeTextBox.Text = branchCode.ToString();

        RegNoTextBox.Focus();



        if (!IsPostBack)
        {
            LienbankNameDropDownList.DataSource     = opendMFDAO.dtFillBankName();
            LienbankNameDropDownList.DataTextField  = "BANK_NAME";
            LienbankNameDropDownList.DataValueField = "BANK_CODE";
            LienbankNameDropDownList.DataBind();

            SignatoryDropDownList.DataSource     = reportObj.dtFillSignatory();
            SignatoryDropDownList.DataTextField  = "NAME";
            SignatoryDropDownList.DataValueField = "ID";
            SignatoryDropDownList.DataBind();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (BaseContent.IsSessionExpired())
        {
            Response.Redirect("../Default.aspx");
            return;
        }
        bcContent = (BaseClass)Session["BCContent"];

        userObj.UserID = bcContent.LoginID.ToString();
        string fundCode   = bcContent.FundCode.ToString();
        string branchCode = bcContent.BranchCode.ToString();

        spanFundName.InnerText = opendMFDAO.GetFundName(fundCode.ToString());
        fundCodeTextBox.Text   = fundCode.ToString();
        branchCodeTextBox.Text = branchCode.ToString();


        // toRegDateTextBox.Text = DateTime.Today.ToString("dd-MMM-yyyy");
        // fromRegDateTextBox.Text = DateTime.Today.ToString("dd-MMM-yyyy"); ;
        ///holderDateofBirthTextBox.Text = DateTime.Today.ToString("dd-MMM-yyyy");

        if (!IsPostBack)
        {
            LienbankNameDropDownList.DataSource     = opendMFDAO.dtFillBankName();
            LienbankNameDropDownList.DataTextField  = "BANK_NAME";
            LienbankNameDropDownList.DataValueField = "BANK_CODE";
            LienbankNameDropDownList.DataBind();
        }
        else
        {
        }
    }
    protected void LienMarkDropDownList_SelectedIndexChanged(object sender, EventArgs e)
    {
        UnitHolderRegistration unitRegObj = new UnitHolderRegistration();

        unitRegObj.FundCode   = FundCodeTextBox.Text.Trim();
        unitRegObj.BranchCode = BranchCodeTextBox.Text.Trim();
        unitRegObj.RegNumber  = RegNoTextBox.Text.Trim();
        UnitLien unitLienObj = new UnitLien();

        unitLienObj.LienNo = Convert.ToInt32(LienMarkDropDownList.SelectedValue.ToString());
        DataTable dtLienCerts     = unitLienBLObj.dtTotalLienCert(unitRegObj, unitLienObj);
        long      totalLienAmount = unitLienBLObj.totalLienAmount(unitRegObj, unitLienObj);
        DataTable dtLienDetails   = unitLienBLObj.dtLienDetailsInfo(unitRegObj, unitLienObj);

        if (dtLienDetails.Rows.Count > 0)
        {
            LienbankNameDropDownList.SelectedValue    = dtLienDetails.Rows[0]["LN_BK_CODE"].ToString();
            LienbranchNameDropDownList.DataSource     = opendMFDAO.dtFillBranchName(Convert.ToInt32(dtLienDetails.Rows[0]["LN_BK_CODE"].ToString()));
            LienbranchNameDropDownList.DataTextField  = "BRANCH_NAME";
            LienbranchNameDropDownList.DataValueField = "BRANCH_CODE";
            LienbranchNameDropDownList.DataBind();
            LienbranchNameDropDownList.SelectedValue = dtLienDetails.Rows[0]["LN_BK_BR_CODE"].ToString();

            if (dtLienCerts.Rows.Count > 0)
            {
                dvContentBottom.Visible = true;
                leftDataGrid.DataSource = dtLienCerts;
                leftDataGrid.DataBind();
                TotalLienUnitHoldingTextBox.Text = totalLienAmount.ToString();
            }
            else
            {
                TotalLienUnitHoldingTextBox.Text = "";
                TotalUnitLienCancelTextBox.Text  = "";
                dvContentBottom.Visible          = false;
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Units To Lien Cancel ');", true);
            }
            LienMarkCancelNoTextBox.Text  = unitLienBLObj.getNextLienCancelNo(unitRegObj, userObj).ToString();
            unitLienObj.LienCancelNo      = unitLienBLObj.getNextLienCancelNo(unitRegObj, userObj) - 1;
            LienCancelReqDateTextBox.Text = unitLienBLObj.getLastLienCancelReqDate(unitRegObj, unitLienObj).ToString("dd-MMM-yyyy");
        }
        else
        {
            TotalLienUnitHoldingTextBox.Text = "";
            TotalUnitLienCancelTextBox.Text  = "";
            dvContentBottom.Visible          = false;
            LienbankNameDropDownList.Focus();
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('No Units To Lien Cancel  ');", true);
        }
    }