예제 #1
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);
        }
    }