private string deleteData(HttpContext context) { ReturnInfo returnInfo = new ReturnInfo(); returnInfo.isSuccess = false; WK.BLL.bus_market bll = new WK.BLL.bus_market(); int id = int.Parse(context.Request.Params["id"]); if (id > 0) { WK.Model.bus_market model = bll.GetModel(id); model.is_delete = 1; returnInfo.isSuccess = bll.Update(model); } return(Newtonsoft.Json.JsonConvert.SerializeObject(returnInfo)); }
private string getDataDetail(HttpContext context) { string id = ""; if (context.Request.Params["id"] != null) { id = context.Request.Params["id"]; } WK.BLL.bus_market bll = new WK.BLL.bus_market(); WK.Model.bus_market model = bll.GetModel(int.Parse(id)); #region 自提点 WK.BLL.bus_pickup_market marketBll = new BLL.bus_pickup_market(); StringBuilder strWhere = new StringBuilder(); strWhere.Append(" is_delete != 1"); strWhere.AppendFormat(" and market_id = {0}", id); DataSet ds = new DataSet(); ds = marketBll.GetList(strWhere.ToString()); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { model.pickup_address_id = int.Parse(ds.Tables[0].Rows[0]["pickup_address_id"].ToString()); } #endregion #region 图片 WK.BLL.bus_image imageBll = new BLL.bus_image(); StringBuilder imageWhere = new StringBuilder(); imageWhere.Append(" is_delete != 1"); imageWhere.AppendFormat(" and correlation_id = {0}", id); imageWhere.AppendFormat(" and bus_type = {0}", 1); DataSet dsImage = new DataSet(); dsImage = imageBll.GetList(imageWhere.ToString()); string imageList = string.Empty; if (dsImage != null && dsImage.Tables.Count > 0 && dsImage.Tables[0].Rows.Count > 0) { int imageCount = dsImage.Tables[0].Rows.Count; for (int i = 0; i < imageCount; i++) { imageList += dsImage.Tables[0].Rows[i]["url"] + "||" + dsImage.Tables[0].Rows[i]["img_type"] + ";"; } } model.imageList = imageList; #endregion return(Newtonsoft.Json.JsonConvert.SerializeObject(model)); }