コード例 #1
0
 public ActionResult Dashboard(StoreManagerDashboardViewModel model)
 {
     int Id = model.Id;
     StoreManager curSM = StoreManagerBUS.GetItem(Id);
     model = SetDashBoardModel(curSM);
     model.IsLocked = StoreManagerBUS.ChangeLocked(Id);
     return View(model);
 }
コード例 #2
0
        public ActionResult Dashboard()
        {
            StoreManagerDashboardViewModel model = new StoreManagerDashboardViewModel();
            // Lấy ID của StoreManager đang đăng nhập
            int Id = 0;
            StoreManager curSM = StoreManagerBUS.GetItem(Id);

            model = SetDashBoardModel(curSM);

            if (curSM.IsLocked == null) curSM.IsLocked = true;
            model.IsLocked = (bool)curSM.IsLocked;
            return View(model);
        }
コード例 #3
0
        private StoreManagerDashboardViewModel SetDashBoardModel(StoreManager curSM)
        {
            StoreManagerDashboardViewModel model = new StoreManagerDashboardViewModel();
            model.Id = curSM.Id;
            model.Name = curSM.Name;
            model.Status = StoreManagerStateBUS.GetCode((int)curSM.StatusId);
            model.TotalLastMonthAmount = StoreManagerBUS.GetTotalLastMonthAmount(curSM.Id);
            model.TotalTransaction = StoreManagerBUS.GetTotalLastMonthTransaction(curSM.Id);

            if (curSM.LastCollectDate != null)
            {
                model.LastCollectDate = (DateTime)curSM.LastCollectDate;
            }
            return model;
        }