public JsonResult EditInfo(Parameter ParameterModle) { ParameterXmlHelper xh = new ParameterXmlHelper(System.Web.HttpContext.Current.Server.MapPath("~/App_Data/")); bool IsAdd = false; // ParameterModle.Value = ParameterModle.Value.Replace("<", "<").Replace(">", ">"); if (!(ParameterModle.Id != null && !ParameterModle.Id.ToString().Equals("00000000-0000-0000-0000-000000000000")))//id为空,是添加 { IsAdd = true; } if (IsAdd) { ParameterModle.Id = Guid.NewGuid(); xh.Add(ParameterModle); return(Json("ok", JsonRequestBehavior.AllowGet)); } else { if (xh.Update(ParameterModle) > 0) { return(Json("ok", JsonRequestBehavior.AllowGet)); } else { return(Json("Nok", JsonRequestBehavior.AllowGet)); } } }
public JsonResult Del(string IDSet) { ParameterXmlHelper xh = new ParameterXmlHelper(System.Web.HttpContext.Current.Server.MapPath("~/App_Data/")); int f = xh.DelBykeys(IDSet); return(Json("OK", JsonRequestBehavior.AllowGet)); }
public JsonResult GetInfo(string ID) { ParameterXmlHelper xh = new ParameterXmlHelper(System.Web.HttpContext.Current.Server.MapPath("~/App_Data/")); Parameter Rmodel = xh.GetItemBykeys(ID); // groupsBiz.Add(rol); return(Json(Rmodel, JsonRequestBehavior.AllowGet)); }
public JsonResult Search() { ParameterXmlHelper xh = new ParameterXmlHelper(System.Web.HttpContext.Current.Server.MapPath("~/App_Data/")); List <Parameter> list2 = xh.GetAll(); Dictionary <string, object> dic = new Dictionary <string, object>(); // var mql = ParameterSet.Id.NotEqual(""); dic.Add("rows", list2); dic.Add("total", xh.GetAll().Count); string d = JsonConvert.SerializeObject(dic); return(Json(dic, JsonRequestBehavior.AllowGet)); }