public void Upd_Disable(HttpContext context) { int ret = -1; String jSonString = ""; try { ExtendPropertiesBO aExtendPropertiesBO = new ExtendPropertiesBO(); List<ExtendProperties> listExtendProperties = new List<ExtendProperties>(); string Code = aExtendPropertiesBO.Sel_ByID(int.Parse(context.Request.QueryString["IDExtendProperties"])).Code; //listContents = aContentsBO.Sel_all_ByCode(Code); for (int i = 0; i < listExtendProperties.Count; i++) { listExtendProperties[i].Disable = true; ret = aExtendPropertiesBO.Upd(listExtendProperties[i]); } if (ret != 0) { jSonString = "{\"status\":\"error|" + ret.ToString() + "\"}"; } if (ret == 0) { jSonString = "{\"status\": \"success\"}"; } } catch (Exception ex) { jSonString = "{\"status\":\"error\" ,\"message\":\"" + ex.Message.ToString() + "\"}"; } finally { context.Response.Write(jSonString); } }
public void Sel_ByID(HttpContext context) { String jSonString = ""; int IDExtendProperties = int.Parse(context.Request.QueryString["IDExtendProperties"]); ExtendPropertiesBO aExtendPropertiesBO = new ExtendPropertiesBO(); ExtendProperties obj = aExtendPropertiesBO.Sel_ByID(IDExtendProperties); //obj.Info = HttpUtility.HtmlDecode(obj.Info); //obj.Intro = HttpUtility.HtmlDecode(obj.Intro); if (obj != null) { _converter.DateTimeFormat = "dd/MM/yyyy"; jSonString = JsonConvert.SerializeObject(obj, _converter); } jSonString = "{\"data\":" + jSonString + "}"; context.Response.Write(jSonString); }