예제 #1
0
        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;
            }
        }
예제 #2
0
        public string GetDicListByCode(string code)
        {
            var dicList = DicDal.Instance.GetListByCategoryCode(code);

            return(JSONhelper.ToJson(dicList.ToList()));
        }
예제 #3
0
 public string ICPOPOLICYData(string ICPOBILLID = null)
 {
     return(JSONhelper.ToJson(V_ICPOPOLICYBLL.Instance.GetByICPOBILLID(ICPOBILLID)));
 }
예제 #4
0
        public string City()
        {
            string provinceid = Request["provinceid"];

            return(JSONhelper.ToJson(CityDal.Instance.GetWhere(new { PROVINCEID = provinceid }).ToList()));
        }
예제 #5
0
        public string District()
        {
            string cityid = Request["cityid"];

            return(JSONhelper.ToJson(DistrictDal.Instance.GetWhere(new { CITYID = cityid }).ToList()));
        }
예제 #6
0
 public string Province()
 {
     return(JSONhelper.ToJson(ProvinceDal.Instance.GetAll().ToList()));
 }
예제 #7
0
 public override string ToString()
 {
     return(JSONhelper.ToJson(this));
 }
예제 #8
0
 /// <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 ", ""));
 }
예제 #9
0
 public string GetCategoryTreegridData()
 {
     return(JSONhelper.ToJson(CategoryDal.Instance.GetChildren()));
 }
예제 #10
0
        /// <summary>
        /// 获取分类数据
        /// </summary>
        /// <returns></returns>
        public string GetCategoryTreeJson()
        {
            var nodes = GetCategoryTreeNodes();

            return(JSONhelper.ToJson(nodes));
        }