public static Rom GetRedRomIdByRomName(string romName) { Database db = DatabaseFactory.CreateDatabase("ProfitPlan"); string sqlCommand = "GetRedRomIdByRomName"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "@RomName", DbType.String, romName); db.AddOutParameter(dbCommand, "@RedRomId", DbType.String, 4); db.ExecuteNonQuery(dbCommand); Rom rom = new Rom(); rom.romId = db.GetParameterValue(dbCommand, "RedRomId").ToString(); return(rom); }
public static Rom GetIsSeniorRom(string redRom) { Database db = DatabaseFactory.CreateDatabase("ProfitPlan"); string sqlCommand = "GetIsSeniorRom"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "@RedRom", DbType.String, redRom); db.AddOutParameter(dbCommand, "@IsSeniorRom", DbType.String, 250); db.ExecuteNonQuery(dbCommand); Rom rom = new Rom(); rom.IsSeniorRom = Convert.ToInt32(db.GetParameterValue(dbCommand, "@IsSeniorRom")); return(rom); }
public static Rom GetRomNameByRedRom(string redRom) { Database db = DatabaseFactory.CreateDatabase("ProfitPlan"); string sqlCommand = "GetRomNameByRedRom"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "@RedRom", DbType.String, redRom); db.AddOutParameter(dbCommand, "@RomName", DbType.String, 250); db.ExecuteNonQuery(dbCommand); Rom rom = new Rom(); rom.Description = (db.GetParameterValue(dbCommand, "@RomName")).ToString(); return(rom); }
public static List <Rom> GetRomListByStoreId(int storeId) { List <Rom> list = new List <Rom>(); Database db = DatabaseFactory.CreateDatabase("ProfitPlan"); string sqlCommand = "GetRomListByStoreId"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "@StoreId", DbType.Int32, storeId); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { Rom Rom = new Rom(); Rom.RomId = dataReader["redRomId"].ToString(); Rom.Description = dataReader["RomName"].ToString(); list.Add(Rom); } } return(list); }
protected void ButtonSave_Click(object sender, EventArgs e) { string redRom = Rom.GetRedRomIdByRomName((TextBoxDescription.Text.Length == 0) ? "" : TextBoxDescription.Text).RomId; if (TextBoxDescription.Text.ToUpper() == "EUGENE" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "VD MERWE" && TextBoxPassword.Text == "vdmerwe123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "FANNIN" && TextBoxPassword.Text == "fannin123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "GOOLAB" && TextBoxPassword.Text == "goolab123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "DUNLOP" && TextBoxPassword.Text == "dunlop123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "ALLIE" && TextBoxPassword.Text == "allie123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "TWALA" && TextBoxPassword.Text == "twala123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "BERRY" && TextBoxPassword.Text == "berry123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "PEREIRA" && TextBoxPassword.Text == "pereira123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "PAULS" && TextBoxPassword.Text == "pauls123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "DUBE" && TextBoxPassword.Text == "dube123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "HINSON" && TextBoxPassword.Text == "hinson123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "LOTTER" && TextBoxPassword.Text == "lotter123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "VAN VUUREN" && TextBoxPassword.Text == "vanvuuren123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "MALAN" && TextBoxPassword.Text == "malan123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "VILJOEN" && TextBoxPassword.Text == "viljoen123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "BEHNE" && TextBoxPassword.Text == "behne123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "EVA" && TextBoxPassword.Text == "eva123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "WALE" && TextBoxPassword.Text == "wale123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "ATHANATOS" && TextBoxPassword.Text == "athanatos123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "WYNGAARD" && TextBoxPassword.Text == "wyngaard123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } //else if (TextBoxDescription.Text.ToUpper() == "SIBANDA" && TextBoxPassword.Text == "sibanda123") //{ // Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); //} else if (TextBoxDescription.Text.ToUpper() == "SHABANGU" && TextBoxPassword.Text == "shabangu123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "SVILJOEN" && TextBoxPassword.Text == "sviljoen123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "TSHAKA" && TextBoxPassword.Text == "tshaka123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "BRITS" && TextBoxPassword.Text == "brits123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "HAIMBODI" && TextBoxPassword.Text == "haimbodi123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "OLSEN" && TextBoxPassword.Text == "olsen123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "JONCK" && TextBoxPassword.Text == "jonck123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "VDRHEEDE" && TextBoxPassword.Text == "vdrheede123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "JANKIELSOHN" && TextBoxPassword.Text == "jankielsohn123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "BENSCH" && TextBoxPassword.Text == "bensch123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "TSHOKO" && TextBoxPassword.Text == "tshoko123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "KAUFMAN" && TextBoxPassword.Text == "kaufman123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else if (TextBoxDescription.Text.ToUpper() == "ALEC" && TextBoxPassword.Text == "alec123") { Response.Redirect(String.Format("TargetCaptureList.aspx?RedRom={0}", redRom)); } else { LabelError.Text = "Incorrect User Name/ Password."; PanelError.Visible = true; } }
protected void ButtonSave_Click(object sender, EventArgs e) { string romId = Rom.GetRedRomIdByRomName((TextBoxDescription.Text.Length == 0) ? "" : TextBoxDescription.Text).RomId; if (TextBoxDescription.Text.ToUpper() == "EUGENE" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "VD MERWE" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "FANNIN" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "GOOLAB" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "DUNLOP" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "ALLIE" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "TWALA" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "BERRY" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "PEREIRA" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "PAULS" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "THOMAS" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "HINSON" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "LOTTER" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "VAN VUUREN" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "MALAN" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "VILJOEN" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "BEHNE" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "EVA" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "WALE" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else if (TextBoxDescription.Text.ToUpper() == "HINSON" && TextBoxPassword.Text == "Spar123") { Response.Redirect(String.Format("TargetCapture.aspx?RomId={0}", romId)); } else { LabelError.Text = "Incorrect User Name/ Password."; PanelError.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { redRom = (Request.QueryString["RedRom"] == null) ? "" :(Request.QueryString["RedRom"]); LabelTitle.Text = String.Format("{0} - {1}", "Profit Plan Target Capture List", Rom.GetRomNameByRedRom(redRom).Description); PanelError.Visible = false; PanelSummary.Visible = false; PanelSeniorRom.Visible = false; BindGridViewResult(); if (Rom.GetIsSeniorRom(redRom).IsSeniorRom > 0) { BindGridViewResultSeniorRom(); } }