Example #1
0
        private void getsiteinfo()
        {
            SiteGroupCms.Dal.AdminDal admindal = new SiteGroupCms.Dal.AdminDal();
            SiteGroupCms.Entity.Admin admin    = new SiteGroupCms.Entity.Admin();
            SiteGroupCms.Dal.RoleDal  roledal  = new SiteGroupCms.Dal.RoleDal();
            SiteGroupCms.Entity.Site  site     = new SiteGroupCms.Entity.Site();
            SiteGroupCms.Dal.SiteDal  sitedal  = new SiteGroupCms.Dal.SiteDal();
            if (id == "0")//站点id
            {
                site = (SiteGroupCms.Entity.Site)Session["site"];
            }
            else
            {
                site = sitedal.GetEntity(Str2Int(id));
            }

            SiteGroupCms.Entity.Role role = roledal.GetEntity(admin.RoleId);
            if (site != null)
            {
                _response += "{\"IsError\":false,\"Message\":\"加载成功\",\"Data\":{\"siteid\":" + site.ID + ",";
                _response += "\"title\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.Title) + ",\"webtitle\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.WebTitle) + ",\"iswork_val\":\"" + site.IsWork + "\",";
                _response += "\"location\":\"" + site.Location + "\",\"domain\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.Domain) + ",\"keywords\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.Keyword) + ",";
                _response += "\"description\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.Description) + ",\"ftpserver\":\"" + site.FtpServer + "\",\"ftpport\":\"" + site.FtpPort + "\",";
                _response += "\"ftpuser\":\"" + site.FtpUser + "\",\"ftppwd\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.FtpPwd) + ",\"ftpdir\":\"" + site.FtpDir + "\",";
                _response += "\"indextemplate_val\":\"" + site.Indextemplate + "\",\"listtemplate_val\":\"" + site.Listtemplate + "\",\"contenttemplate_val\":\"" + site.Contenttemplate + "\",";
                _response += "\"emailserver\":\"" + site.EmailServer + "\",\"emailuser\":\"" + site.EmailUser + "\",\"emailpwd\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(site.EmailPwd);
                _response += "}}";
            }
            Response.Write(_response);
        }
Example #2
0
        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);
        }
Example #3
0
 public void getroleinfo()
 {
     SiteGroupCms.Dal.RoleDal  roledal  = new SiteGroupCms.Dal.RoleDal();
     SiteGroupCms.Entity.Role  role     = new SiteGroupCms.Entity.Role();
     SiteGroupCms.Dal.RightDal rightdal = new SiteGroupCms.Dal.RightDal();
     SiteGroupCms.Entity.Right right    = new SiteGroupCms.Entity.Right();
     if (id != "0")
     {
         role = roledal.GetEntity(Str2Int(id));
     }
     if (role != null)
     {
         _response += "{\"IsError\":false,\"Message\":\"加载成功\",\"Data\":{\"id\":" + role.Id + ",";
         string[] strs = role.Rights.Split(',');
         for (int i = 0; i < strs.Length - 1; i++)
         {
             _response += "\"q" + strs[i] + "\":true,";
         }
         _response += "\"title\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(role.Title) + ",\"description\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(role.Description);
         _response += "}}";
     }
     Response.Write(_response);
 }