public ActionResult Dashboard(StoreManagerDashboardViewModel model)
 {
     Guid Id = model.Id;            
     StoreManager curSM = StoreManagerBUS.GetObject(Id);
     model = SetDashBoardModel(curSM);
     model.IsLocked = StoreManagerBUS.ChangeLocked(Id);
     return View(model);
 }
        public ActionResult Dashboard()
        {
            StoreManagerDashboardViewModel model = new StoreManagerDashboardViewModel();
            // Lấy ID của StoreManager đang đăng nhập
            Guid managerId = new Guid("0999f3dd-88ce-4cf5-9371-702b4058c46a");
            StoreManager curSM = StoreManagerBUS.GetObject(managerId);

            model = SetDashBoardModel(curSM);

            if (curSM.IsLocked == null) curSM.IsLocked = true;
            model.IsLocked = (bool)curSM.IsLocked;
            return View(model);
        }
        private StoreManagerDashboardViewModel SetDashBoardModel(StoreManager curSM)
        {
            StoreManagerDashboardViewModel model = new StoreManagerDashboardViewModel();
            User userInfo = UserBUS.GetObject(curSM.UserId);

            model.Id = curSM.UserId;
            model.Name = userInfo.Username;
            model.Status = StoreManagerStateBUS.GetObject((int)curSM.StatusId).Code; //.GetCode((int)curSM.StatusId);
            model.TotalLastMonthAmount = StoreManagerBUS.GetTotalLastMonthAmount(curSM.UserId);
            model.TotalTransaction = StoreManagerBUS.GetTotalLastMonthTransaction(curSM.UserId);

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