Exemplo n.º 1
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Model.Category category = new Model.Category();
     category.name = Request["categore"].ToString();
     BLL.CategoryBLL categoryBLL = new BLL.CategoryBLL();
     categoryBLL.AddCategory(category);
 }
Exemplo n.º 2
0
 public void del(string id)
 {
     Model.Category category = new Model.Category();
     category.id = id;
     BLL.CategoryBLL categoryBLL = new BLL.CategoryBLL();
     categoryBLL.DelCategory(category);
 }
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     //Model.FormatModel.JsonMsgModel msg = null;
     try
     {
         List<Model.Category> types = new BLL.CategoryBLL().Select();
         //msg = new Model.FormatModel.JsonMsgModel() { Data = types, Msg = "success", Status = 0 };
         string jsonData = Common.ConverterHelper.ObjectToJson(types);
         context.Response.Write(jsonData);
     }
     catch (Exception ex)
     {
         new Common.LogHelper(typeof(SelectNewsTypeHandler)).Error(ex);
         context.Response.Write("Fail");
     }
 }
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     BLL.CategoryBLL helper = new BLL.CategoryBLL();
     //判断Session,验证权限
     if (context.Session["User"] != null)
     {
         int id = -1;
         int.TryParse(context.Request["id"], out id);
         if (id > 0)
         {
             if (helper.Delete(id))
             {
                 context.Response.Write("true");
                 context.Response.End();
             }
         }
         context.Response.Write("false");
     }
     else
     {
         context.Response.Write("no permission!");
     }
 }