Пример #1
0
        public static void GetApplicationList(Request request, ReplyNode result, ErrorNode error)
        {
            XmlElement applications = result.AddElement("applications");

            using (LegionLinqDataContext db = new LegionLinqDataContext(request.Service.Settings["LegionConnectionString"])) {
                ISingleResult <xspGetApplicationListResult> results = db.xspGetApplicationList();

                XmlElement application;
                foreach (xspGetApplicationListResult r in results)
                {
                    application = result.AddElement(applications, "application");
                    result.AddElement(application, "id", r.ApplicationId.ToString());
                    result.AddElement(application, "name", r.ApplicationName);
                }
            }
        }
Пример #2
0
        public static void GetApplicationDetailList(Request request, ReplyNode result, ErrorNode error)
        {
            using (LegionLinqDataContext db = new LegionLinqDataContext(request.Service.Settings["LegionConnectionString"])) {
                ISingleResult <xspGetApplicationListResult> applications = db.xspGetApplicationList();

                XmlElement xApplication, xApplications = result.AddElement("applications");
                foreach (xspGetApplicationListResult applciation in applications)
                {
                    xApplication = result.AddElement(xApplications, "application");
                    result.AddElement(xApplication, "id", applciation.ApplicationId.ToString());
                    result.AddElement(xApplication, "key", applciation.ApplicationKey);
                    result.AddElement(xApplication, "name", applciation.ApplicationName);
                    result.AddElement(xApplication, "consumeriprange", applciation.ConsumerIPRange);
                    result.AddElement(xApplication, "description", applciation.Description);
                    result.AddElement(xApplication, "ratelimittypeid", applciation.RateLimitTypeId.ToString());
                    result.AddElement(xApplication, "ratelimittype", applciation.RateLimitType);
                    result.AddElement(xApplication, "ratelimit", applciation.RateLimit.ToString());
                    result.AddElement(xApplication, "ratelimitinterval", applciation.RateLimitInterval.ToString());
                    result.AddElement(xApplication, "public", (applciation.IsPublic ? "true" : "false"));
                    result.AddElement(xApplication, "logged", (applciation.IsLogged ? "true" : "false"));
                }
            }
        }