protected void findButton_Click(object sender, EventArgs e)
    {
        UnitHolderRegistration regObj = new UnitHolderRegistration();

        regObj.FundCode   = fundCodeDDL.SelectedValue.ToString();
        regObj.BranchCode = branchCodeDDL.SelectedValue.ToString();
        regObj.RegNumber  = regNoTextBox.Text.Trim();
        regObj.BO         = holderBOTextBox.Text.ToString().Trim();
        regObj.Folio      = folioTextBox.Text.Trim();

        DataTable dtValidSearch = opendMFDAO.dtValidSearch(regObj);

        if (dtValidSearch.Rows.Count > 0)
        {
            regObj            = new UnitHolderRegistration();
            regObj.FundCode   = fundCodeDDL.SelectedValue.ToString();
            regObj.BranchCode = branchCodeDDL.SelectedValue.ToString();
            regObj.RegNumber  = dtValidSearch.Rows[0]["REG_NO"].ToString();
            displayRegInfo(regObj);
        }
        else
        {
            SignImage.ImageUrl = encrypt.PhotoBase64ImgSrc(Path.Combine(ConfigReader.SingLocation, "Notavailable.JPG").ToString());
            ClearText();
            dvLedger.Visible = false;
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Invalid Registration Number OR BO OR Foilo');", true);
        }
    }
Esempio n. 2
0
    protected void findButton_Click(object sender, EventArgs e)
    {
        UnitHolderRegistration regObj = new UnitHolderRegistration();

        regObj.FundCode   = fundCodeDDL.SelectedValue.ToString();
        regObj.BranchCode = branchCodeDDL.SelectedValue.ToString();
        regObj.RegNumber  = regNoTextBox.Text.Trim();
        regObj.BO         = holderBOTextBox.Text.ToString().Trim();

        DataTable dtValidSearch = opendMFDAO.dtValidSearch(regObj);

        if (dtValidSearch.Rows.Count > 0)
        {
            regObj            = new UnitHolderRegistration();
            regObj.FundCode   = fundCodeDDL.SelectedValue.ToString();
            regObj.BranchCode = branchCodeDDL.SelectedValue.ToString();
            regObj.RegNumber  = dtValidSearch.Rows[0]["REG_NO"].ToString();
            DataTable dtRegInfo = opendMFDAO.getDtRegInfo(regObj);

            regNoTextBox.Text    = dtRegInfo.Rows[0]["REG_NO"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["REG_NO"].ToString();
            holderBOTextBox.Text = dtRegInfo.Rows[0]["BO"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["BO"].ToString();
            NameTextBox.Text     = dtRegInfo.Rows[0]["HNAME"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["HNAME"].ToString();
            string string1 = dtRegInfo.Rows[0]["ADDRS1"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["ADDRS1"].ToString();
            string string2 = dtRegInfo.Rows[0]["ADDRS2"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["ADDRS2"].ToString();
            string string3 = dtRegInfo.Rows[0]["CITY"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["CITY"].ToString();
            addressTextBox.Text = string1.ToString() + " " + string2 + " " + string3;
        }
        else
        {
            regNoTextBox.Text    = "";
            holderBOTextBox.Text = "";
            NameTextBox.Text     = "";
            addressTextBox.Text  = "";
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Invalid Registration Number OR BO ');", true);
        }
    }
    protected void findButton_Click(object sender, EventArgs e)
    {
        UnitHolderRegistration regObj = new UnitHolderRegistration();

        regObj.FundCode   = fundCodeDDL.SelectedValue.ToString();
        regObj.BranchCode = branchCodeDDL.SelectedValue.ToString();
        regObj.RegNumber  = regNoTextBox.Text.Trim();
        regObj.BO         = holderBOTextBox.Text.ToString().Trim();

        DataTable dtValidSearch = opendMFDAO.dtValidSearch(regObj);

        if (dtValidSearch.Rows.Count > 0)
        {
            regObj            = new UnitHolderRegistration();
            regObj.FundCode   = fundCodeDDL.SelectedValue.ToString();
            regObj.BranchCode = branchCodeDDL.SelectedValue.ToString();
            regObj.RegNumber  = dtValidSearch.Rows[0]["REG_NO"].ToString();
            DataTable dtRegInfo = opendMFDAO.getDtRegInfo(regObj);

            regNoTextBox.Text    = dtRegInfo.Rows[0]["REG_NO"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["REG_NO"].ToString();
            holderBOTextBox.Text = dtRegInfo.Rows[0]["BO"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["BO"].ToString();

            NameTextBox.Text = dtRegInfo.Rows[0]["HNAME"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["HNAME"].ToString();
            string string1 = dtRegInfo.Rows[0]["ADDRS1"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["ADDRS1"].ToString();
            string string2 = dtRegInfo.Rows[0]["ADDRS2"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["ADDRS2"].ToString();
            string string3 = dtRegInfo.Rows[0]["CITY"].Equals(DBNull.Value) ? "" : dtRegInfo.Rows[0]["CITY"].ToString();
            addressTextBox.Text = string1.ToString() + " " + string2 + " " + string3;

            if (!dtRegInfo.Rows[0]["SELLING_AGENT_ID"].Equals(DBNull.Value))
            {
                agentNameDDL.DataSource     = unitSaleBLObj.dtSellingAgentInfoforDDL();
                agentNameDDL.DataTextField  = "NAME";
                agentNameDDL.DataValueField = "ID";
                agentNameDDL.SelectedValue  = dtRegInfo.Rows[0]["SELLING_AGENT_ID"].ToString();
                agentNameDDL.DataBind();
                agentNameDDL.Enabled            = false;
                sellingAgentCodeTextBox.Text    = dtRegInfo.Rows[0]["SELLING_AGENT_ID"].ToString();
                sellingAgentCodeTextBox.Enabled = false;
            }
            else
            {
                sellingAgentCodeTextBox.Enabled = true;
                sellingAgentCodeTextBox.Text    = "";

                agentNameDDL.Enabled        = true;
                agentNameDDL.DataSource     = unitSaleBLObj.dtSellingAgentInfoforDDL();
                agentNameDDL.DataTextField  = "NAME";
                agentNameDDL.DataValueField = "ID";
                agentNameDDL.SelectedValue  = "0";
                agentNameDDL.DataBind();
            }
        }
        else
        {
            regNoTextBox.Text    = "";
            holderBOTextBox.Text = "";
            NameTextBox.Text     = "";
            addressTextBox.Text  = "";
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Popup", "alert ('Invalid Registration Number OR BO ');", true);
        }
    }