/// <summary> /// 编辑 /// </summary> /// <param name="context"></param> /// <returns></returns> private string editData(HttpContext context) { ReturnInfo returnInfo = new ReturnInfo(); returnInfo.isSuccess = false; WK.Model.bus_image model = new Model.bus_image(); model.id = int.Parse(context.Request.Params["id"]); model.bus_type = int.Parse(context.Request.Params["bus_type"]); model.correlation_id = int.Parse(context.Request.Params["correlation_id"]); model.img_type = int.Parse(context.Request.Params["correlation_id"]); model.sort = int.Parse(context.Request.Params["sort"]); model.remark = context.Request.Params["remark"]; model.url = context.Request.Params["url"]; WK.BLL.bus_image bll = new WK.BLL.bus_image(); if (model.id > 0) { returnInfo.isSuccess = bll.Update(model); } else { returnInfo.isSuccess = bll.Add(model); } return(Newtonsoft.Json.JsonConvert.SerializeObject(returnInfo)); }
/// <summary> /// 删除 /// </summary> /// <param name="context"></param> /// <returns></returns> private string deleteData(HttpContext context) { ReturnInfo returnInfo = new ReturnInfo(); returnInfo.isSuccess = false; WK.BLL.bus_image bll = new WK.BLL.bus_image(); int id = int.Parse(context.Request.Params["id"]); if (id > 0) { WK.Model.bus_image model = bll.GetModel(id); model.is_delete = 1; returnInfo.isSuccess = bll.Update(model); } return(Newtonsoft.Json.JsonConvert.SerializeObject(returnInfo)); }