Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            if (context.Session["user"] == null)
            {
                context.Response.Write("nosession");
                context.Response.End();
            }
            string guid        = context.Request.QueryString["guid"];
            string strJsonTree = new BLL.ui_menu().getJsonTree(guid);

            context.Response.Write(strJsonTree);
            context.Response.End();
        }
Пример #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string type = context.Request.QueryString["type"] ?? "";

            if (!string.IsNullOrEmpty(type)) //数据
            {
                string strJson = new BLL.ui_menu().getJson(type);
                context.Response.Write(strJson);
                context.Response.End();
            }
            else
            {
                string action = context.Request.Params["action"];
                if (action == "add")
                {
                    Model.ui_org model = new Model.ui_org();
                    if (!string.IsNullOrEmpty(context.Request.Params["cc"]))
                    {
                        model.fatherid = new Guid(context.Request.Params["cc"]);
                    }
                    model.icon    = context.Request.Params["txt_icon"] ?? "";
                    model.orgname = context.Request.Params["txt_orgname"];
                    model.attr_a  = context.Request.Params["attr_a"];
                    model.attr_b  = context.Request.Params["attr_b"];
                    model.crdate  = DateTime.Now;
                    if (new BLL.ui_org().Add(model))
                    {
                        context.Response.Write("ok");
                        context.Response.End();
                    }
                    else
                    {
                        context.Response.Write("err");
                        context.Response.End();
                    }
                }
                if (action == "edit")
                {
                    Model.ui_org model = new Model.ui_org();
                    if (!string.IsNullOrEmpty(context.Request.Params["_parentId"]))
                    {
                        model.fatherid = new Guid(context.Request.Params["_parentId"]);
                    }
                    model.icon    = context.Request.Params["iconCls"] ?? "";
                    model.orgname = context.Request.Params["orgname"];
                    model.attr_a  = context.Request.Params["attr_a"];
                    model.attr_b  = context.Request.Params["attr_b"];
                    model.id      = new Guid(context.Request.Params["id"]);
                    // model.crdate = DateTime.Now;
                    if (new BLL.ui_org().Update(model))
                    {
                        context.Response.Write("ok");
                        context.Response.End();
                    }
                    else
                    {
                        context.Response.Write("err");
                        context.Response.End();
                    }
                }
            }
        }
Пример #3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string type = context.Request.QueryString["type"] ?? "";

            if (context.Session["user"] == null)
            {
                context.Response.Write("nosession");
                return;
            }
            else if (!string.IsNullOrEmpty(type))
            {
                string uid     = context.Request.QueryString["uid"];
                string strJson = new BLL.ui_menu().getJson(type);
                context.Response.Write(strJson);
                context.Response.End();
            }
            //
            else if (context.Request.Params["action"] == "user")
            {
                string json = new BLL.ui_user().GetUser();
                context.Response.Write(json);
            }
            else if (context.Request.Params["action"] == "all")
            {
                string json = new BLL.ui_menu().getJSONMenu();
                context.Response.Write(json);
            }

            else if (context.Request.Params["action"] == "add")
            {
                Model.ui_menu model = new Model.ui_menu();

                model.menuorder = int.Parse(context.Request["menuorder"]);
                model.fatherid  = int.Parse(context.Request["fatherid"]);
                model.menuname  = context.Request["menuname"];
                model.icon      = context.Request["icon"];
                model.url       = context.Request["url"];
                model.crdate    = DateTime.Now;
                if (new BLL.ui_menu().Add(model) > 0)
                {
                    context.Response.Write("ok");
                }
            }
            else if (context.Request.Params["action"] == "update")
            {
                Model.ui_menu model = new Model.ui_menu();
                model.id        = int.Parse(context.Request["id"]);
                model.menuorder = int.Parse(context.Request["menuorder"]);
                model.fatherid  = int.Parse(context.Request["fatherid"]);
                model.menuname  = context.Request["menuname"];
                model.icon      = context.Request["icon"];
                model.url       = context.Request["url"];
                model.crdate    = DateTime.Now;
                if (new BLL.ui_menu().Update(model))
                {
                    context.Response.Write("ok");
                }
            }
            else if (context.Request.Params["action"] == "del")
            {
                Model.ui_menu model = new Model.ui_menu();
                model.id = int.Parse(context.Request["id"]);
                if (new BLL.ui_menu().Delete(model.id))
                {
                    context.Response.Write("ok");
                }
            }
        }