Esempio n. 1
0
        public void GetData(string serviceID, string fields, string query)
        {
            ServiceBase service = null;

            if (serviceID.IndexOf(".") > 0)
            {//系统服务
                service = NG3.Common.ESB.GetService(serviceID, true);
            }
            else
            {//自定义服务
                //根据serviceID 去数据库取得改service对应的xml文本返回
                var xml = this.GetServiceXML(serviceID);
                service = new DataService(new string[] { xml });
            }

            if (service == null)
            {
                Ajax.ShowMessage(AjaxType.Error, "CommHelp.GetList DataService is null[HelpID={0},ServiceID={1}]".FormatWith(Pub.Request("id"), serviceID));
            }

            var meta = new GridMeta();

            meta.Custom = new GridCustomMeta(fields);
            if (!string.IsNullOrEmpty(query))
            {
                meta.LoadQuery(query);
            }
            meta.Rows = int.MaxValue;
            var d = service.Invoke(ServiceAction.Read, meta);

            if (Ajax.DealESBData(d))
            {
                Ajax.WriteRaw(((DataPage)d.Value).ToJSON());
            }
        }
Esempio n. 2
0
        public void List(string pid)
        {
            var d = NG3.Common.ESB.GetService <ServiceDataCenter>().Invoke("list", pid);

            if (Ajax.DealESBData(d))
            {
                Ajax.WriteRaw(d.Value.TryParseToString());
            }
        }
Esempio n. 3
0
        public void GetList(string query)
        {
            var help    = this.Help;
            var service = NG3.Common.ESB.GetService(help.DataServiceName, true);

            if (service == null)
            {
                Ajax.ShowMessage(AjaxType.Error, "CommHelp.GetList DataService is null[HelpID={0},ServiceID={1}]".FormatWith(Pub.Request("id"), help.DataServiceName));
            }

            var meta = this.RequestMeta.AsGridMeta();

            meta.LoadQuery(query);
            var d = service.Invoke(ServiceAction.Read, meta);

            if (Ajax.DealESBData(d))
            {
                Ajax.WriteRaw(((DataPage)d.Value).ToJSON());
            }
        }
Esempio n. 4
0
        public void GetTree(string pid)
        {
            var help    = this.Help;
            var service = NG3.Common.ESB.GetService(help.Tree.DataServiceName, true);

            if (service == null)
            {
                Ajax.ShowMessage(AjaxType.Error, "CommHelp.GetTree Tree.DataService is null[HelpID={0},ServiceID={1}]".FormatWith(Pub.Request("id"), help.Tree.DataServiceName));
            }

            var meta = this.RequestMeta.AsGridMeta();

            meta.Query = new QueryParam();
            meta.Query.Add(new NameValuePair <object>("pid", pid));
            meta.Rows = int.MaxValue;
            var d = service.Invoke(ServiceAction.Read, meta);

            if (Ajax.DealESBData(d))
            {
                Ajax.WriteRaw(((DataPage)d.Value).ToJSON());
            }
        }