Esempio n. 1
0
        private void GetServiceProperties(HttpContext context)
        {
            short serviceId  = 0;
            bool  onlyActive = true;

            if (context.Request["ServiceId"] != null && !short.TryParse(context.Request["ServiceId"].ToString(), out serviceId))
            {
                GenerateErrorResponse(400, string.Format("ServiceId value ({0}) is not a valid number", context.Request["ServiceId"].ToString()));
            }
            if (context.Request["OnlyActive"] != null && !bool.TryParse(context.Request["OnlyActive"].ToString(), out onlyActive))
            {
                GenerateErrorResponse(400, string.Format("OnlyActive value ({0}) is not a valid boolean value", context.Request["OnlyActive"].ToString()));
            }
            TablePreferences propertiesTablePrefernces = new TablePreferences("", "", true, false);
            Dictionary <string, TablePreferences> propertiesDictionary = new Dictionary <string, TablePreferences>();

            propertiesDictionary.Add("Properties", propertiesTablePrefernces);
            OrdersManagement.Core.Client client = new OrdersManagement.Core.Client(responseFormat: OrdersManagement.ResponseFormat.JSON);
            context.Response.Write(client.GetServiceProperties(serviceId: serviceId, onlyActive: onlyActive, tablePreferences: propertiesDictionary));
        }