示例#1
0
        public async Task <ActionResult> user_edit(usersModel um)
        {
            int a = Convert.ToInt32(um.user_identity);
            List <roleModel> list1 = await iro.RoleSelect();

            foreach (roleModel item in list1)
            {
                if (item.r_id == a)
                {
                    um.user_identity = item.user_identity;
                }
            }

            if (ModelState.IsValid)
            {
                if (await iub.UserEdit(um) > 0)
                {
                    return(RedirectToAction("user_list"));
                }
                else
                {
                    ViewData.Model = um;
                    return(View(um.User_id));
                }
            }
            else
            {
                ViewData.Model = um;
                return(View(um.User_id));
            }
        }