public ActionResult Information() { StoreManagerInformationViewModel model = new StoreManagerInformationViewModel(); /// TODO: // 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 = SetInformationModel(curSM); return View(model); }
private StoreManagerInformationViewModel SetInformationModel(StoreManager curSM) { StoreManagerInformationViewModel model = new StoreManagerInformationViewModel(); User userInfo = UserDAO.GetObject(curSM.UserId); // Manager Information model.Manager = new ManagerInformation(); model.Manager.Name = userInfo.Firstname + " " + userInfo.Lastname; model.Manager.Username = userInfo.Username; model.Manager.Password = userInfo.Password; model.Manager.NameOfStore = curSM.NameOfStore; model.Manager.ManagerPhone = curSM.ManagerPhone; model.Manager.Address = curSM.Address; model.Manager.Address2 = curSM.Address2; model.Manager.Phone = curSM.Phone; model.Manager.Phone2 = curSM.Phone2; //model.Manager.City = AreaBUS.GetObject(curSM.AreaId).Name; //model.Manager.Area = AreaBUS.GetObject((int)curSM.AreaId).Name; model.Manager.Area = "HC1 (tmp)"; model.Manager.Country = curSM.Country; model.Manager.EmailAlert = userInfo.Email; // mail lay thong bao model.Manager.EmailBill = curSM.EmailBill; model.Manager.NameOfCompany = curSM.NameOfCompany; model.Manager.VATNumber = curSM.VATNumber; // List StoreUser Information StoreUser[] arrStoreUser = StoreUserBUS.GetArray(curSM.UserId); List<UserInformation> lstUser = new List<UserInformation>(); foreach (StoreUser store in arrStoreUser) { User storeUserInfo = UserBUS.GetObject(store.UserId); UserInformation newUserPhone = new UserInformation(); newUserPhone.Email = storeUserInfo.Email; newUserPhone.Name = storeUserInfo.Username; newUserPhone.Password = storeUserInfo.Password; newUserPhone.LastTransaction = "..."; newUserPhone.Phone = store.Phone; newUserPhone.PINStore = store.PINStore; //newUserPhone.Status = store.StoreUserState.Code + " - " + store.StoreUserState.Description; StoreUserState storeUserState = StoreUserStateBUS.GetObject((int)store.StatusId); newUserPhone.Status = storeUserState.Code + " - " + storeUserState.Description; lstUser.Add(newUserPhone); } model.ArrUser = lstUser.ToArray(); return model; }