public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; context.Response.ContentType = "text/plain"; if (SysVisitor.Instance.IsGuest) { context.Response.Write( new JsonMessage { Success = false, Data = "-99", Message = "登录已过期,请重新登录" }.ToString() ); context.Response.End(); } var json = HttpContext.Current.Request["json"]; var rpm = new RequestParamModel <DemoMember>(context) { CurrentContext = context }; if (!string.IsNullOrEmpty(json)) { rpm = JSONhelper.ConvertToObject <RequestParamModel <DemoMember> >(json); rpm.CurrentContext = context; } int k = 0; switch (rpm.Action) { case "add": var b = new DemoMember(); b.InjectFrom(rpm.Entity); b.Ownner = SysVisitor.Instance.UserId; //当前用户ID b.DepID = SysVisitor.Instance.CurrentUser.DepartmentId; //当前用户所在的部门 k = DemoMemberDal.Instance.Insert(b); context.Response.Write(new JsonMessage { Data = k.ToString(), Message = "添加成功", Success = true }.ToString()); break; case "edit": var p = new DemoMember(); p.InjectFrom(rpm.Entity); p.KeyID = rpm.KeyId; k = DemoMemberDal.Instance.Update(p); context.Response.Write(new JsonMessage { Data = k.ToString(), Message = "编辑成功", Success = true }.ToString()); break; case "delete": k = DemoMemberDal.Instance.Delete(rpm.KeyId); context.Response.Write(new JsonMessage { Data = k.ToString(), Message = "删除成功", Success = true }.ToString()); break; default: context.Response.Write(JsonDataForEasyUIdataGrid(rpm.Pageindex, rpm.Pagesize, rpm.Filter)); break; } }
public string GetDicListByCode(string code) { var dicList = DicDal.Instance.GetListByCategoryCode(code); return(JSONhelper.ToJson(dicList.ToList())); }
public string ICPOPOLICYData(string ICPOBILLID = null) { return(JSONhelper.ToJson(V_ICPOPOLICYBLL.Instance.GetByICPOBILLID(ICPOBILLID))); }
public string City() { string provinceid = Request["provinceid"]; return(JSONhelper.ToJson(CityDal.Instance.GetWhere(new { PROVINCEID = provinceid }).ToList())); }
public string District() { string cityid = Request["cityid"]; return(JSONhelper.ToJson(DistrictDal.Instance.GetWhere(new { CITYID = cityid }).ToList())); }
public string Province() { return(JSONhelper.ToJson(ProvinceDal.Instance.GetAll().ToList())); }
public override string ToString() { return(JSONhelper.ToJson(this)); }
/// <summary> /// 构建EasyUI treegrid、tree 所需要的JSON /// </summary> /// <param name="parentid">上级节点ID</param> /// <returns></returns> public string BuildNavTreeJSON(string parentid = "0") { return(JSONhelper.ToJson(NavigationDal.Instance.GetList(parentid).ToList()) .Replace("icon ", "")); }
public string GetCategoryTreegridData() { return(JSONhelper.ToJson(CategoryDal.Instance.GetChildren())); }
/// <summary> /// 获取分类数据 /// </summary> /// <returns></returns> public string GetCategoryTreeJson() { var nodes = GetCategoryTreeNodes(); return(JSONhelper.ToJson(nodes)); }