Example #1
0
        public ActionResult EditUser(int id)
        {
            SysPower(SysMenuConstant.MENU_USER_MANAGE, SysMenuConstant.FUN_UPDATE, UserInfo.UserCode);
            var model = ISysUserService.GetById(id);

            if (model == null)
            {
                return(ErrorCustomMsg(ResponseHelper.NONEXISTENT));
            }
            var userinfo = ISysUserService.GetUserInfo(" and  usercode='" + model.Usercode + "'");

            if (userinfo != null)
            {
                ViewBag.Realname       = userinfo.Realname;
                ViewBag.Photo          = userinfo.Photo;
                ViewBag.Political      = userinfo.Political;
                ViewBag.Maritalstatus  = userinfo.Maritalstatus;
                ViewBag.Birthdate      = userinfo.Birthdate;
                ViewBag.Sex            = userinfo.Sex;
                ViewBag.Nation         = userinfo.Nation;
                ViewBag.Placeorigin    = userinfo.Placeorigin;
                ViewBag.Education      = userinfo.Education;
                ViewBag.Telephone      = userinfo.Telephone;
                ViewBag.University     = userinfo.University;
                ViewBag.Specialty      = userinfo.Specialty;
                ViewBag.Presentaddress = userinfo.Presentaddress;
                ViewBag.Email          = userinfo.Email;
                ViewBag.Hobby          = userinfo.Hobby;
                ViewBag.Perspecialty   = userinfo.Perspecialty;
                ViewBag.Comprehensive  = userinfo.Comprehensive;
                ViewBag.Selfevaluation = userinfo.Selfevaluation;
            }
            var orguser = ISysUserService.GetOrgUser(" and usercode='" + model.Usercode + "'");

            if (orguser != null && orguser.Count > 0)
            {
                StringBuilder sborg = new StringBuilder();
                foreach (var item in orguser)
                {
                    sborg.Append(item.Orgcode + ",");
                }
                ViewBag.OrgCode = RequestHelper.RemoveSuffixChar(sborg.ToString());
            }
            var roleuser = ISysUserService.GetRoleUser(" and usercode='" + model.Usercode + "'");

            if (roleuser != null && roleuser.Count > 0)
            {
                StringBuilder sbrole = new StringBuilder();
                foreach (var item in roleuser)
                {
                    sbrole.Append(item.Rolecode + ",");
                }
                ViewBag.RoleCode = RequestHelper.RemoveSuffixChar(sbrole.ToString());
            }

            ViewBag.ZwList = ContainerBuilderHelper.Instance.GetDictionary(" and dictype='ZW' ");
            ViewBag.ZjList = ContainerBuilderHelper.Instance.GetDictionary(" and dictype='ZJ' ");
            return(View(model));
        }