protected void LoadAdminDashBoardDataInCaching()
        {
            double totalEquity = 0;
            double totalMF     = 0;

            ds = assetBo.GetAdviserBranchMF_EQ_In_AggregateCurrentValues(advisorVo.advisorId);
            if (ds.Tables[0].Rows.Count > 0)
            {
                totalEquity = double.Parse(ds.Tables[0].Compute("SUM(EquityAggr)", String.Empty).ToString());

                totalMF = double.Parse(ds.Tables[0].Compute("SUM(MFAggr)", String.Empty).ToString());
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Modified this function to add a new column(No. of customers) to the Branch AUM grid
        /// </summary>
        private void LoadAdminBranchPerformance()
        {
            List <AdvisorBranchVo> branchList      = new List <AdvisorBranchVo>();
            AdvisorBranchBo        advisorBranchBo = new AdvisorBranchBo();

            DataTable dt       = new DataTable();
            DataRow   drResult = null;
            DataRow   dr       = null;
            int       Count    = 0;

            mfTotal = 0;
            total   = 0;
            try
            {
                ds = assetBo.GetAdviserBranchMF_EQ_In_AggregateCurrentValues(advisorVo.advisorId, out Count, mypager.CurrentPage, out total);
                lblTotalRows.Text = hdnRecordCount.Value = Count.ToString();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    lblGT.Visible  = true;
                    lblGTT.Visible = true;


                    dt.Columns.Add("Branch Id");
                    dt.Columns.Add("Branch Name");
                    dt.Columns.Add("Branch Code");
                    //dt.Columns.Add("Equity");
                    dt.Columns.Add("Equity");
                    dt.Columns.Add("MF");
                    dt.Columns.Add("Insurance");
                    dt.Columns.Add("NoOfCustomers");
                    //dt.Columns.Add(new DataColumn("Equity", typeof(decimal)));
                    //dt.Columns.Add(new DataColumn("MF", typeof(decimal)));
                    //dt.Columns.Add(new DataColumn("Insurance", typeof(decimal)));

                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        dr       = dt.NewRow();
                        drResult = ds.Tables[0].Rows[i];
                        dr[0]    = drResult["A_AdviserId"].ToString();
                        dr[1]    = drResult["AB_BranchName"].ToString();
                        dr[2]    = drResult["AB_BranchCode"].ToString();
                        if (Convert.ToDecimal(drResult["EquityAggr"].ToString()) == 0)
                        {
                            dr[3] = "0";
                        }
                        else
                        {
                            dr[3] = decimal.Parse(drResult["EquityAggr"].ToString()).ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));
                        }
                        eqTotal = eqTotal + Convert.ToDecimal(drResult["EquityAggr"].ToString());

                        if (Convert.ToDecimal(drResult["MFAggr"].ToString()) == 0)
                        {
                            dr[4] = "0";
                        }
                        else
                        {
                            dr[4] = decimal.Parse(drResult["MFAggr"].ToString()).ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));
                        }
                        mfTotal = mfTotal + Convert.ToDecimal(drResult["MFAggr"].ToString());

                        if (Convert.ToDecimal(drResult["InsuranceAggr"].ToString()) == 0)
                        {
                            dr[5] = "0";
                        }
                        else
                        {
                            dr[5] = decimal.Parse(drResult["InsuranceAggr"].ToString()).ToString("n2", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));
                        }
                        insuranceTotal = insuranceTotal + Convert.ToDecimal(drResult["InsuranceAggr"].ToString());


                        dr[6]         = drResult["NoOfCustomers"].ToString();
                        customerTotal = customerTotal + Int32.Parse(drResult["NoOfCustomers"].ToString());

                        dt.Rows.Add(dr);
                    }


                    gvrAdminBranchPerform.DataSource = dt;
                    gvrAdminBranchPerform.DataBind();
                    gvrAdminBranchPerform.Visible = true;
                    GetPageCount();
                }
                else
                {
                    lblGT.Visible  = false;
                    lblGTT.Visible = false;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "IFAAdminMainDashboard.ascx:LoadAdminBranchPerformance()");
                object[] objects = new object[3];
                objects[0]   = advisorVo;
                objects[1]   = branchList;
                objects[2]   = ds;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }