protected void getpersoninfo() { SiteGroupCms.Dal.AdminDal admindal = new SiteGroupCms.Dal.AdminDal(); SiteGroupCms.Entity.Admin admin = new SiteGroupCms.Entity.Admin(); SiteGroupCms.Dal.RoleDal roledal = new SiteGroupCms.Dal.RoleDal(); if (id == "0") { admin = admindal.GetEntity(_admin.Id.ToString()); } else { admin = admindal.GetEntity(id); } SiteGroupCms.Entity.Role role = roledal.GetEntity(admin.RoleId); if (admin != null) { _response += "{\"IsError\":false,\"Message\":\"加载成功\",\"Data\":{\"userid\":" + admin.Id + ","; _response += "\"username\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(admin.UserName) + ",\"truename\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(admin.TrueName) + ","; _response += "\"depttitle_val\":\"" + admin.DeptId + "\",\"sextitle_val\":\"" + admin.Sex + "\",\"job\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(admin.Job) + ","; _response += "\"email\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(admin.Email) + ",\"telphone\":\"" + admin.Telphone + "\",\"mobilephone\":\"" + admin.MobilePhone + "\","; _response += "\"sitetitle_val\":\"" + admin.SiteId + "\",\"roletitle_val\":\"" + admin.RoleId + "\",\"rights\":\"" + role.Righttitle + "\","; _response += "\"sort\":" + admin.Sort + ",\"imglist\":\"" + admin.Imgurl + "\",\"imgtitlelist\":\"" + admin.Imgurl + "\""; _response += "}}"; } Response.Write(_response); }
public void updateuser() { SiteGroupCms.Dal.AdminDal admindal = new SiteGroupCms.Dal.AdminDal(); SiteGroupCms.Entity.Admin admin = new SiteGroupCms.Entity.Admin(); if (id == "0") { admin = _admin; } else { admin = admindal.GetEntity(id); } if (password != "") { admin.Password = SiteGroupCms.Utils.MD5.Lower32(password); } admin.TrueName = truename; admin.DeptId = Str2Int(deptid); admin.Sex = sex; admin.Job = job; admin.Email = email; admin.Telphone = telphone; admin.MobilePhone = mobilephone; admin.SiteId = Str2Int(siteid); admin.RoleId = Str2Int(roleid); admin.Imgurl = imglist; admin.Sort = sort; if (admindal.Updates(admin)) { _response = "{\"IsError\":false,\"Message\":\"保存成功\",\"Data\":0}"; new SiteGroupCms.Dal.LogDal().SaveLog(15); } else { _response = "{\"IsError\":true,\"Message\":\"保存失败\",\"Data\":0}"; } }