Example #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            BookType BookType = new BookType();

            int flag = Convert.ToInt32(context.Request["flag"]);

            BookType.ID   = Convert.ToInt32(context.Request["ID"]);
            BookType.Name = context.Request["Name"];
            BookType.Day  = Convert.ToInt32(context.Request["Day"]);

            if (flag == 0)
            {
                DataTable GetBookType = BookTypeDAL.GetBookType();
                string    json        = Common.JsonHelper.DataSetToJson(GetBookType);
                context.Response.Write(json);
            }
            else if (flag == 1)
            {
                int Insert = BookTypeDAL.Insert(BookType);
                context.Response.Write(Insert);
            }
            else if (flag == 2)
            {
                int Update = BookTypeDAL.Update(BookType);
                context.Response.Write(Update);
            }
            else if (flag == 3)
            {
                int Delete = BookTypeDAL.Delete(BookType);
                context.Response.Write(Delete);
            }
        }
Example #2
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="Id">主键Id</param>
 /// <returns>bool值,判断是否操作成功</returns>
 public bool Delete(int Id)
 {
     return(dal.Delete(Id));
 }
Example #3
0
 public int Delete(int id)
 {
     return(dal.Delete(id));
 }