Ejemplo n.º 1
0
 public IActionResult SRCalculation(SRCalculation values)
 {
     if (HttpContext.Session.GetString("LoginID") == null)
     {
         return(RedirectToAction("Login", "Users"));
     }
     if (!(HttpContext.Session.GetString("AdminValidity") == "Super Admin"))
     {
         return(RedirectToAction("Login", "Users"));
     }
     if (ModelState.IsValid)
     {
         CentricsContext context = HttpContext.RequestServices.GetService(typeof(Centrics.Models.CentricsContext)) as CentricsContext;
         context.UpdateMSHMultiplier(values);
         TempData["PassFail"] = "Successful edit";
         return(View(values));
     }
     TempData["PassFail"] = "Unsucessful edit";
     return(RedirectToAction("SRCalculation"));
 }