Exemple #1
0
        public ActionResult RunEOD()
        {
            if (logic.isBusinessClosed())
            {
                string result = logic.RunEOD();
                return(RedirectToAction("Index", new { message = result }));
            }

            return(RedirectToAction("Index", new { message = "Cannot Run EOD" }));
        }
Exemple #2
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"));
 }
Exemple #3
0
        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"));
        }