public void Retention() { Cls_BLL_Dashboard objAsPl = new Cls_BLL_Dashboard(); DataTable Tblretention = objAsPl.getRetention(username, Session["DASHOperid"].ToString(), Session["DASHCatid"].ToString()); if (Tblretention.Rows.Count > 0) { DataTable Tblretention1 = new DataTable(); DataTable Tblretention2 = new DataTable(); DataTable Tblretention3 = new DataTable(); Tblretention1 = Tblretention.Clone(); Tblretention2 = Tblretention.Clone(); Tblretention3 = Tblretention.Clone(); for (int i = 0; i < Tblretention.Rows.Count; i++) { if (i < 4) { Tblretention1.ImportRow(Tblretention.Rows[i]); } else if (i < 7) { Tblretention2.ImportRow(Tblretention.Rows[i]); } else { Tblretention3.ImportRow(Tblretention.Rows[i]); } } if (Tblretention1.Rows.Count > 0) { lblCurrentStb.Text = Tblretention1.Rows[0]["col1"].ToString(); lblLastSTB.Text = Tblretention1.Rows[0]["col2"].ToString(); lblLastAchievement.Text = Tblretention1.Rows[0]["col3"].ToString(); lblTotExpiry.Text = Tblretention1.Rows[1]["col1"].ToString(); lblLastReduction.Text = Tblretention1.Rows[1]["col2"].ToString(); lblRenewlMTD.Text = Tblretention1.Rows[2]["col1"].ToString(); lblLastExpiry.Text = Tblretention1.Rows[2]["col2"].ToString(); lblMTDAchieved.Text = Tblretention1.Rows[3]["col1"].ToString() + "%"; lblLastRenewal.Text = Tblretention1.Rows[3]["col2"].ToString(); } grdretention1.DataSource = Tblretention2; grdretention1.DataBind(); grdretention2.Columns[1].FooterText = Tblretention3.AsEnumerable().Select(x => x.Field <decimal>("col1")).Sum().ToString(); grdretention2.Columns[2].FooterText = Tblretention3.AsEnumerable().Select(x => x.Field <decimal>("col2")).Sum().ToString(); grdretention2.Columns[3].FooterText = Tblretention3.AsEnumerable().Select(x => x.Field <decimal>("col3")).Sum().ToString(); grdretention2.Columns[4].FooterText = Tblretention3.AsEnumerable().Select(x => x.Field <decimal>("col4")).Sum().ToString(); grdretention2.Columns[5].FooterText = Tblretention3.AsEnumerable().Select(x => x.Field <decimal>("col5")).Sum().ToString(); grdretention2.Columns[6].FooterText = Tblretention3.AsEnumerable().Select(x => x.Field <decimal>("col6")).Sum().ToString(); grdretention2.DataSource = Tblretention3; grdretention2.DataBind(); } }
public void Subscriber() { Cls_BLL_Dashboard objAsPl = new Cls_BLL_Dashboard(); DataTable Tbloverview = objAsPl.GetSubscriber(Session["DASHOperid"].ToString(), Session["DASHCatid"].ToString()); DataTable TblSubscriber = new DataTable(); DataTable TblSubscriber1 = new DataTable(); DataTable TblSubscriber2 = new DataTable(); DataTable TblSubscriber3 = new DataTable(); DataTable TblSubscriber4 = new DataTable(); if (Tbloverview.Rows.Count > 0) { TblSubscriber = Tbloverview.Clone(); TblSubscriber1 = Tbloverview.Clone(); TblSubscriber2 = Tbloverview.Clone(); TblSubscriber3 = Tbloverview.Clone(); TblSubscriber4 = Tbloverview.Clone(); for (int i = 0; i < Tbloverview.Rows.Count; i++) { if (i < 5) { TblSubscriber.ImportRow(Tbloverview.Rows[i]); } //else if (i < 8) //{ // TblSubscriber1.ImportRow(Tbloverview.Rows[i]); //} else if (i < 9) { TblSubscriber2.ImportRow(Tbloverview.Rows[i]); } else { TblSubscriber4.ImportRow(Tbloverview.Rows[i]); } } grdsubscriberBase.DataSource = TblSubscriber; grdsubscriberBase.DataBind(); // grdsubscriberBase1.DataSource = TblSubscriber1; // grdsubscriberBase1.DataBind(); grdsubscriberBase2.DataSource = TblSubscriber2; grdsubscriberBase2.DataBind(); // grdsubscriberBase3.DataSource = TblSubscriber3; // grdsubscriberBase3.DataBind(); //grdsubscriberBase4.DataSource = TblSubscriber4; //grdsubscriberBase4.DataBind(); } }
public void Overview() { Cls_BLL_Dashboard objAsPl = new Cls_BLL_Dashboard(); DataTable Tbloverview = objAsPl.getOverVIew(username, Session["DASHOperid"].ToString(), Session["DASHCatid"].ToString()); if (Tbloverview.Rows.Count > 0) { DataTable tblovereiw1 = new DataTable(); DataTable tblovereiw2 = new DataTable(); tblovereiw1 = Tbloverview.Clone(); tblovereiw2 = Tbloverview.Clone(); DataTable tblovereiw3 = new DataTable(); tblovereiw3 = Tbloverview.Clone(); for (int i = 0; i < Tbloverview.Rows.Count; i++) { if (i < 6) { tblovereiw1.ImportRow(Tbloverview.Rows[i]); //if (i == 5) //{ // tblovereiw1.Rows.Add("","",0,0,0,0); //} } else if (i < 9) { tblovereiw3.ImportRow(Tbloverview.Rows[i]); } else { tblovereiw2.ImportRow(Tbloverview.Rows[i]); } } grdoverView.DataSource = tblovereiw1; grdoverView.DataBind(); grdbase1.DataSource = tblovereiw3; grdbase1.DataBind(); //grdOverview2.DataSource = tblovereiw2; //grdOverview2.DataBind(); } }
public void bindChart() { //DataTable dt = new DataTable(); //Cls_Helper ob = new Cls_Helper(); //dt = ob.GetDataTable(_query); DataTable TblChart = new DataTable(); TblChart.Columns.Add("title", typeof(string)); TblChart.Columns.Add("value", typeof(String)); Cls_BLL_Dashboard objAsPl = new Cls_BLL_Dashboard(); DataTable dt = objAsPl.getChart(username, Session["DASHOperid"].ToString(), Session["DASHCatid"].ToString()); int Percentvalue = 0; foreach (DataRow dr in dt.Rows) { if (dr["col1"].ToString() != "0") { Percentvalue += Convert.ToInt32(dr["col1"].ToString()); } } foreach (DataRow dr in dt.Rows) { if (dr["col1"].ToString() != "0") { int val = Convert.ToInt32(dr["col1"].ToString()); Double percent = (Double)val / Percentvalue; int finalper = (int)Math.Round((double)(100 * val) / Percentvalue); TblChart.Rows.Add(dr["title"].ToString() + " : " + Convert.ToInt32(dr["col1"].ToString()).ToString() + "(" + finalper + "%)", Convert.ToInt32(dr["col1"].ToString())); } } Chart1.DataSource = TblChart; Chart1.DataBind(); Chart1.Series[0].ChartType = SeriesChartType.Pie; // for pie chart Chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true; // for pie chart // Chart1.Legends[0].Enabled = true;// for pie chart }
public void Expiry() { Cls_BLL_Dashboard objAsPl = new Cls_BLL_Dashboard(); DataTable Tblexpiry = objAsPl.getExpiry(username, Session["DASHOperid"].ToString(), Session["DASHCatid"].ToString()); //DataTable TblExpiry1 = new DataTable(); //DataTable TblExpiry2 = new DataTable(); if (Tblexpiry.Rows.Count > 0) { //TblExpiry1 = Tblexpiry.Clone(); //TblExpiry2 = Tblexpiry.Clone(); //Double col1 = 0, col2 = 0, col3 = 0, col4 = 0, col5 = 0, col6 = 0, col7 = 0, col8 = 0, col9 = 0, col10 = 0, // col11 = 0, col12 = 0, col13 = 0, col14 = 0, col15 = 0; //Double coll1 = 0, coll2 = 0, coll3 = 0, coll4 = 0, coll5 = 0, coll6 = 0, coll7 = 0, coll8 = 0, coll9 = 0, // coll10 = 0, coll11 = 0, coll12 = 0, coll13 = 0, coll14 = 0, coll15 = 0; //int k = 0; //for (int i = 0; i < Tblexpiry.Rows.Count; i++) //{ // if (i < 7) // { // col1 += Convert.ToInt32(Tblexpiry.Rows[i]["col1"]); // col2 += Convert.ToInt32(Tblexpiry.Rows[i]["col2"]); // col3 += Convert.ToInt32(Tblexpiry.Rows[i]["col3"]); // col4 += Convert.ToInt32(Tblexpiry.Rows[i]["col4"]); // col5 += Convert.ToInt32(Tblexpiry.Rows[i]["col5"]); // col6 += Convert.ToInt32(Tblexpiry.Rows[i]["col6"]); // col7 += Convert.ToInt32(Tblexpiry.Rows[i]["col7"]); // col8 += Convert.ToInt32(Tblexpiry.Rows[i]["col8"]); // col9 += Convert.ToInt32(Tblexpiry.Rows[i]["col9"]); // col10 += Convert.ToInt32(Tblexpiry.Rows[i]["col10"]); // col11 += Convert.ToInt32(Tblexpiry.Rows[i]["col11"]); // col12 += Convert.ToInt32(Tblexpiry.Rows[i]["col12"]); // col13 += Convert.ToInt32(Tblexpiry.Rows[i]["col13"]); // col14 += Convert.ToInt32(Tblexpiry.Rows[i]["col14"]); // col15 += Convert.ToInt32(Tblexpiry.Rows[i]["col15"]); // } // else // { // coll1 += Convert.ToDouble(Tblexpiry.Rows[i]["col1"]); // coll2 += Convert.ToDouble(Tblexpiry.Rows[i]["col2"]); // coll3 += Convert.ToDouble(Tblexpiry.Rows[i]["col3"]); // coll4 += Convert.ToDouble(Tblexpiry.Rows[i]["col4"]); // coll5 += Convert.ToDouble(Tblexpiry.Rows[i]["col5"]); // coll6 += Convert.ToDouble(Tblexpiry.Rows[i]["col6"]); // coll7 += Convert.ToDouble(Tblexpiry.Rows[i]["col7"]); // coll8 += Convert.ToDouble(Tblexpiry.Rows[i]["col8"]); // coll9 += Convert.ToDouble(Tblexpiry.Rows[i]["col9"]); // coll10 += Convert.ToDouble(Tblexpiry.Rows[i]["col10"]); // coll11 += Convert.ToDouble(Tblexpiry.Rows[i]["col11"]); // coll12 += Convert.ToDouble(Tblexpiry.Rows[i]["col12"]); // coll13 += Convert.ToDouble(Tblexpiry.Rows[i]["col13"]); // coll14 += Convert.ToDouble(Tblexpiry.Rows[i]["col14"]); // coll15 += Convert.ToDouble(Tblexpiry.Rows[i]["col15"]); // } //} //TblExpiry1.Rows.Add("", "Pack Dispersion", 0, col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11, col12, col13, col14, col15); //for (int i = 0; i < Tblexpiry.Rows.Count; i++) //{ // if (i < 7) // { // TblExpiry1.ImportRow(Tblexpiry.Rows[i]); // } // else // { // if (k == 0) // { // TblExpiry1.Rows.Add("", "Pack Dispersion Value", 0, coll1, coll2, coll3, coll4, coll5, coll6, coll7, coll8, coll9, coll10, coll11, coll12, coll13, coll14, coll15); // } // TblExpiry1.ImportRow(Tblexpiry.Rows[i]); // k++; // } //} grdExpiry.DataSource = Tblexpiry; grdExpiry.DataBind(); //GrdExpiry1.DataSource = TblExpiry2; //GrdExpiry1.DataBind(); } }