public ActionResult Information() { StoreManagerInformationViewModel model = new StoreManagerInformationViewModel(); /// TODO: /// Lấy ID của user đang đăng nhập int Id = 1; StoreManager curSM = StoreManagerBUS.GetItem(Id); model = SetInformationModel(curSM); return View(model); }
private StoreManagerInformationViewModel SetInformationModel(StoreManager curSM) { StoreManagerInformationViewModel model = new StoreManagerInformationViewModel(); // Manager Information model.Manager = new ManagerInformation(); model.Manager.Name = curSM.Name; model.Manager.Username = curSM.Username; model.Manager.Password = curSM.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 = curSM.City.Name; model.Manager.Country = curSM.Country; model.Manager.EmailAlert = curSM.EmailAlert; model.Manager.EmailBill = curSM.EmailBill; model.Manager.NameOfCompany = curSM.NameOfCompany; model.Manager.VATNumber = curSM.VATNumber; // List StoreUser Information StoreUser[] arrStoreUser = StoreUserBUS.GetList(curSM.Id); List<UserInformation> lstUser = new List<UserInformation>(); foreach (StoreUser u in arrStoreUser) { UserInformation newUserPhone = new UserInformation(); newUserPhone.Email = u.Email; newUserPhone.LastTransaction = "..."; newUserPhone.Name = u.Name; newUserPhone.Password = u.Password; newUserPhone.Phone = u.Phone; newUserPhone.PINStore = u.PINStore; newUserPhone.Status = u.StoreUserState.Code + " - " + u.StoreUserState.Description; lstUser.Add(newUserPhone); } model.ArrUser = lstUser.ToArray(); return model; }