using PageAdmin.BLL;
using PageAdmin.Common;using PageAdmin.Utils.ORM;using PageAdmin.Utils;
using System;

namespace PageAdmin.Web.Areas.Admin.Controllers
{
    public class CategoryTableController:DefaultBaseController
    {
        string DeleteTable;
        public CategoryTableController():base("pa_category_table", "System/Table/")
        {
            base.AddExecuted = new Action(OnAdded);
            base.DeleteExecuting = new Action(OnDeleting);
            base.CheckRepeatFieldDic.Add("name", "表名");
        }


        private void OnAdded()
        {
            CategoryTableBLL tableBll = new CategoryTableBLL();
            tableBll.Add(base.MvcContext.DbContext,base.MvcContext.Data);
        }
        private void OnDeleting()
        {
            CategoryTableBLL tableBll = new CategoryTableBLL();
            DeleteTable = tableBll.GetTable(StringHelper.Format<int>(base.MvcContext.Data["id"]));
            MvcContext.TipsInfo=tableBll.Delete(base.MvcContext.DbContext, DeleteTable);
        }
    }
}