
using PageAdmin.BLL;
using PageAdmin.Utils;
using PageAdmin.Web.Filter;
using System.Web.Mvc;

namespace PageAdmin.Web.Areas.Admin.Controllers
{
    public class AttachmentsAdminController: DefaultBaseController
    {
        public AttachmentsAdminController() : base("pa_attachments", "Tool")
        {

        }


        [HttpPost]
        [AjaxOnly]
        public override JsonResult Delete(FormCollection form)
        {
            int id = StringHelper.Format<int>(form["id"]);
            AttachmentsBLL attachmentDataBLL = new AttachmentsBLL();
            var tipsInfo=attachmentDataBLL.Drop(id);
            return base.Json(tipsInfo);
        }


        [HttpPost]
        [AjaxOnly]
        public  JsonResult Clear()
        {
            AttachmentsBLL attachmentDataBLL = new AttachmentsBLL();
            var tipsInfo=attachmentDataBLL.Clear();
            tipsInfo.Msg = "请求已经提交，请稍后查看！";
            return base.Json(tipsInfo);
        }

    }
}

