public ActionResult Add(int id = 0) { SharedVM.LogPageHit("Bets/Add", User.Identity.Name); var newBet = new BetObj(); newBet.AB = true; newBet.JK = true; newBet.CL = true; newBet.AT = true; newBet.DV = true; newBet.BetDate = DateTime.Today; newBet.GroupBet = "Y"; if (id == 1) { newBet.Sport = "NFL"; } else if (id == 2) { newBet.Sport = "CFB"; } else { newBet.Sport = ""; } GetDataForDropdowns(ref newBet); return(View(newBet)); }
public ActionResult Edit(int id) { SharedVM.LogPageHit("Bets/Edit/" + id, User.Identity.Name); var vm = new BetsVM(dbConn); var thisSite = vm.GetSingleBet(id); return(View(thisSite)); }
public ActionResult Index() { SharedVM.LogPageHit("Bets/Index", User.Identity.Name); var vm = new BetsVM(dbConn); var betsList = vm.GetAllBets(); ViewBag.BetCount = betsList.Count; return(View(betsList)); }
public ActionResult Index() { SharedVM.LogPageHit("Scoreboard/Index", User.Identity.Name); var vm = new ScoreboardVM(); var gamesList = vm.GetNflScores(); //ViewBag.SiteCount = results.Count(); return(View(gamesList)); }
public ActionResult Index() { SharedVM.LogPageHit("Query/Index", User.Identity.Name); var queryObj = new QueryObj() { QuerySql = "" }; return(View(queryObj)); }
public ActionResult Edit(int id) { SharedVM.LogPageHit("Bets/Edit/" + id, User.Identity.Name); var vm = new BetsVM(dbConn); var thisBet = vm.GetSingleBet(id); GetDataForDropdowns(ref thisBet); return(View(thisBet)); }
public ActionResult Scripts() { SharedVM.LogPageHit("Query/Scripts/", User.Identity.Name); var queryObj = new QueryObj() { SavedQueries = LoadSavedQueries() }; var vm = new QueryVM(); return(View(queryObj)); }
public ActionResult Delete(int id) { SharedVM.LogPageHit("Bets/Delete(" + id + ")", User.Identity.Name); var vm = new BetsVM(dbConn); if (id > 0) { vm.DeleteBetItem(id); } return(RedirectToAction("Index")); }
public ActionResult SaveAndNew(BetObj myBet) { SharedVM.LogPageHit("Bets/Edit/Save(" + myBet.BetId + ")", User.Identity.Name); var vm = new BetsVM(dbConn); if (myBet.BetId > 0) { vm.UpdateBetItem(myBet); } return(RedirectToAction("Add")); }
public ActionResult Edit(BetObj myBet) { SharedVM.LogPageHit("Bets/Edit/Save(" + myBet.BetId + ")", User.Identity.Name); var vm = new BetsVM(dbConn); if (myBet.BetId > 0) { vm.UpdateBetItem(myBet); } var thisSite = vm.GetSingleBet(myBet.BetId); return(View(thisSite)); }
public ActionResult Index() { SharedVM.LogPageHit("Scoreboard/Index", User.Identity.Name); var vm = new ScoreboardVM(dbConn); var myBets = vm.GetScoreboardBets(); var includesNflGame = myBets.Any(bet => bet.Sport.ToUpper() == "NFL"); if (includesNflGame) { var nflScores = vm.GetNflScores(); myBets = vm.CreateLiveUpdate(myBets, nflScores); } return(View(myBets)); }
public ActionResult Add(BetObj myBet) { if (ModelState.IsValid) { SharedVM.LogPageHit("Bets/Add/Save (" + myBet.BetId + ")", User.Identity.Name); var vm = new BetsVM(dbConn); vm.AddNewBet(myBet); return(RedirectToAction("Index")); } else { return(View()); } }
public ActionResult Edit(StyleEditPageObj myStyles) { var user = User.Identity.Name; SharedVM.LogPageHit("Elite/Edit/SaveStyles", user); var vm = new StyleVM(); vm.SaveStylesForUser(myStyles.Styles, user); var pageObj = new StyleEditPageObj() { Styles = vm.GetStylesForUser(user, true), DefinedThemes = LoadSavedStyles() }; return(View(pageObj)); }
public ActionResult Scripts(QueryObj queryObj) { int queryId = queryObj.QueryId; SharedVM.LogPageHit("Query/RunSavedQuery/" + queryId, User.Identity.Name); var dt = new DataTable(); var vm = new QueryVM(); queryObj.QuerySql = vm.GetSavedQuerySql(queryId); queryObj.QueryDescription = vm.GetSavedQueryDesc(queryId); try { var sqlResults = vm.ExecuteSql(queryObj); if (sqlResults != null) { BuildTableHeader(sqlResults, false, ref dt); if (sqlResults != null && sqlResults.Any()) { foreach (var dataRow in sqlResults.ToList()) { DataRow row = dt.NewRow(); int rowNum = 0; foreach (var item in dataRow) { row[rowNum] = item.Value; rowNum++; } dt.Rows.Add(row); } } queryObj.ResultsDataTable = dt; } } catch (Exception) { //Should probably do something with this, but for now just swallowing it } queryObj.SavedQueries = LoadSavedQueries(); return(View(queryObj)); }
public ActionResult Edit() { var user = User.Identity.Name; SharedVM.LogPageHit("Style/Edit", user); var styleType = user; if (TempData["TmpStyle"] != null) { styleType = TempData["TmpStyle"].ToString(); } var vm = new StyleVM(); var pageObj = new StyleEditPageObj() { Styles = vm.GetStylesForUser(styleType, true), DefinedThemes = LoadSavedStyles() }; return(View(pageObj)); }