Exemple #1
0
 public void gettemplateinfo()
 {
     SiteGroupCms.Dal.Normal_TemplateDAL templatedal = new SiteGroupCms.Dal.Normal_TemplateDAL();
     SiteGroupCms.Entity.Normal_Template template    = new SiteGroupCms.Entity.Normal_Template();
     if (id != "0")
     {
         template = templatedal.GetEntity(id);
     }
     if (template != null)
     {
         _response += "{\"IsError\":false,\"Message\":\"加载成功\",\"Data\":{\"id\":" + template.Id + ",";
         _response += "\"title\":" + SiteGroupCms.Utils.fastJSON.JSON.WriteString(template.Title) + ",\"type_val\":\"" + template.Type + "\",";
         _response += "\"source\":\"" + template.Source + "\",\"filename\":\"" + template.FileName + "\"";
         _response += "}}";
     }
     Response.Write(_response);
 }
Exemple #2
0
 public void deltemplate()
 {
     SiteGroupCms.Dal.Normal_TemplateDAL templatedal = new SiteGroupCms.Dal.Normal_TemplateDAL();
     SiteGroupCms.Entity.Normal_Template template    = new SiteGroupCms.Entity.Normal_Template();
     string[] idd = ids.Split(',');
     for (int i = 0; i < idd.Length; i++)
     {
         template = templatedal.GetEntity(idd[i]);
         if (SiteGroupCms.Utils.DirFile.FileExists(template.Source))
         {
             SiteGroupCms.Utils.DirFile.DeleteFile(template.Source);
         }
     }
     if (templatedal.DeleteByIDs(ids))
     {
         new SiteGroupCms.Dal.LogDal().SaveLog(12);
         _response += "{\"IsError\":false,\"Message\":\"删除成功\",\"Data\":{\"art\":0}}";
     }
     else
     {
         _response += "{\"IsError\":true,\"Message\":\"删除失败\",\"Data\":{\"art\":0}}";
     }
     Response.Write(_response);
 }
Exemple #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Admin_Load("1", "json");
         if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
         {
             id = Request.QueryString["id"];
             SiteGroupCms.Dal.Normal_TemplateDAL templatedal = new SiteGroupCms.Dal.Normal_TemplateDAL();
             SiteGroupCms.Entity.Normal_Template template    = templatedal.GetEntity(id);
             if (template != null)
             {
                 try
                 {
                     content2.Value = SiteGroupCms.Utils.DirFile.ReadFile(template.Source);
                 }
                 catch (Exception)
                 {
                     content2.Value = "";
                 }
             }
         }
     }
 }