protected void Page_Load(object sender, EventArgs e)
    {
        LoginCheck.AdminManage();
        if (!IsPostBack)
        {
            bTable bT     = new bTable();
            string Action = Request.QueryString["Action"];
            if (Action == "del")
            {
                mTable mT = new mTable();
                mT.Id = StringDeal.ToInt(Request.QueryString["Id"]);
                if (bT.GetIsSystem(mT))
                {
                    StringDeal.Alter("此模型为系统模型禁止删除!");
                }
                mT.TableName = bT.GetTableName(mT.Id);
                bT.TableDel(mT);
                HXD.ModelField.BLL.Table bt = new HXD.ModelField.BLL.Table();
                bt.DeleteXml(mT);
            }

            DBList.DataSource = bT.TableList();
            DBList.DataBind();
        }
    }
Esempio n. 2
0
 /// <summary>
 /// 保存模型表
 /// </summary>
 protected void TableSave()
 {
     mT.Title     = this.Title.Text;
     mT.TableName = "tb_" + this.TableName.Text;
     mT.Note      = this.Note.Text;
     mT.Type      = StringDeal.ToInt(this.Type.Text);
     if (mT.Id == 0)
     {
         if (bT.IsTable(mT))
         {
             StringDeal.Alter("此表名已经存在,请更换其他名称!");
         }
         bT.TableInsert(mT);
         HXD.ModelField.BLL.Table bt = new HXD.ModelField.BLL.Table();
         bt.CreateXml(mT);
     }
     else
     {
         bT.TableUpdate(mT);
     }
     Response.Redirect("Table_Manage.aspx", true);
 }