Beispiel #1
0
        public ActionResult UserEdit(int UserId)
        {
            string table = "CrmUser";
            string strwhere="UserId="+UserId;
            UserDto userDto = UserBll.GetOneUserDto(table, strwhere);

            UserEditViewModel model = new UserEditViewModel();

            model.UserId = userDto.UserId;
            model.UserPassword = userDto.UserPassword;
            model.UserName = userDto.UserName;
            model.UserSex = userDto.UserSex;
            model.UserBirthday = DateTime.Parse(userDto.UserBirthday.ToString());
            model.UserNumber = userDto.UserNumber;
            model.UserTel = userDto.UserTel;
            model.UserFirstPerson = userDto.UserFirstPerson;
            model.UserFirstPersonTel = userDto.UserFirstPersonTel;
            model.UserJiedaoName = userDto.UserJiedaoName;
            model.UserJuweihuiName = userDto.UserJuweihuiName;
            model.UserHuji = userDto.UserHuji;
            model.UserMinzu = userDto.UserMinzu;
            model.UserWenhua = userDto.UserWenhua;
            model.UserZhiye = userDto.UserZhiye;
            model.UserHunyin = userDto.UserHunyin;
            model.UserDoctor = userDto.UserDoctor;
            model.UserGroup = userDto.UserGroup;
            model.UserClass = userDto.UserClass;
            model.UserNowAddress = userDto.UserNowAddress;
            model.UserOldAddress = userDto.UserOldAddress;
            model.UserJobGroup = userDto.UserJobGroup;
            model.UserDiy1 = userDto.UserDiy1;
            model.UserDiy2 = userDto.UserDiy2;
            model.UserDiy3 = userDto.UserDiy3;
            model.UserDiy4 = userDto.UserDiy4;
            model.UserDiy5 = userDto.UserDiy5;
            model.UserDiy6 = userDto.UserDiy6;
            model.UserBeizhu = userDto.UserBeizhu;

            ViewData["UserSexList"] = UserCommonBll.GetUserInfoForSelect("UserSex");
            ViewData["UserHujiList"] = UserCommonBll.GetUserInfoForSelect("UserHuji");
            ViewData["UserMinzuList"] = UserCommonBll.GetUserInfoForSelect("UserMinzu");
            ViewData["UserZhiyeList"] = UserCommonBll.GetUserInfoForSelect("UserZhiye");
            ViewData["UserHunyinList"] = UserCommonBll.GetUserInfoForSelect("UserHunyin");
            ViewData["UserWenhuaList"] = UserCommonBll.GetUserInfoForSelect("UserWenhua");
            ViewData["UserGroupList"] = GroupBll.GetGroupForSelect();
            ViewData["UserDoctorList"] = DoctorBll.GetDoctorForSelect(int.Parse(System.Web.HttpContext.Current.Request.Cookies["DoctorId"].Value));
            ViewData["UserClass"] = UserClassBll.GetUserClassDtoList("CrmUserClass", "1=1");

            return View(model);
        }
Beispiel #2
0
        public ActionResult UserUpdate(UserEditViewModel model)
        {
            string table = "CrmUser";
            string strwhere = "UserId=" + model.UserId;
            UserDto userDto = UserBll.GetOneUserDto(table,strwhere);
            userDto.UserPassword = model.UserPassword;
            userDto.UserName = model.UserName;
            userDto.UserSex = model.UserSex;
            userDto.UserBirthday = model.UserBirthday;
            userDto.UserNumber = model.UserNumber;
            userDto.UserTel = model.UserTel;
            userDto.UserFirstPerson = model.UserFirstPerson;
            userDto.UserFirstPersonTel = model.UserFirstPersonTel;
            userDto.UserJiedaoName = model.UserJiedaoName;
            userDto.UserJuweihuiName = model.UserJuweihuiName;
            userDto.UserHuji = model.UserHuji;
            userDto.UserMinzu = model.UserMinzu;
            userDto.UserWenhua = model.UserWenhua;
            userDto.UserZhiye = model.UserZhiye;
            userDto.UserHunyin = model.UserHunyin;
            userDto.UserDoctor = model.UserDoctor;
            userDto.UserGroup = model.UserGroup;

            if (String.IsNullOrEmpty(Request.Form["UserClass"]))
            {
                userDto.UserClass = "11";

            }
            else
            {
                userDto.UserClass = Request.Form["UserClass"].ToString();
            }
            userDto.UserNowAddress = model.UserNowAddress;
            userDto.UserOldAddress = model.UserOldAddress;
            userDto.UserJobGroup = model.UserJobGroup;
            if (String.IsNullOrEmpty(Request.Form["UserDiy1"]))
            {
                userDto.UserDiy1 = "无";
            }
            else
            {
                userDto.UserDiy1 = Request.Form["UserDiy1"].ToString();
            }
            if (String.IsNullOrEmpty(Request.Form["UserDiy2"]))
            {
                userDto.UserDiy2 = "无";
            }
            else
            {
                userDto.UserDiy2 = Request.Form["UserDiy2"].ToString();
            }
            if (String.IsNullOrEmpty(Request.Form["UserDiy3"]))
            {
                userDto.UserDiy3 = "无";
            }
            else
            {
                userDto.UserDiy3 = Request.Form["UserDiy3"].ToString();
            }

            userDto.UserDiy4 = model.UserDiy4;
            userDto.UserDiy5 = model.UserDiy5;
            userDto.UserDiy6 = model.UserDiy6;
            userDto.UserBeizhu = model.UserBeizhu;

            UserBll.UpdateUserDto(userDto);

              //  return Redirect("/Health/HealthAdd?userId=" + model.UserId + "&userName="******"UserIndex", "User", new { groupId = 0, userClass = 0, doctorId = System.Web.HttpContext.Current.Request.Cookies["DoctorId"].Value });
        }