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); } }
/// <summary> /// 删除 /// </summary> /// <param name="Id">主键Id</param> /// <returns>bool值,判断是否操作成功</returns> public bool Delete(int Id) { return(dal.Delete(Id)); }
public int Delete(int id) { return(dal.Delete(id)); }