protected void btnUpdteRec_Click(object sender, EventArgs e) { DataSet ds = new DataSet(); for (int i = 0; i < gvSearch.Rows.Count; i++) { string Id = ((Label)gvSearch.Rows[i].FindControl("grdlbluniqid")).Text.Trim(); string TeamId = HdnTeamId.Value; string AuditDate = HdnServerDate.Value; string PassAdhoc = ((TextBox)gvSearch.Rows[i].FindControl("grdPassAdhoc")).Text.Trim(); string DmlType = "P"; string userid = HndUserId.Value; string dateformat = "dd/mm/yyyy"; string extra1 = "", extra2 = "", extra3 = "", extra4 = "", extra5 = ""; string procedureName = "SpGetAdhocForApproved"; string[] ParameterValueArray = new string[] { Id, TeamId, AuditDate, PassAdhoc, DmlType, userid, dateformat, extra1, extra2, extra3, extra4, extra5 }; if (ConfigurationManager.AppSettings["ConnectionType"].ToString() == "orcl") { ADSTesting.Classes.Oracle.CommonClass obj = new ADSTesting.Classes.Oracle.CommonClass(); ds = obj.DynamicBindProcedure(procedureName, ParameterValueArray); } else { ADSTesting.Classes.Sql.CommonClass obj = new ADSTesting.Classes.Sql.CommonClass(); ds = obj.DynamicBindProcedure(procedureName, ParameterValueArray); } } Response.Write("<script>alert('" + ds.Tables[0].Rows[0]["MSG"].ToString() + "');</script>"); BindGridView(0); }
public static string GetUserPref(string[] ParameterValueArray) { DataSet ds = new DataSet(); string procedureName = "Get_User_Pref"; if (ConfigurationManager.AppSettings["ConnectionType"].ToString() == "Orcl") { ADSTesting.Classes.Oracle.CommonClass obj = new ADSTesting.Classes.Oracle.CommonClass(); ds = obj.DynamicBindProcedure(procedureName, ParameterValueArray); } else { ADSTesting.Classes.Sql.CommonClass obj = new ADSTesting.Classes.Sql.CommonClass(); ds = obj.DynamicBindProcedure(procedureName, ParameterValueArray); } DataTable dt = new DataTable(); dt = ds.Tables[0]; List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >(); System.Collections.Generic.Dictionary <string, object> row = null; foreach (DataRow dr in dt.Rows) { row = new Dictionary <string, object>(); foreach (DataColumn col in dt.Columns) { row.Add(col.ColumnName.Trim(), dr[col]); } rows.Add(row); } System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); return(serializer.Serialize(rows)); }
private void BindGridView(Int32 currentPage) { string Id = ""; string TeamId = HdnTeamId.Value; string AuditDate = HdnServerDate.Value; string PassAdhoc = ""; string DmlType = "S"; string userid = HndUserId.Value; string dateformat = "dd/mm/yyyy"; string extra1 = "", extra2 = "", extra3 = "", extra4 = "", extra5 = ""; DataSet ds = new DataSet(); string procedureName = "SpGetAdhocForApproved"; string[] ParameterValueArray = new string[] { Id, TeamId, AuditDate, PassAdhoc, DmlType, userid, dateformat, extra1, extra2, extra3, extra4, extra5 }; if (ConfigurationManager.AppSettings["ConnectionType"].ToString() == "orcl") { ADSTesting.Classes.Oracle.CommonClass obj = new ADSTesting.Classes.Oracle.CommonClass(); ds = obj.DynamicBindProcedure(procedureName, ParameterValueArray); } else { ADSTesting.Classes.Sql.CommonClass obj = new ADSTesting.Classes.Sql.CommonClass(); ds = obj.DynamicBindProcedure(procedureName, ParameterValueArray); } gvSearch.DataSource = ds; gvSearch.DataBind(); }
public static DataTable SearchTeam(String name, String nick, Int32 startRowIndex, Int32 maximumRows, string sortExpression) { DataSet ds = new DataSet(); string procedureName = "SpSearchTeam"; string[] ParameterValueArray = new string[] { nick, name, startRowIndex.ToString(), maximumRows.ToString(), sortExpression }; if (ConfigurationManager.AppSettings["ConnectionType"].ToString() == "orcl") { ADSTesting.Classes.Oracle.CommonClass obj = new ADSTesting.Classes.Oracle.CommonClass(); ds = obj.DynamicBindProcedure(procedureName, ParameterValueArray); } else { ADSTesting.Classes.Sql.CommonClass obj = new ADSTesting.Classes.Sql.CommonClass(); ds = obj.DynamicBindProcedure(procedureName, ParameterValueArray); } if (ds != null && ds.Tables.Count > 1) { _recordCount = Convert.ToInt16(ds.Tables[1].Rows[0][0]); return(ds.Tables[0]); } return(new DataTable()); }
private void EmployeeDashboard() { string ProcedureName = "GetEmployeeDashboardData"; string TesterEmailID = drpEmployeeName.SelectedValue; string AuditDate = txtdate.Text; string userid = drpEmployeeName.SelectedValue; string dateformat = "dd/mm/yyyy"; string extra1 = "", extra2 = "", extra3 = "", extra4 = "", extra5 = ""; string extra6 = "", extra7 = "", extra8 = "", extra9 = "", extra10 = ""; string[] ParameterValueArray = new string[] { }; ParameterValueArray = new string[] { TesterEmailID, AuditDate, userid, dateformat, extra1, extra2, extra3, extra4, extra5, extra6, extra7, extra8, extra9, extra10 }; if (ConfigurationManager.AppSettings["ConnectionType"].ToString() == "Orcl") { ADSTesting.Classes.Oracle.CommonClass obj = new ADSTesting.Classes.Oracle.CommonClass(); dsmain = obj.DynamicBindProcedure(ProcedureName, ParameterValueArray); } else { ADSTesting.Classes.Sql.CommonClass obj = new ADSTesting.Classes.Sql.CommonClass(); dsmain = obj.DynamicBindProcedure(ProcedureName, ParameterValueArray); } if (dsmain.Tables[0].Rows.Count == 0) { HdnIndividualProductivity.Value = "0" + "%"; divIndividual.InnerHtml = "0" + "%"; } else { HdnIndividualProductivity.Value = dsmain.Tables[0].Rows[0]["IndividualProductivity"].ToString() + "%"; divIndividual.InnerHtml = dsmain.Tables[0].Rows[0]["IndividualProductivity"].ToString() + "%"; } if (dsmain.Tables[1].Rows.Count == 0) { HdnTeamProductivity.Value = "0" + "%"; divTeam.InnerHtml = "0" + "%"; } else { HdnTeamProductivity.Value = dsmain.Tables[1].Rows[0]["TeamProductivity"].ToString() + "%"; divTeam.InnerHtml = dsmain.Tables[1].Rows[0]["TeamProductivity"].ToString() + "%"; } if (dsmain.Tables[2].Rows.Count == 0) { divPendingAdhoc.InnerHtml = "0"; } else { divPendingAdhoc.InnerHtml = dsmain.Tables[2].Rows[0]["PendingforPassing"].ToString(); } }
private void BindTeamName() { drpregisterteamname.Items.Clear(); drpregisterteamname.Items.Add(new System.Web.UI.WebControls.ListItem("-- Select Team Name --", "")); string ProcedureName = "SpGetTeamName"; string[] ParameterValueArray = new string[] { }; ParameterValueArray = new string[] { "", "", "", "", "", "" }; if (ConfigurationManager.AppSettings["ConnectionType"].ToString() == "Orcl") { ADSTesting.Classes.Oracle.CommonClass obj = new ADSTesting.Classes.Oracle.CommonClass(); drpregisterteamname.DataSource = obj.DynamicBindProcedure(ProcedureName, ParameterValueArray); drpregisterteamname.DataBind(); } else { ADSTesting.Classes.Sql.CommonClass obj = new ADSTesting.Classes.Sql.CommonClass(); drpregisterteamname.DataSource = obj.DynamicBindProcedure(ProcedureName, ParameterValueArray); drpregisterteamname.DataBind(); } }
private void BindEmployeeName() { drpEmployeeName.Items.Clear(); drpEmployeeName.Items.Add(new System.Web.UI.WebControls.ListItem("-- Select Employee Name --", "")); string ProcedureName = "SpGetEmployeeName"; string[] ParameterValueArray = new string[] { }; ParameterValueArray = new string[] { Convert.ToString(HttpContext.Current.Session["UserId"]), "", "", "", "", "" }; if (ConfigurationManager.AppSettings["ConnectionType"].ToString() == "Orcl") { ADSTesting.Classes.Oracle.CommonClass obj = new ADSTesting.Classes.Oracle.CommonClass(); drpEmployeeName.DataSource = obj.DynamicBindProcedure(ProcedureName, ParameterValueArray); drpEmployeeName.DataBind(); } else { ADSTesting.Classes.Sql.CommonClass obj = new ADSTesting.Classes.Sql.CommonClass(); drpEmployeeName.DataSource = obj.DynamicBindProcedure(ProcedureName, ParameterValueArray); drpEmployeeName.DataBind(); } }