public ActionResult RunEOD() { if (logic.isBusinessClosed()) { string result = logic.RunEOD(); return(RedirectToAction("Index", new { message = result })); } return(RedirectToAction("Index", new { message = "Cannot Run EOD" })); }
public ActionResult OpenOrCloseBusiness() { try { if (logic.isBusinessClosed()) { logic.OpenBusiness(); } else { string result = logic.RunEOD(); return(RedirectToAction("Index", new { message = result })); } } catch (Exception) { //ErrorLogger.Log("Message= " + ex.Message + "\nInner Exception= " + ex.InnerException + "\n"); return(PartialView("Error")); } return(RedirectToAction("Index")); }
public ActionResult Close() { var getBusinessConfig = _contextConfig.GetIsOpenTrue(); var businessConfig = _contextConfig.Get(getBusinessConfig.Id); businessConfig.IsOpen = false; var checkConfig = _logic.checkConfig(); if (checkConfig) { var runEod = _eod.RunEOD(); if (runEod == "Success") { businessConfig.FinancialDate.AddDays(1); Session["FinancialDate"] = businessConfig.FinancialDate; _contextConfig.Update(businessConfig); TempData["Message"] = "Business Closed Successfully"; return(RedirectToAction("Index", "Home")); } else { TempData["Error"] = "Error Occured while running EOD"; ViewBag.Status = true; } } else { TempData["Error"] = "A Configuration is not set"; } return(RedirectToAction("Index", "Home")); }