Пример #1
0
        //
        // GET: /Roles/Edit/5
        public ActionResult Edit(string id)
        {
            TTTV__Roles r = new TTTV__Roles();

            UserLoginModel login = access.getUserLoginById(id);
            UserModel user = access.getUserById(id);
            ViewData["Roles"] = new SelectList(proxy.getAllRoles(), "RoleId", "RoleName", login.roleID);
            AccountWrapper wrap = new AccountWrapper()
            {
                user = user,
                login = login
            };
            return View(wrap);
        }
Пример #2
0
        public ActionResult Edit(AccountWrapper model)
        {
            if (ModelState.IsValid)
            {
                string user = User.Identity.Name.ToString();
                proxy.updateUserInfo(model.user.UserName, model.user.Companyname, model.user.BusinessCode, model.user.Phone, model.user.Mobile, model.user.CMND, model.user.Name, model.user.Age, model.user.Address, model.user.SelectedProvinceValue, model.user.SelectedDistrictValue, model.user.SelectedDetailProvincesValue, model.login.Email, model.login.roleID);
                return RedirectToAction("Index");
            }

            ViewData["Roles"] = new SelectList(proxy.getAllRoles(), "RoleId", "RoleName");
            return View(model);
        }