protected void DropChanged(object sender, EventArgs e) { DropDownList ddl = (DropDownList)sender; SQLs1.SelectParameters.Remove(SQLs1.SelectParameters[ddl.ID]); SQLs1.SelectParameters.Add(ddl.ID, ddl.SelectedValue); SQLs1.SelectCommand = "spx_PAYOUTTrainerReports"; SQLs1.SelectParameters.Remove(SQLs1.SelectParameters["cols"]); if (webProgram.SelectedValue == "Chipio - Chip Repair") { SQLs1.SelectParameters.Add("cols", "Chipio"); } else { SQLs1.SelectParameters.Add("cols", "All"); } GVs1.DataBind(); getList(); getDDL(); }
protected void TextChanged(object sender, EventArgs e) { TextBox txt = (TextBox)sender; SQLs1.SelectParameters.Remove(SQLs1.SelectParameters[txt.ID]); if (txt.Text == "") { SQLs1.SelectParameters.Add(txt.ID, "All"); } else { SQLs1.SelectParameters.Add(txt.ID, txt.Text); } SQLs1.SelectCommand = "spx_PAYOUTTrainerReports"; GVs1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { try { user = Session["user"].ToString(); userFullname = Session["userFullname"].ToString(); userType = Session["userType"].ToString(); StoreName = Session["g2StoreName"].ToString(); StoreNumber = Session["g2StoreNumber"].ToString(); Program = Session["g2Program"].ToString(); StartDate = Session["g2StartDate"].ToString(); Duration = Session["g2Duration"].ToString(); ReportType = Session["ReportType"].ToString(); Owner = Session["g2Owner"].ToString(); Hub = Session["g2Hub"].ToString(); Location = Session["g2Location"].ToString(); Psid = Session["g2PSID"].ToString(); infoString += "Store: " + StoreName; infoString += " / Progrm: " + Program; infoString += " / Location: #" + StoreNumber + " " + Location; infoString += " / Owner: " + Owner; infoString += " / PS ID #: " + Psid; infoString += " / Hub: " + Hub; info.Text = infoString; } catch { Response.Write("<script>window.top.location = '../';</script>"); } if (!IsPostBack) { SQLs1.SelectParameters.Add("webStartDate", StartDate); SQLs1.SelectParameters.Add("webDuration", Duration); SQLs1.SelectParameters.Add("webProgram", Program); SQLs1.SelectParameters.Add("webStoreNumber", StoreNumber); SQLs1.SelectParameters.Add("webStoreName", StoreName); SQLs1.SelectParameters.Add("webLocation", Location); SQLs1.SelectParameters.Add("webOwner", Owner); SQLs1.SelectParameters.Add("UserType", userType); SQLs2.SelectParameters.Add("webStartDate", StartDate); SQLs2.SelectParameters.Add("webDuration", Duration); SQLs2.SelectParameters.Add("webProgram", Program); SQLs2.SelectParameters.Add("webStoreNumber", StoreNumber); SQLs2.SelectParameters.Add("webStoreName", StoreName); SQLs2.SelectParameters.Add("webLocation", Location); SQLs2.SelectParameters.Add("webOwner", Owner); SQLs2.SelectParameters.Add("UserType", userType); if (Program == "Chipio - Chip Repair") { SQLs2.SelectParameters.Add("gross", "Chipio - Chip Repair"); } else { SQLs2.SelectParameters.Add("gross", "All"); } } SQLs1.SelectCommand = "spx_PAYOUTQty"; SQLs2.SelectCommand = "spx_PAYOUTRev"; GetDatatables(SQLs1, SQLs2); GVs1.DataBind(); GVs2.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { try { user = Session["user"].ToString(); userFullname = Session["userFullname"].ToString(); userType = Session["userType"].ToString(); Session["ReportType"] = "payout"; ReportType = "payout"; } catch { Response.Write("<script>window.top.location = '../';</script>"); } try { string error = Session["Error"].ToString(); errorMsg.Text = error; ClientScript.RegisterStartupScript(this.GetType(), "showError", "<script language='javascript'>$('#loadDiv').addClass('keep'); $('#loadDiv').show(); $('#errorSpan').addClass('keep'); $('#errorSpan').show();</script>"); Session.Remove("Error"); } catch { } email.Visible = false; lblLoc.Visible = true; lblOwner.Visible = true; lblprgm.Visible = true; lblStore.Visible = true; lblStorNum.Visible = true; lblWeekending.Visible = true; webStartDate.Visible = true; webOwner.Visible = true; webStoreName.Visible = true; webProgram.Visible = true; webLocation.Visible = true; webStoreNumber.Visible = true; if (userType == "Admin" || userType == "SC" || userType == "RSM") { SQLtable = "PAYOUTsummary"; where = "WHERE [PAYOUTwe].[Internal] = 1"; } else { SQLtable = "PAYOUTsummaryPosted"; where = "WHERE [PAYOUTwe].[" + userType + "] = 1"; } weSQL.SelectCommand = "SELECT DISTINCT CONVERT(NVARCHAR, CONVERT(DATE, [Week Ending]), 101) AS [WeekEnding], CONVERT(NVARCHAR, DATEADD(DAY, -13, CONVERT(DATE, [Week Ending]))) AS [StartDate], CONVERT(DATE, [WeekEnding]) AS [weDate] FROM [" + SQLtable + "] JOIN [PAYOUTwe] ON CONVERT(DATE, [PAYOUTwe].[WeekEnding]) = CONVERT(DATE, [" + SQLtable + "].[Week Ending]) " + where + " ORDER BY [weDate] DESC"; if (!IsPostBack) { webStartDate.DataBind(); webStartDate.SelectedIndex = 0; if (ReportType == "payout") { try { StoreNumber = Session["StoreNumber"].ToString(); StoreName = Session["StoreName"].ToString(); Program = Session["Program"].ToString(); StartDate = Session["StartDate"].ToString(); Owner = Session["Owner"].ToString(); Location = Session["Location"].ToString(); trainer = Session["trainerid"].ToString(); } catch { StoreNumber = "All"; StoreName = "All"; Program = "All"; Location = "All"; trainer = "0"; StartDate = webStartDate.SelectedValue; } try { if (StoreNumber == "All") { webStoreNumber.Text = ""; } else { webStoreNumber.Text = StoreNumber; } webStoreName.SelectedValue = StoreName; webProgram.SelectedValue = Program; webStartDate.SelectedValue = StartDate; webOwner.SelectedValue = Owner; webLocation.SelectedValue = Location; webTrainer.SelectedValue = trainer; } catch { } if (userType == "Owner") { SQLs1.SelectParameters.Add("webOwner", userFullname); Session["Owner"] = userFullname; } else { try { Owner = Session["Owner"].ToString(); } catch { Owner = "All"; Session["Owner"] = "All"; } SQLs1.SelectParameters.Add("webOwner", Owner); } Session["StoreName"] = StoreName; Session["Program"] = Program; Session["StartDate"] = StartDate; Session["Location"] = Location; Session["Trainer"] = trainer; SQLs1.SelectParameters.Add("webStartDate", StartDate); SQLs1.SelectParameters.Add("webDuration", "14"); SQLs1.SelectParameters.Add("webProgram", Program); SQLs1.SelectParameters.Add("webStoreName", StoreName); SQLs1.SelectParameters.Add("webStoreNumber", StoreNumber); SQLs1.SelectParameters.Add("UserType", userType); SQLs1.SelectParameters.Add("userFullname", userFullname); SQLs1.SelectParameters.Add("webLocation", Location); SQLs1.SelectParameters.Add("webTrainer", trainer); if (Program == "Chipio - Chip Repair") { SQLs1.SelectParameters.Add("cols", "Chipio"); } else { SQLs1.SelectParameters.Add("cols", "All"); } } } SQLs1.SelectCommand = "spx_PAYOUTTrainerReports"; GVs1.DataBind(); getDDL(); getList(); }