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

        if (BaseContent.IsSessionExpired())
        {
            Response.Redirect("../Default.aspx");
            return;
        }
        bcContent = (BaseClass)Session["BCContent"];

        userObj.UserID = bcContent.LoginID.ToString();



        if (!IsPostBack)
        {
            fundNameDropDownList.DataSource     = opendMFDAO.dtFundList();
            fundNameDropDownList.DataTextField  = "FUND_NM";
            fundNameDropDownList.DataValueField = "FUND_CD";
            fundNameDropDownList.DataBind();

            refixationDateFromDropDownList.DataSource     = reportObj.dtFillFixationDate(" ");
            refixationDateFromDropDownList.DataTextField  = "NAME";
            refixationDateFromDropDownList.DataValueField = "ID";
            refixationDateFromDropDownList.SelectedValue  = "0";
            refixationDateFromDropDownList.DataBind();

            refixationDateToDropDownList.DataSource     = reportObj.dtFillFixationDate(" ");
            refixationDateToDropDownList.DataTextField  = "NAME";
            refixationDateToDropDownList.DataValueField = "ID";
            refixationDateToDropDownList.SelectedValue  = "0";
            refixationDateToDropDownList.DataBind();

            effectiveDateFromDropDownList.DataSource     = reportObj.dtFillFixationDate(" ");
            effectiveDateFromDropDownList.DataTextField  = "NAME";
            effectiveDateFromDropDownList.DataValueField = "ID";
            effectiveDateFromDropDownList.SelectedValue  = "0";
            effectiveDateFromDropDownList.DataBind();

            effectiveDateToDropDownList.DataSource     = reportObj.dtFillFixationDate(" ");
            effectiveDateToDropDownList.DataTextField  = "NAME";
            effectiveDateToDropDownList.DataValueField = "ID";
            effectiveDateToDropDownList.SelectedValue  = "0";
            effectiveDateToDropDownList.DataBind();


            DataTable dtFundInfoDetails = reportObj.dtFundInfoDetails("   ");
            DataTable dtPriceDetails    = dtPriceDetails = reportObj.dtPriceDetails(" AND FUND_CD='" + dtFundInfoDetails.Rows[0]["FUND_CD"].ToString().ToUpper() + "'  AND REFIX_DT=(SELECT MAX (REFIX_DT) FROM PRICE_REFIX WHERE FUND_CD='" + dtFundInfoDetails.Rows[0]["FUND_CD"].ToString().ToUpper() + "') ");
            for (int looper = 1; looper < dtFundInfoDetails.Rows.Count; looper++)
            {
                DataTable dtprice = reportObj.dtPriceDetails(" AND FUND_CD='" + dtFundInfoDetails.Rows[looper]["FUND_CD"].ToString().ToUpper() + "'  AND REFIX_DT=(SELECT MAX (REFIX_DT) FROM PRICE_REFIX WHERE FUND_CD='" + dtFundInfoDetails.Rows[looper]["FUND_CD"].ToString().ToUpper() + "') ");
                dtPriceDetails.Merge(dtprice);
            }
            dvGridSurrender.Visible          = true;
            SurrenderListGridView.DataSource = dtPriceDetails;
            SurrenderListGridView.DataBind();
        }
    }
예제 #2
0
    protected void findButton_Click(object sender, EventArgs e)
    {
        string[] refixation     = refixationDateTextBox.Text.ToUpper().Split('-');
        string   refixationDate = "01-" + refixation[1].ToUpper();


        DataTable dtFundInfoDetails = unitRepprtObj.dtFundInfoDetails(" AND YEAR_START_MONTH <> '" + refixationDate + "'  ");
        DataTable dtPriceWithNAV    = unitRepprtObj.dtPriceDetails(" ").Clone();


        for (int looper = 0; looper < dtFundInfoDetails.Rows.Count; looper++)
        {
            DataTable dtPriceDetails = unitRepprtObj.dtPriceDetails(" AND FUND_CD='" + dtFundInfoDetails.Rows[looper]["FUND_CD"].ToString().ToUpper() + "'  AND REFIX_DT=(SELECT MAX (REFIX_DT) FROM PRICE_REFIX WHERE FUND_CD='" + dtFundInfoDetails.Rows[looper]["FUND_CD"].ToString().ToUpper() + "') ");
            DataTable dtNAVDetails   = unitRepprtObj.dtPriceDetailsWithNAV(" AND NAVFUNDID=" + Convert.ToInt16(dtFundInfoDetails.Rows[looper]["FUND_CD_INVEST"].ToString().ToUpper()) + "  AND NAVDATE='" + NAVDateTextBox.Text + "' ");

            DataRow drdtPriceWithNAV = dtPriceWithNAV.NewRow();
            if (dtPriceDetails.Rows.Count > 0)
            {
                drdtPriceWithNAV["FUND_CD"]        = dtPriceDetails.Rows[0]["FUND_CD"];
                drdtPriceWithNAV["FUND_NM"]        = dtPriceDetails.Rows[0]["FUND_NM"];
                drdtPriceWithNAV["EFFECTIVE_DATE"] = dtPriceDetails.Rows[0]["EFFECTIVE_DT"];
                drdtPriceWithNAV["REFIX_SL_PR"]    = dtPriceDetails.Rows[0]["REFIX_SL_PR"];
                drdtPriceWithNAV["REFIX_REP_PR"]   = dtPriceDetails.Rows[0]["REFIX_REP_PR"];
            }

            if (dtNAVDetails.Rows.Count > 0)
            {
                drdtPriceWithNAV["NAV_MP"] = dtNAVDetails.Rows[0]["NAV_PU_MP"];
                drdtPriceWithNAV["NAV_CP"] = dtNAVDetails.Rows[0]["NAV_PU_CP"];
            }



            dtPriceWithNAV.Rows.Add(drdtPriceWithNAV);
        }


        if (dtPriceWithNAV.Rows.Count > 0)
        {
            dvGridSurrender.Visible          = true;
            SurrenderListGridView.DataSource = dtPriceWithNAV;
            SurrenderListGridView.DataBind();
        }
        else
        {
            dvGridSurrender.Visible = false;
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Popup", "alert('No Data Found');", true);
        }
    }