private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { InputMaterialBusiness business = new InputMaterialBusiness(); business.CheckInputMaterialListStartup(); // Auto remove order if delivery date < Today OrderBusiness orderBusiness = new OrderBusiness(); orderBusiness.AutoRemoveWaitingOrder(); }
public ActionResult InputMaterialIndex() { try { if (!MvcApplication.lowQuantityNotifer.CheckConnection()) { MvcApplication.lowQuantityNotifer.Start("BMAChangeDB", "SELECT ProductMaterialId,CurrentQuantity,StandardQuantity FROM dbo.[ProductMaterial] WHERE (CurrentQuantity < StandardQuantity AND IsActive = 'True')"); MvcApplication.lowQuantityNotifer.Change += this.OnChange2; } User staffUser = Session["User"] as User; if (staffUser == null || Session["UserRole"] == null || (int)Session["UserRole"] == 3) { return RedirectToAction("Index", "Home"); } else { ViewBag.Title = "Danh sách nguyên liệu đầu vào"; ViewBag.TreeView = "inputMaterial"; ViewBag.TreeViewMenu = "listInputMaterial"; db = new BMAEntities(); inputMaterialBusiness = new InputMaterialBusiness(); var inputMaterialslList = InputMaterialBusiness.GetInputMaterialList(); if (inputMaterialslList == null) { return RedirectToAction("Index", "StoreInfor"); } return View(inputMaterialslList); } } catch (Exception) { return RedirectToAction("ManageError", "Error"); } }