Пример #1
0
 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"));
 }
Пример #2
0
        public ActionResult OpenOrCloseBusiness()
        {
            try
            {
                if (logic.isBusinessClosed())
                {
                    logic.OpenBusiness();
                    return(RedirectToAction("Index", new { message = "Business Opened" }));
                }
                else
                {
                    CloseAllBranches();
                    logic.CloseBusiness();

                    return(RedirectToAction("Index", new { message = "Business Closed" }));
                }
            }
            catch (Exception)
            {
                //ErrorLogger.Log("Message= " + ex.Message + "\nInner Exception= " + ex.InnerException + "\n");
                return(PartialView("Error"));
            }
        }