protected void GetControlDetails(int scheme, string folio, String SchemeType)
        {
            DataSet ds = new DataSet();
            double  finalamt;
            double  finalunits;

            ds = onlineMforderBo.GetControlDetails(scheme, folio, 1);
            DataTable dt = ds.Tables[0];

            if (SchemeType == "SO")
            {
                if (dt.Rows.Count > -1)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (!string.IsNullOrEmpty(dr["PSLV_LookupValue"].ToString()))
                        {
                            lblDividendType.Text = dr["PSLV_LookupValue"].ToString();
                        }
                        if (!string.IsNullOrEmpty(dr["MinAmt"].ToString()))
                        {
                            lblMintxt.Text = dr["MinAmt"].ToString();
                        }
                        if (!string.IsNullOrEmpty(dr["MultiAmt"].ToString()))
                        {
                            lblMulti.Text = dr["MultiAmt"].ToString();
                        }
                        if (!string.IsNullOrEmpty(dr["CutOffTime"].ToString()))
                        {
                            lbltime.Text = dr["CutOffTime"].ToString();
                        }

                        if (!string.IsNullOrEmpty(dr["divFrequency"].ToString()))
                        {
                            lbldftext.Text = dr["divFrequency"].ToString();
                        }
                        if (!string.IsNullOrEmpty(dr["url"].ToString()))
                        {
                            lnkFactSheet.PostBackUrl = dr["url"].ToString();
                        }
                    }
                    DataSet dsNav = commonLookupBo.GetLatestNav(int.Parse(ddlScheme.SelectedValue));
                    if (dsNav.Tables[0].Rows.Count > 0)
                    {
                        string date = Convert.ToDateTime(dsNav.Tables[0].Rows[0][0]).ToString("dd-MMM-yyyy");
                        lblNavDisplay.Text = dsNav.Tables[0].Rows[0][1] + " " + "As On " + " " + date;
                    }
                    CalculateCurrentholding(ds, out finalunits, out finalamt, dsNav.Tables[0].Rows[0][1].ToString());
                    lblUnitsVale.Text = Math.Round(finalunits, 2).ToString();
                    lblAmtVale.Text   = Math.Round(finalamt, 2).ToString();
                    txtAmtVale.Text   = Math.Round(finalamt, 2).ToString();
                    lblFolioNo.Text   = ddlFolio.SelectedItem.Text;
                }
            }
            else
            {
                if (dt.Rows.Count > -1)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (!string.IsNullOrEmpty(dr["PSLV_LookupValue"].ToString()))
                        {
                            lblDividendType.Text = dr["PSLV_LookupValue"].ToString();
                        }
                        if (!string.IsNullOrEmpty(dr["MinAmt"].ToString()))
                        {
                            lblMinAmntVale.Text = dr["MinAmt"].ToString();
                        }
                        if (!string.IsNullOrEmpty(dr["MultiAmt"].ToString()))
                        {
                            lblSqnAmtVale.Text = dr["MultiAmt"].ToString();
                        }
                        if (!string.IsNullOrEmpty(dr["CutOffTime"].ToString()))
                        {
                            lblCuffTimeVale.Text = dr["CutOffTime"].ToString();
                        }

                        if (!string.IsNullOrEmpty(dr["divFrequency"].ToString()))
                        {
                            lbldftext.Text = dr["divFrequency"].ToString();
                        }
                        if (!string.IsNullOrEmpty(dr["url"].ToString()))
                        {
                            lnkFactSheet.PostBackUrl = dr["url"].ToString();
                        }
                    }
                    DataSet dsNav = commonLookupBo.GetLatestNav(int.Parse(ddlScheme.SelectedValue));
                    if (dsNav.Tables[0].Rows.Count > 0)
                    {
                        string date = Convert.ToDateTime(dsNav.Tables[0].Rows[0][0]).ToString("dd-MMM-yyyy");
                        lblNavVale.Text = dsNav.Tables[0].Rows[0][1] + " " + "As On " + " " + date;
                    }
                }
            }
        }
        //protected void GetControlDetails(int scheme, string folio)
        //{
        //    DataSet ds = new DataSet();

        //    ds = boOnlineOrder.GetControlDetails(scheme, ddlFolio.SelectedValue);
        //    DataTable dt = ds.Tables[0];
        //    if (dt.Rows.Count > -1)
        //    {
        //        foreach (DataRow dr in dt.Rows)
        //        {
        //            if (!string.IsNullOrEmpty(dr["PSLV_LookupValue"].ToString())) lblDividendType.Text = dr["PSLV_LookupValue"].ToString();

        //            if (!string.IsNullOrEmpty(dr["MinAmt"].ToString())) txtMinAmtDisplay.Text = dr["MinAmt"].ToString();

        //            if (!string.IsNullOrEmpty(dr["MultiAmt"].ToString())) lblMutiplesThereAfterDisplay.Text = dr["MultiAmt"].ToString();

        //            if (!string.IsNullOrEmpty(dr["CutOffTime"].ToString())) lblCutOffTimeDisplay.Text = dr["CutOffTime"].ToString();

        //            //if (!string.IsNullOrEmpty(dr["divFrequency"].ToString())) lblFrequency.Text = dr["divFrequency"].ToString();
        //        }
        //    }
        //}

        protected void GetControlDetails(int scheme, string folio)
        {
            DataSet ds = new DataSet();
            double  finalamt;
            double  finalunits;

            ds = boOnlineOrder.GetControlDetails(scheme, folio, 1);
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > -1)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    if (!string.IsNullOrEmpty(dr["PSLV_LookupValue"].ToString()))
                    {
                        lblDividendType.Text = dr["PSLV_LookupValue"].ToString();
                    }


                    if (!string.IsNullOrEmpty(dr["CutOffTime"].ToString()))
                    {
                        lbltime.Text    = dr["CutOffTime"].ToString();
                        lbltime.Visible = true;
                    }

                    if (!string.IsNullOrEmpty(dr["RedeemMinAmt"].ToString()))
                    {
                        lblMinAmountValue.Text    = dr["RedeemMinAmt"].ToString();
                        lblMinAmountValue.Visible = true;
                    }



                    if (!string.IsNullOrEmpty(dr["RedeemMinUnit"].ToString()))
                    {
                        lblMinUnitValue.Text    = dr["RedeemMinUnit"].ToString();
                        lblMinUnitValue.Visible = true;
                    }


                    //if (!string.IsNullOrEmpty(dr["divFrequency"].ToString()))
                    //{
                    //    lbldftext.Text = dr["divFrequency"].ToString();
                    //}
                    if (!string.IsNullOrEmpty(dr["url"].ToString()))
                    {
                        lnkFactSheet.PostBackUrl = dr["url"].ToString();
                    }
                    if (!string.IsNullOrEmpty(dr["PAISC_AssetInstrumentSubCategoryCode"].ToString()) && lblUnitHeldDisplay.Text != null)
                    {
                        subcategory = dr["PAISC_AssetInstrumentSubCategoryCode"].ToString();
                    }
                }
            }
            DataSet dsNav = commonLookupBo.GetLatestNav(scheme);

            if (dsNav.Tables[0].Rows.Count > 0)
            {
                string date = Convert.ToDateTime(dsNav.Tables[0].Rows[0][0]).ToString("dd-MMM-yyyy");
                lblNavDisplay.Text = dsNav.Tables[0].Rows[0][1] + " " + "As On " + " " + date;
            }
            CalculateCurrentholding(ds, out finalunits, out finalamt, dsNav.Tables[0].Rows[0][1].ToString());
            lblUnitHeldDisplay.Text = Math.Round(finalunits, 2).ToString();
            lblUnitHeldDisplay.Text = Math.Round(finalamt, 2).ToString();
            if ((double.Parse(lblUnitHeldDisplay.Text) <= 0) && (subcategory == "MFEQTP"))
            {
                SetControlsState(false);
            }
            else
            {
                SetControlsState(true);
            }
        }
        protected void GetControlDetails(int scheme, string folio)
        {
            DataSet ds = new DataSet();
            double  finalamt;
            double  finalunits;

            ds = onlineMforderBo.GetControlDetails(scheme, folio, exchangeType == "Online" ? 1 : 0);
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > -1)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    if (!string.IsNullOrEmpty(dr["PSLV_LookupValue"].ToString()))
                    {
                        lblDividendType.Text = dr["PSLV_LookupValue"].ToString();
                    }
                    if (!string.IsNullOrEmpty(dr["PSLV_DividendType"].ToString()))
                    {
                        ddlDivType.SelectedValue = dr["PSLV_DividendType"].ToString();
                    }
                    if (!string.IsNullOrEmpty(dr["CutOffTime"].ToString()))
                    {
                        lbltime.Text    = dr["CutOffTime"].ToString();
                        lbltime.Visible = true;
                    }

                    if (!string.IsNullOrEmpty(dr["RedeemMinAmt"].ToString()))
                    {
                        lblMinAmountValue.Text    = dr["RedeemMinAmt"].ToString();
                        lblMinAmountValue.Visible = true;
                    }



                    if (!string.IsNullOrEmpty(dr["RedeemMinUnit"].ToString()))
                    {
                        lblMinUnitValue.Text    = dr["RedeemMinUnit"].ToString();
                        lblMinUnitValue.Visible = true;
                    }


                    if (!string.IsNullOrEmpty(dr["divFrequency"].ToString()))
                    {
                        lbldftext.Text = dr["divFrequency"].ToString();
                    }
                    if (!string.IsNullOrEmpty(dr["url"].ToString()))
                    {
                        lnkFactSheet.PostBackUrl = dr["url"].ToString();
                    }
                    if (!string.IsNullOrEmpty(dr["PAISC_AssetInstrumentSubCategoryCode"].ToString()) && lblUnitsheldDisplay.Text != null)
                    {
                        subcategory = dr["PAISC_AssetInstrumentSubCategoryCode"].ToString();
                    }

                    if (!string.IsNullOrEmpty(dr["AVSD_ExpiryDtae"].ToString()) && Convert.ToDateTime(dr["AVSD_ExpiryDtae"].ToString()) > DateTime.Now && Convert.ToInt16(dr["PMFRD_RatingOverall"].ToString()) > 0)
                    {
                        trSchemeRating.Visible   = true;
                        imgSchemeRating.ImageUrl = @"../Images/MorningStarRating/RatingSmallIcon/" + dr["PMFRD_RatingOverall"].ToString() + ".png";

                        //Rating Overall
                        imgRatingDetails.ImageUrl = @"../Images/MorningStarRating/RatingOverall/" + dr["PMFRD_RatingOverall"].ToString() + ".png";

                        //Rating yearwise
                        imgRating3yr.ImageUrl  = @"../Images/MorningStarRating/RatingSmallIcon/" + dr["PMFRD_Rating3Year"].ToString() + ".png";
                        imgRating5yr.ImageUrl  = @"../Images/MorningStarRating/RatingSmallIcon/" + dr["PMFRD_Rating5Year"].ToString() + ".png";
                        imgRating10yr.ImageUrl = @"../Images/MorningStarRating/RatingSmallIcon/" + dr["PMFRD_Rating10Year"].ToString() + ".png";

                        lblSchemeRetrun3yr.Text  = dr["PMFRD_Return3Year"].ToString();
                        lblSchemeRetrun5yr.Text  = dr["PMFRD_Return5Year"].ToString();
                        lblSchemeRetrun10yr.Text = dr["PMFRD_Return10Year"].ToString();

                        lblSchemeRisk3yr.Text  = dr["PMFRD_Risk3Year"].ToString();
                        lblSchemeRisk5yr.Text  = dr["PMFRD_Risk5Year"].ToString();
                        lblSchemeRisk10yr.Text = dr["PMFRD_Risk10Year"].ToString();
                        if (!string.IsNullOrEmpty(dr["PMFRD_RatingDate"].ToString()))
                        {
                            lblSchemeRatingAsOn.Text = "As On " + Convert.ToDateTime(dr["PMFRD_RatingDate"].ToString()).ToShortDateString();
                            lblRatingAsOnPopUp.Text  = lblSchemeRatingAsOn.Text;
                        }
                    }
                    else
                    {
                        trSchemeRating.Visible      = false;
                        lblSchemeRatingAsOn.Visible = false;
                        imgSchemeRating.ImageUrl    = @"../Images/MorningStarRating/RatingSmallIcon/0.png";
                    }
                }
            }
            if (exchangeType == "Demat")
            {
                ddlRedeem.Items[2].Enabled = false;
            }
            if (ds.Tables[4].Rows.Count > 0)
            {
                ViewState["BseCode"] = ds.Tables[4].Rows[0][0].ToString();
            }
            DataSet dsNav = commonLookupBo.GetLatestNav(scheme);

            if (dsNav.Tables[0].Rows.Count > 0)
            {
                string date = Convert.ToDateTime(dsNav.Tables[0].Rows[0][0]).ToString("dd-MMM-yyyy");
                lblNavDisplay.Text = dsNav.Tables[0].Rows[0][1] + " " + "As On " + " " + date;
            }
            CalculateCurrentholding(ds, out finalunits, out finalamt, dsNav.Tables[0].Rows.Count > 0 ? Convert.ToString(dsNav.Tables[0].Rows[0][1]) : "0");
            lblUnitsheldDisplay.Text    = Math.Round(finalunits, 2).ToString();
            lblCurrentValueDisplay.Text = Math.Round(finalamt, 2).ToString();

            if (subcategory == "MFEQTP")
            {
                ddlRedeem.Items[3].Enabled = false;
            }
            if ((double.Parse(lblUnitsheldDisplay.Text) <= 0) && (subcategory == "MFEQTP"))
            {
                SetControlsState(false);
            }
            else
            {
                SetControlsState(true);
            }
        }
Example #4
0
        protected void GetControlDetails(DataSet ds)
        {
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > -1)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    if (!string.IsNullOrEmpty(dr["PSLV_LookupValue"].ToString()))
                    {
                        lblDividendType.Text = dr["PSLV_LookupValue"].ToString();
                    }
                    if (ddlFolio.SelectedValue != "New" && ddlFolio.SelectedValue != "0" && ddlFolio.SelectedValue != "")
                    {
                        if (!string.IsNullOrEmpty(dr["AdditionalMinAmt"].ToString()))
                        {
                            lblMintxt.Text = dr["AdditionalMinAmt"].ToString();
                        }
                        if (!string.IsNullOrEmpty(dr["AdditionalMultiAmt"].ToString()))
                        {
                            lblMulti.Text = dr["AdditionalMultiAmt"].ToString();
                        }

                        if (lblDividendType.Text == "Growth" & !string.IsNullOrEmpty(schemeDividendOption))
                        {
                            ddlDivType.SelectedValue = schemeDividendOption;
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(dr["MinAmt"].ToString()))
                        {
                            lblMintxt.Text = dr["MinAmt"].ToString();
                        }
                        if (!string.IsNullOrEmpty(dr["MultiAmt"].ToString()))
                        {
                            lblMulti.Text = dr["MultiAmt"].ToString();
                        }
                        DataSet dsNav = commonLookupBo.GetLatestNav(int.Parse(Session["MFSchemePlan"].ToString()));
                        if (dsNav.Tables[0].Rows.Count > 0)
                        {
                            string date = Convert.ToDateTime(dsNav.Tables[0].Rows[0][0]).ToString("dd-MMM-yyyy");
                            lblNavDisplay.Text = dsNav.Tables[0].Rows[0][1] + " " + "As On " + " " + date;
                        }
                    }
                    if (!string.IsNullOrEmpty(dr["CutOffTime"].ToString()))
                    {
                        lbltime.Text = dr["CutOffTime"].ToString();
                    }

                    if (!string.IsNullOrEmpty(dr["divFrequency"].ToString()))
                    {
                        lbldftext.Text = dr["divFrequency"].ToString();
                    }
                    if (!string.IsNullOrEmpty(dr["url"].ToString()))
                    {
                        lnkFactSheet.PostBackUrl = dr["url"].ToString();
                    }

                    if (!string.IsNullOrEmpty(dr["AVSD_ExpiryDtae"].ToString()) && Convert.ToDateTime(dr["AVSD_ExpiryDtae"].ToString()) > DateTime.Now && Convert.ToInt16(dr["PMFRD_RatingOverall"].ToString()) > 0)
                    {
                        imgSchemeRating.ImageUrl = @"../Images/MorningStarRating/RatingSmallIcon/" + dr["PMFRD_RatingOverall"].ToString() + ".png";

                        //Rating Overall
                        //imgRatingDetails.ImageUrl = @"../Images/MorningStarRating/RatingOverall/" + dr["PMFRD_RatingOverall"].ToString() + ".png";

                        ////Rating yearwise
                        //imgRating3yr.ImageUrl = @"../Images/MorningStarRating/RatingSmallIcon/" + dr["PMFRD_Rating3Year"].ToString() + ".png";
                        //imgRating5yr.ImageUrl = @"../Images/MorningStarRating/RatingSmallIcon/" + dr["PMFRD_Rating5Year"].ToString() + ".png";
                        //imgRating10yr.ImageUrl = @"../Images/MorningStarRating/RatingSmallIcon/" + dr["PMFRD_Rating10Year"].ToString() + ".png";

                        //lblSchemeRetrun3yr.Text = dr["PMFRD_Return3Year"].ToString();
                        //lblSchemeRetrun5yr.Text = dr["PMFRD_Return5Year"].ToString();
                        //lblSchemeRetrun10yr.Text = dr["PMFRD_Return10Year"].ToString();

                        //lblSchemeRisk3yr.Text = dr["PMFRD_Risk3Year"].ToString();
                        //lblSchemeRisk5yr.Text = dr["PMFRD_Risk5Year"].ToString();
                        //lblSchemeRisk10yr.Text = dr["PMFRD_Risk10Year"].ToString();

                        if (!string.IsNullOrEmpty(dr["PMFRD_RatingDate"].ToString()))
                        {
                            lblSchemeRatingAsOn.Text = "As On " + Convert.ToDateTime(dr["PMFRD_RatingDate"].ToString()).ToShortDateString();
                            //lblRatingAsOnPopUp.Text = lblSchemeRatingAsOn.Text;
                            lblSchemeRatingAsOn.Visible = true;
                        }
                    }
                    else
                    {
                        //trSchemeRating.Visible = false;
                        lblSchemeRatingAsOn.Visible = false;
                        imgSchemeRating.ImageUrl    = @"../Images/MorningStarRating/RatingSmallIcon/0.png";
                        lblSchemeRatingAsOn.Visible = false;
                    }
                }
            }
            if (ds.Tables[4].Rows.Count > 0)
            {
                lblDemate.Text = ds.Tables[4].Rows[0][0].ToString();
                onlinemforderVo.BSESchemeCode = ds.Tables[4].Rows[0][0].ToString();
            }
            if (ddlFolio.SelectedValue != "New" && ddlFolio.SelectedValue != "0" && ddlFolio.SelectedValue != "")
            {
                if (ds.Tables[1].Rows.Count > 0)
                {
                    DataTable dtUnit = ds.Tables[1];
                    foreach (DataRow drunits in dtUnit.Rows)
                    {
                        if (!string.IsNullOrEmpty(drunits["CMFNP_NetHoldings"].ToString()))
                        {
                            lblUnitsheldDisplay.Text    = drunits["CMFNP_NetHoldings"].ToString();
                            lblUnitsheldDisplay.Visible = true;
                        }
                    }
                }

                //NAV SET----3

                if (ds.Tables[2].Rows.Count > 0)
                {
                    string date = Convert.ToDateTime(ds.Tables[2].Rows[0][0]).ToString("dd-MMM-yyyy");
                    lblNavDisplay.Text = ds.Tables[2].Rows[0][1] + " " + "As On " + " " + date;
                }
            }
        }