Esempio n. 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);
        }
 public void updatesite()
 {
     SiteGroupCms.Entity.Site site    = new SiteGroupCms.Entity.Site();
     SiteGroupCms.Dal.SiteDal sitedal = new SiteGroupCms.Dal.SiteDal();
     if (id == "0")//是当前站点
     {
         site.ID = ((SiteGroupCms.Entity.Admin)(Session["admin"])).CurrentSite;
     }
     else
     {
         site.ID = Str2Int(id);
     }
     site.Title       = title;
     site.WebTitle    = webtitle;
     site.Keyword     = keywords;
     site.Description = description;
     // site.Location = location;  //不可修改
     site.Domain          = domain;
     site.IsWork          = Str2Int(iswork);
     site.Indextemplate   = Str2Int(indextemplate);
     site.Listtemplate    = Str2Int(listtemplate);
     site.Contenttemplate = Str2Int(contenttemplate);
     site.EmailServer     = mailserver;
     site.EmailUser       = mailuser;
     site.EmailPwd        = mailpwd;
     site.FtpDir          = ftpdir;
     site.FtpPort         = Str2Int(ftpport);
     site.FtpUser         = ftpuser;
     site.FtpPwd          = ftppwd;
     site.FtpServer       = ftpserver;
     if (sitedal.updatesite(site))
     {
         _response = "{\"IsError\":false,\"Message\":\"修改成功\",\"Data\":0}";
         new SiteGroupCms.Dal.LogDal().SaveLog(20);
         if (id == "0")
         {
             Session["site"] = sitedal.GetEntity(site.ID); //更新session的值
         }
     }
     else
     {
         _response = "{\"IsError\":true,\"Message\":\"修改失败\",\"Data\":0}";
     }
 }