void bindGridPerformancedata() { try { string qry = "SP_List4AddPerformance " + Session["orgid"].ToString(); MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); ViewState["dt"] = dt; if (dt.Rows.Count > 0) { rptListPer.DataSource = dt; rptListPer.DataBind(); } dt.DefaultView.RowFilter = "LatestPerformance<>''"; if (dt.DefaultView.Count > 0) { LinkButton lnkremove = (LinkButton)rptListPer.Items[dt.DefaultView.Count - 1].FindControl("lnkremove"); lnkremove.Visible = true; } dt.DefaultView.RowFilter = ""; } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { try { // if (!Page.IsPostBack) { string qry = "select top(1) fYear,cur=(select top 1 currency from tblmstOrgInfo where orgid=tblmstemployee.orgid ) from tblmstemployee where orgid=" + Session["orgid"].ToString() + " order by fYear desc "; MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); if (dt.Rows.Count > 0) { lblchart2.Text = dt.Rows[0]["fYear"].ToString(); lblchart3.Text = dt.Rows[0]["fYear"].ToString(); lblchart4.Text = dt.Rows[0]["fYear"].ToString(); // lblchart5.Text = dt.Rows[0]["fYear"].ToString(); lblchart6.Text = dt.Rows[0]["fYear"].ToString(); lblchart7.Text = dt.Rows[0]["fYear"].ToString(); lblchart8.Text = dt.Rows[0]["fYear"].ToString(); lblday.Text = DateTime.Now.Day.ToString(); lblmnth.Text = DateTime.Now.Month.ToString(); lblyear.Text = DateTime.Now.Year.ToString(); if (dt.Rows.Count > 0) { lblcur.Value = dt.Rows[0]["cur"].ToString(); } } } } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { try { if (Session["orgid"] == null) { Response.Redirect("~/Account/Register.aspx", false); } else { string qry = "select top 1 1 from tblmstemployee where orgid=" + Session["orgid"].ToString(); MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); if (dt.Rows != null) { if (dt.Rows.Count > 0) { RPT.Visible = true; if (Session["orglevel"] != null) { if (Session["orglevel"].ToString() == "2") { LiRptLvl2.Visible = true; } } } } //lbluser.Text = User.Identity.Name; } } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { string qry = "SP_GetRptHeadCountDeptWiseLatestYear_level2 " + Session["orgid"].ToString(); MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); dt.DefaultView.RowFilter = "category='Category A'"; grdListA.DataSource = dt; grdListA.DataBind(); dt.DefaultView.RowFilter = ""; dt.DefaultView.RowFilter = "category='Category B'"; grdListB.DataSource = dt; grdListB.DataBind(); dt.DefaultView.RowFilter = ""; dt.DefaultView.RowFilter = "category='Category C'"; grdListC.DataSource = dt; grdListC.DataBind(); //rptlistyr1.DataSource = dt; //rptlistyr1.DataBind(); } } catch (Exception ex) { } }
private void Bindchart() { string qry = "[dbo].SP_GetRptTFPOverAll " + HttpContext.Current.Session["orgid"].ToString() + ""; MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); DataTable ChartData = dt; //storing total rows count to loop on each Record string[] XPointMember = new string[ChartData.Rows.Count]; int[] YPointMember = new int[ChartData.Rows.Count]; for (int count = 0; count < ChartData.Rows.Count; count++) { //storing Values for X axis XPointMember[count] = ChartData.Rows[count]["fyear"].ToString(); //storing values for Y Axis YPointMember[count] = Convert.ToInt32(ChartData.Rows[count]["cnt"]); } //binding chart control Chart1.Series[0].Points.DataBindXY(XPointMember, YPointMember); //Setting width of line Chart1.Series[0].BorderWidth = 10; //setting Chart type Chart1.Series[0].ChartType = SeriesChartType.RangeColumn; //Chart1.Legends(0).Enabled = True; //Hide or show chart back GridLines // Chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false; // Chart1.ChartAreas["ChartArea1"].AxisY.MajorGrid.Enabled = false; //Enabled 3D //Chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true; }
protected void Page_Load(object sender, EventArgs e) { try { // if (!Page.IsPostBack) { string qry = "select top(1) fYear from tblmstemployee where orgid=" + Session["orgid"].ToString() + " order by fYear desc "; MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); if (dt.Rows.Count > 0) { lblchart2.Text = dt.Rows[0]["fYear"].ToString(); lblchart3.Text = dt.Rows[0]["fYear"].ToString(); lblchart4.Text = dt.Rows[0]["fYear"].ToString(); // lblchart5.Text = dt.Rows[0]["fYear"].ToString(); lblchart6.Text = dt.Rows[0]["fYear"].ToString(); lblchart7.Text = dt.Rows[0]["fYear"].ToString(); lblchart8.Text = dt.Rows[0]["fYear"].ToString(); } } } catch (Exception ex) { } }
public static string GetdeptWise(string yr) { JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); string qry = " [dbo].SP_GetOrgoveralltenureDept " + HttpContext.Current.Session["orgid"].ToString() + ",'" + yr + "'"; MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); //List<List<Dictionary<string, object>>> parentRow = new List<List<Dictionary<string, object>>>(); List <Dictionary <string, object> > parentRow = new List <Dictionary <string, object> >(); try { if (dt != null) { if (dt.Rows.Count > 0) { Dictionary <string, object> childRow; ArrayList arrlabel = new ArrayList(); ArrayList arrvalue = new ArrayList(); foreach (DataRow row in dt.Rows) { arrlabel.Add(row["dept"].ToString()); arrvalue.Add(row["cnt"]); } childRow = new Dictionary <string, object>(); childRow.Add("label", arrlabel); childRow.Add("value", arrvalue); parentRow.Add(childRow); //DataTable dtdept = dt.DefaultView.ToTable(true, "dept", "cnt"); //Dictionary<string, object> childRowdept; //ArrayList arrdept = new ArrayList(); //ArrayList arryear = new ArrayList(); //foreach (DataRow row in dtdept.Rows) //{ // childRowdept = new Dictionary<string, object>(); // childRowdept.Add("value", row["cnt"]); // childRowdept.Add("name", row["dept"].ToString()); // //string deptname = row["dept"].ToString(); // //arrdept.Add(row["dept"].ToString()); // //arryear.Add(row["cnt"]); // parentRowdept.Add(childRowdept); //} } } } catch (Exception ec) { } return(jsSerializer.Serialize(parentRow)); }
public static string GetAgeDistdeptWise(string yr) { JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); string qry = "SP_GetRptTFPDeptwise " + HttpContext.Current.Session["orgid"].ToString() + ", '" + yr + "'"; MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); List <List <Dictionary <string, object> > > parentRow = new List <List <Dictionary <string, object> > >(); //List<List<Dictionary<string, object>>> parentRow = new List<List<Dictionary<string, object>>>(); List <Dictionary <string, object> > parentRowSeries = new List <Dictionary <string, object> >(); try { if (dt != null) { if (dt.Rows.Count > 0) { Dictionary <string, object> childRowdept; ArrayList arrdept = new ArrayList(); foreach (DataRow row1 in dt.Rows) { string deptname = row1["dept"].ToString(); childRowdept = new Dictionary <string, object>(); childRowdept.Add("name", deptname); ArrayList arrdata = new ArrayList(); arrdata.Add(row1["cnt"]); childRowdept.Add("data", arrdata); //arryear.Add(row["cnt"]); parentRowSeries.Add(childRowdept); } List <Dictionary <string, object> > parentRowdata = new List <Dictionary <string, object> >(); Dictionary <string, object> childRowdata = new Dictionary <string, object>(); arrdept.Add(yr); childRowdata.Add("cat", arrdept); parentRowdata.Add(childRowdata); parentRow.Add(parentRowSeries); parentRow.Add(parentRowdata); } } } catch (Exception ec) { } return(jsSerializer.Serialize(parentRow)); }
public static string GetSPOCData() { JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); string qry = "SP_GetRptSPOCLatesty_level2 " + HttpContext.Current.Session["orgid"].ToString(); MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); List <List <Dictionary <string, object> > > parentRow = new List <List <Dictionary <string, object> > >(); //List<List<Dictionary<string, object>>> parentRow = new List<List<Dictionary<string, object>>>(); List <Dictionary <string, object> > parentRowSeries = new List <Dictionary <string, object> >(); try { ArrayList arrdept = new ArrayList(); if (dt != null) { if (dt.Rows.Count > 0) { Dictionary <string, object> childRowdept; arrdept.Add("test"); for (int i = 0; i < dt.Rows.Count; i++) { childRowdept = new Dictionary <string, object>(); ArrayList arrdata = new ArrayList(); arrdata.Add(dt.Rows[i]["value"]); childRowdept.Add("name", dt.Rows[i]["name"].ToString()); childRowdept.Add("data", arrdata); parentRowSeries.Add(childRowdept); } //arryear.Add(row["cnt"]); } List <Dictionary <string, object> > parentRowdata = new List <Dictionary <string, object> >(); Dictionary <string, object> childRowdata = new Dictionary <string, object>(); childRowdata.Add("cat", arrdept); parentRowdata.Add(childRowdata); parentRow.Add(parentRowSeries); parentRow.Add(parentRowdata); } } catch (Exception ec) { } return(jsSerializer.Serialize(parentRow)); }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { string qry = "select distinct fYear from tblmstemployee where orgid=" + Session["orgid"].ToString() + " order by fYear "; MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); rptlistyr.DataSource = dt; rptlistyr.DataBind(); rptlistyr1.DataSource = dt; rptlistyr1.DataBind(); } } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { string qry = "Sp_GetTFPInternalEquitybyGender " + Session["orgid"].ToString(); MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); grdList.DataSource = dt; grdList.DataBind(); //rptlistyr1.DataSource = dt; //rptlistyr1.DataBind(); } } catch (Exception ex) { } }
public static string GetGenderDistrByFyear(string yr) { JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); string qry = "SP_GetOrgLatestPerformanceDiversityByFyear " + HttpContext.Current.Session["orgid"].ToString() + ",'" + yr + "'"; MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); List <List <Dictionary <string, object> > > parentRow = new List <List <Dictionary <string, object> > >(); //List<List<Dictionary<string, object>>> parentRow = new List<List<Dictionary<string, object>>>(); List <Dictionary <string, object> > parentRowdept = new List <Dictionary <string, object> >(); try { if (dt != null) { if (dt.Rows.Count > 0) { DataTable dtdept = dt.DefaultView.ToTable(true, "LatestPerformance", "cnt"); Dictionary <string, object> childRowdept; ArrayList arrdept = new ArrayList(); ArrayList arryear = new ArrayList(); foreach (DataRow row in dtdept.Rows) { childRowdept = new Dictionary <string, object>(); childRowdept.Add("value", row["cnt"]); childRowdept.Add("name", row["LatestPerformance"].ToString()); //string deptname = row["dept"].ToString(); //arrdept.Add(row["dept"].ToString()); //arryear.Add(row["cnt"]); parentRowdept.Add(childRowdept); } } } } catch (Exception ec) { } return(jsSerializer.Serialize(parentRowdept)); }
public void EmailPassword_OnClick(object sender, EventArgs args) { MembershipUser user = Membership.GetUser(UsernameTextBox.Text, false); string password; if (user != null) { try { MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); System.Data.DataTable dt = clsESPSql.ExecQuery("select * from aspnet_Users where username= '******' or mobilealias='" + UsernameTextBox.Text + "'"); if (dt.Rows.Count > 0) { EmailPassword(user.Email, dt.Rows[0]["pwd"].ToString()); Msg.Text = "Password sent via email."; } // Attempt to find the user // Unlock them if needed // user.UnlockUser(); // // They exist, so attempt to reset their password // user.ResetPassword(); // // Change the user's password // var newPassword = // // 0 = Number of non alphanumeric characters //Membership.GeneratePassword(Membership.MinRequiredPasswordLength, 0); // password = newPassword; // user.ChangePassword(user.ResetPassword(), newPassword); } catch (Exception e) { Msg.Text = "An exception occurred retrieving your password: "******"User name is not valid. Please check the value and try again."; } }
public static string GetYearwise() { JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); string qry = "[dbo].SP_GetRptattrtionOverAll " + HttpContext.Current.Session["orgid"].ToString() + ""; MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); List <Dictionary <string, object> > parentRow = new List <Dictionary <string, object> >(); try { if (dt != null) { if (dt.Rows.Count > 0) { Dictionary <string, object> childRow; ArrayList arrlabel = new ArrayList(); ArrayList arrvalue = new ArrayList(); foreach (DataRow row in dt.Rows) { arrlabel.Add(row["fYear"].ToString()); arrvalue.Add(row["cnt"]); } childRow = new Dictionary <string, object>(); childRow.Add("label", arrlabel); childRow.Add("value", arrvalue); parentRow.Add(childRow); } } } catch (Exception ec) { } return(jsSerializer.Serialize(parentRow)); }
protected void rptListGrade_ItemCommand(object source, RepeaterCommandEventArgs e) { try { lblmsg1.Text = ""; lblsuccessmsg1.Text = ""; if (e.CommandName == "modify") { bindControlsGrade(e.CommandArgument.ToString()); Page.ClientScript.RegisterStartupScript(GetType(), "popupDesi", "<SCRIPT LANGUAGE='javascript'>javascript:openPopUp('newModal');</script>"); } if (e.CommandName == "remove") { Page.ClientScript.RegisterStartupScript(GetType(), "popupDesi", "<SCRIPT LANGUAGE='javascript'>javascript:openPopUp('newModal');</script>"); string qry = "SELECT TOP 1 1 FROM tblmstgrade where ID=" + e.CommandArgument.ToString() + " and Grade in (select Grade from tblmstEmployee where orgid=tblmstgrade.orgid)"; MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); if (dt != null) { if (dt.Rows.Count > 0) { lblmsg1.Text = "Can not be deleted, Already in use! "; lblmsg1.ForeColor = System.Drawing.Color.Red; return; } } int res = clsESPSql.DeleteSYData(" where ID=" + e.CommandArgument.ToString() + " and Grade not in (select Grade from tblmstEmployee where orgid=tblmstgrade.orgid)", "tblmstgrade"); string strpg = Request.Url.ToString(); lblmsg1.Text = "Deleted Successfuly"; lblmsg1.ForeColor = System.Drawing.Color.Red; bindGridGradedata(); Page.ClientScript.RegisterStartupScript(GetType(), "desiSubmit", "<SCRIPT LANGUAGE='javascript'>javascript:openPopUp('newModal');</script>"); } } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { string qry = "select distinct fYear,cur=(select top 1 currency from tblmstOrgInfo where orgid=tblmstemployee.orgid ) from tblmstemployee where orgid=" + Session["orgid"].ToString() + " order by fYear "; MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); rptlistyr.DataSource = dt; rptlistyr.DataBind(); rptlistyr1.DataSource = dt; rptlistyr1.DataBind(); if (dt.Rows.Count > 0) { lblcur.Text = dt.Rows[0]["cur"].ToString(); } } } catch (Exception ex) { } }
public static string GetgenderDistOrgWise() { JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); string qry = "SP_GetOrgLatestPerformanceDiversity " + HttpContext.Current.Session["orgid"].ToString() + ""; MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); List <List <Dictionary <string, object> > > parentRow = new List <List <Dictionary <string, object> > >(); //List<List<Dictionary<string, object>>> parentRow = new List<List<Dictionary<string, object>>>(); List <Dictionary <string, object> > parentRowSeries = new List <Dictionary <string, object> >(); try { if (dt != null) { if (dt.Rows.Count > 0) { DataTable dtdept = dt.DefaultView.ToTable(true, "fyear"); dt.DefaultView.Sort = "perlevel asc"; DataTable dtgender = dt.DefaultView.ToTable(true, "LatestPerformance"); Dictionary <string, object> childRowdept; ArrayList arrdept = new ArrayList(); Dictionary <string, object> childRow1 = new Dictionary <string, object>(); childRow1.Add("show", true); childRow1.Add("position", "insideRight"); Dictionary <string, object> childRow2 = new Dictionary <string, object>(); childRow2.Add("label", childRow1); Dictionary <string, object> childRow3 = new Dictionary <string, object>(); childRow3.Add("normal", childRow2); //foreach (DataRow row in dtgender.Rows) for (int i = 0; i < dtgender.Rows.Count; i++) { ArrayList arrdata = new ArrayList(); foreach (DataRow row1 in dtdept.Rows) { string deptname = row1["fyear"].ToString(); if (i == 0) { arrdept.Add(deptname); } dt.DefaultView.RowFilter = ""; dt.DefaultView.RowFilter = "fyear='" + deptname + "' and LatestPerformance='" + dtgender.Rows[i]["LatestPerformance"].ToString() + "'"; DataView dv = dt.DefaultView; if (dv.Count > 0) { arrdata.Add(dv[0]["cnt"]); } else { arrdata.Add(0); } } childRowdept = new Dictionary <string, object>(); childRowdept.Add("name", dtgender.Rows[i]["LatestPerformance"].ToString()); childRowdept.Add("type", "bar"); childRowdept.Add("stack", "Stack"); childRowdept.Add("itemStyle", childRow3); childRowdept.Add("data", arrdata); //arryear.Add(row["cnt"]); parentRowSeries.Add(childRowdept); } List <Dictionary <string, object> > parentRowdata = new List <Dictionary <string, object> >(); Dictionary <string, object> childRowdata = new Dictionary <string, object>(); childRowdata.Add("cat", arrdept); parentRowdata.Add(childRowdata); parentRow.Add(parentRowSeries); parentRow.Add(parentRowdata); } } } catch (Exception ec) { } return(jsSerializer.Serialize(parentRow)); }
public static string GetLeveWise() { JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); string qry = " [dbo].SP_GetRptORGPyramid " + HttpContext.Current.Session["orgid"].ToString(); MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); List <List <Dictionary <string, object> > > parentRow = new List <List <Dictionary <string, object> > >(); //List<List<Dictionary<string, object>>> parentRow = new List<List<Dictionary<string, object>>>(); List <Dictionary <string, object> > parentRowSeries = new List <Dictionary <string, object> >(); try { if (dt != null) { if (dt.Rows.Count > 0) { Dictionary <string, object> childRowdept; ArrayList arrdept = new ArrayList(); //foreach (DataRow row in dtage_range.Rows) ArrayList arrdata = new ArrayList(); ArrayList arrdata1 = new ArrayList(); foreach (DataRow row1 in dt.Rows) { string deptname = row1["grade"].ToString(); arrdept.Add(deptname); int i = -Convert.ToInt32(row1["cnt"]); arrdata.Add(row1["cnt"]); arrdata1.Add(i); } Dictionary <string, object> childRow1 = new Dictionary <string, object>(); childRow1.Add("name", "Headcount"); childRow1.Add("data", arrdata); parentRowSeries.Add(childRow1); Dictionary <string, object> childRow2 = new Dictionary <string, object>(); childRow2.Add("name", "Headcount"); childRow2.Add("data", arrdata1); //arryear.Add(row["cnt"]); parentRowSeries.Add(childRow2); List <Dictionary <string, object> > parentRowdata = new List <Dictionary <string, object> >(); Dictionary <string, object> childRowdata = new Dictionary <string, object>(); childRowdata.Add("cat", arrdept); parentRowdata.Add(childRowdata); parentRow.Add(parentRowSeries); parentRow.Add(parentRowdata); } } } catch (Exception ec) { } return(jsSerializer.Serialize(parentRow)); }
public static string GetDistdeptWise(string yr) { JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); List <List <Dictionary <string, object> > > parentRow = new List <List <Dictionary <string, object> > >(); //List<List<Dictionary<string, object>>> parentRow = new List<List<Dictionary<string, object>>>(); List <Dictionary <string, object> > parentRowSeries = new List <Dictionary <string, object> >(); try { string qryorg = "[dbo].SP_GetRptSPOCOverAll " + HttpContext.Current.Session["orgid"].ToString() + ""; MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dtorg = clsESPSql.ExecQuery(qryorg); string qry = "SP_GetRptSPOCDeptwise " + HttpContext.Current.Session["orgid"].ToString() + ", '" + yr + "'"; DataTable dt = clsESPSql.ExecQuery(qry); if (dt != null) { if (dt.Rows.Count > 0) { DataTable dtdept = dt.DefaultView.ToTable(true, "dept"); Dictionary <string, object> childRowdept; ArrayList arrdept = new ArrayList(); Dictionary <string, object> childRow1 = new Dictionary <string, object>(); childRow1.Add("show", true); childRow1.Add("position", "insideRight"); Dictionary <string, object> childRow2 = new Dictionary <string, object>(); childRow2.Add("label", childRow1); Dictionary <string, object> childRow3 = new Dictionary <string, object>(); childRow3.Add("normal", childRow2); dtorg.DefaultView.RowFilter = "fyear='" + yr + "'"; decimal orgavg = Convert.ToDecimal(dtorg.DefaultView[0]["cnt"]); ArrayList arrdata = new ArrayList(); ArrayList arrdataorg = new ArrayList(); foreach (DataRow row1 in dtdept.Rows) { string deptname = row1["dept"].ToString(); arrdept.Add(deptname); dt.DefaultView.RowFilter = ""; dt.DefaultView.RowFilter = "dept='" + deptname + "'"; DataView dv = dt.DefaultView; if (dv.Count > 0) { arrdata.Add(dv[0]["cnt"]); } arrdataorg.Add(orgavg); } childRowdept = new Dictionary <string, object>(); childRowdept.Add("name", "Deparment Avg. SPOC"); childRowdept.Add("type", "column"); childRowdept.Add("data", arrdata); parentRowSeries.Add(childRowdept); childRowdept = new Dictionary <string, object>(); childRowdept.Add("name", "Organizational Average"); childRowdept.Add("type", "line"); childRowdept.Add("data", arrdataorg); parentRowSeries.Add(childRowdept); List <Dictionary <string, object> > parentRowdata = new List <Dictionary <string, object> >(); Dictionary <string, object> childRowdata = new Dictionary <string, object>(); childRowdata.Add("cat", arrdept); parentRowdata.Add(childRowdata); parentRow.Add(parentRowSeries); parentRow.Add(parentRowdata); } } } catch (Exception ec) { } return(jsSerializer.Serialize(parentRow)); }
public static string Getdata() { JavaScriptSerializer jsSerializer = new JavaScriptSerializer(); string qry = "SP_GetTFPCompaRatio " + HttpContext.Current.Session["orgid"].ToString() + ""; MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql(); DataTable dt = clsESPSql.ExecQuery(qry); List <List <Dictionary <string, object> > > parentRow = new List <List <Dictionary <string, object> > >(); //List<List<Dictionary<string, object>>> parentRow = new List<List<Dictionary<string, object>>>(); List <Dictionary <string, object> > parentRowSeries = new List <Dictionary <string, object> >(); try { if (dt != null) { if (dt.Rows.Count > 0) { DataTable dtdept = dt.DefaultView.ToTable(true, "grade"); DataTable dtgender = dt.DefaultView.ToTable(true, "rangeratio"); Dictionary <string, object> childRowdept; ArrayList arrdept = new ArrayList(); //foreach (DataRow row in dtgender.Rows) for (int i = 0; i < dtgender.Rows.Count; i++) { ArrayList arrdata = new ArrayList(); foreach (DataRow row1 in dtdept.Rows) { string deptname = row1["grade"].ToString(); if (i == 0) { arrdept.Add(deptname); } dt.DefaultView.RowFilter = ""; dt.DefaultView.RowFilter = "grade='" + deptname + "' and rangeratio='" + dtgender.Rows[i]["rangeratio"].ToString() + "'"; DataView dv = dt.DefaultView; if (dv.Count > 0) { arrdata.Add(dv[0]["cnt"]); } else { arrdata.Add(0); } } childRowdept = new Dictionary <string, object>(); childRowdept.Add("name", dtgender.Rows[i]["rangeratio"].ToString()); childRowdept.Add("data", arrdata); //arryear.Add(row["cnt"]); parentRowSeries.Add(childRowdept); } List <Dictionary <string, object> > parentRowdata = new List <Dictionary <string, object> >(); Dictionary <string, object> childRowdata = new Dictionary <string, object>(); childRowdata.Add("cat", arrdept); parentRowdata.Add(childRowdata); parentRow.Add(parentRowSeries); parentRow.Add(parentRowdata); } } } catch (Exception ec) { } return(jsSerializer.Serialize(parentRow)); }