public void DataBindList()
 {
     B_Model bll1 = new B_Model();
     int ModelID = DataConverter.CLng(this.ViewState["ModelID"].ToString());
     M_ModelInfo modeli = bll1.GetModelById(ModelID);
     this.LModelName.Text = modeli.ModelName;
     this.TxtTemplate.Text = modeli.ContentModule;
     this.RepSystemModel.DataSource = bll.GetSysUserField();
     this.RepSystemModel.DataBind();
     this.RepModelField.DataSource = bll.GetModelFieldList(ModelID);
     this.RepModelField.DataBind();
 }
Exemple #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(base.Request.QueryString["ItemID"]))
     {
         int ItemID = DataConverter.CLng(base.Request.QueryString["ItemID"]);
         B_Content bcontent = new B_Content();
         B_Model bmode = new B_Model();
         B_Node bnode = new B_Node();
         M_CommonData ItemInfo = bcontent.GetCommonData(ItemID);
         if(ItemInfo.IsNull)
             Response.Write("[产生错误的可能原因:您访问的内容信息不存在!]");
         M_ModelInfo modelinfo = bmode.GetModelById(ItemInfo.ModelID);
         string TempNode = bnode.GetModelTemplate(ItemInfo.NodeID, ItemInfo.ModelID);
         string TempContent = ItemInfo.Template;
         string TemplateDir = modelinfo.ContentModule;
         if (!string.IsNullOrEmpty(TempContent))
             TemplateDir = TempContent;
         else
         {
             if (!string.IsNullOrEmpty(TempNode))
                 TemplateDir = TempNode;
         }
         if (string.IsNullOrEmpty(TemplateDir))
         {
             Response.Write("[产生错误的可能原因:该内容所属模型未指定模板!]");
         }
         else
         {
             TemplateDir = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + TemplateDir;
             TemplateDir = TemplateDir.Replace("/", @"\");
             string ContentHtml = this.bll.CreateHtml(FileSystemObject.ReadFile(TemplateDir), 0, ItemID);
             Response.Write(ContentHtml);
         }
     }
     else
     {
         Response.Write("[产生错误的可能原因:您访问的内容信息不存在!]");
     }
 }
Exemple #3
0
 protected void Repeater1_ItemCommand(object sender, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "UpMove")
     {
         int Id = DataConverter.CLng(e.CommandArgument);
         M_ModelField Fieldinfo = this.bll.GetModelByID(Id);
         if (Fieldinfo.OrderID != this.bll.GetMinOrder(Fieldinfo.ModelID))
         {
             M_ModelField FieldPre = this.bll.GetPreField(Fieldinfo.ModelID, Fieldinfo.OrderID);
             int CurrOrder = Fieldinfo.OrderID;
             Fieldinfo.OrderID = FieldPre.OrderID;
             FieldPre.OrderID = CurrOrder;
             this.bll.UpdateOrder(Fieldinfo);
             this.bll.UpdateOrder(FieldPre);
         }
     }
     if (e.CommandName == "DownMove")
     {
         int Id = DataConverter.CLng(e.CommandArgument);
         M_ModelField Fieldinfo = this.bll.GetModelByID(Id);
         if (Fieldinfo.OrderID != this.bll.GetMaxOrder(Fieldinfo.ModelID))
         {
             M_ModelField FieldPre = this.bll.GetNextField(Fieldinfo.ModelID, Fieldinfo.OrderID);
             int CurrOrder = Fieldinfo.OrderID;
             Fieldinfo.OrderID = FieldPre.OrderID;
             FieldPre.OrderID = CurrOrder;
             this.bll.UpdateOrder(Fieldinfo);
             this.bll.UpdateOrder(FieldPre);
         }
     }
     if (e.CommandName == "Delete")
     {
         int Id = DataConverter.CLng(e.CommandArgument);
         int ModelID;
         ModelID = DataConverter.CLng(this.ViewState["ModelID"].ToString());
         B_Model bll1 = new B_Model();
         string tablename = bll1.GetModelById(ModelID).TableName;
         M_ModelField fieldinfo = this.bll.GetModelByID(Id);
         if (fieldinfo.FieldType == "PicType" || fieldinfo.FieldType == "FileType")
         {
             string[] Setting = fieldinfo.Content.Split(new char[] { ',' });
             bool chk = DataConverter.CBool(Setting[0].Split(new char[] { '=' })[1]);
             string fieldname = Setting[1].Split(new char[] { '=' })[1];
             if (chk && fieldname != "")
             {
                 this.bll.DelSubField(tablename, fieldname);
             }
         }
         this.bll.Del(Id, tablename);
     }
     DataBindList();
 }