public IActionResult RatesPost() { IEnumerable <RatesModel> model = ParseResultsForm(Request.Form); SQLData.SetRates(model); return(RedirectToAction("Rates")); }
public IActionResult Index() { IndexViewModel model = new IndexViewModel(); ViewBag.Info1 = SQLData.GetData(1); ViewBag.Info2 = SQLData.GetData(2); ViewBag.Info3 = SQLData.GetData(3); ViewBag.Color1 = ((int)ViewBag.Info1 % 2 == 0 ? "AA0000" : "00AA00"); ViewBag.Color2 = ((int)ViewBag.Info2 % 2 == 0 ? "AA0000" : "00AA00"); ViewBag.Color3 = ((int)ViewBag.Info3 % 2 == 0 ? "AA0000" : "00AA00"); model.SPParameters.Add(String.Empty); model.SPParameters.Add(String.Empty); model.SPParameters.Add(String.Empty); return(View(model)); }
public IActionResult IndexPost(IndexViewModel model) { if (model.Button1 != null) { SQLData.RunProcedure(model.SPParameters[0], 1); } if (model.Button2 != null) { SQLData.RunProcedure(model.SPParameters[1], 2); } if (model.Button3 != null) { SQLData.RunProcedure(model.SPParameters[2], 3); } return(RedirectToAction("Index")); }
public IActionResult Rates() { List <RatesModel> model = SQLData.GetRates(); return(View(model)); }