Example #1
0
        private string LoadJson()
        {
            try
            {
                StringBuilder sb = new StringBuilder();

                System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer();

                sb.Append("\"DeleteFlag\":\"" + (DeleteFlag == null ? "" : DeleteFlag.NAME) + "\"");
                sb.Append(",");
                sb.Append("\"IsReadable\":" + IsReadable.ToString().ToLower() + "");
                sb.Append(",");
                sb.Append("\"IsCreatable\":" + IsCreatable.ToString().ToLower() + "");
                sb.Append(",");
                sb.Append("\"IsEditable\":" + IsEditable.ToString().ToLower() + "");
                sb.Append(",");
                sb.Append("\"IsDeletable\":" + IsDeletable.ToString().ToLower() + "");
                sb.Append(",");
                string fEntityKeys = "{" + (FirstEntityKeys.Any() ? FirstEntityKeys.Select(x => "\"" + x.Key + "\":" + js.Serialize(x.Value)).Aggregate((a, b) => a + "," + b) : "") + "}";
                sb.Append("\"FirstEntity\":" + fEntityKeys);

                string baseJson = base.Json;

                baseJson = baseJson.Replace(("\"SecurityZone\":\"" + base.SecurityZone + "\""), ("\"SecurityZone\":\"" + SecurityZone + "\""));

                sb.Append(string.IsNullOrEmpty(baseJson) ? "" : ("," + baseJson));

                sb.Append(",\"AVAILABLE_FORMATS\":[");
                if (AVAILABLE_FORMATS != null && AVAILABLE_FORMATS.Any())
                {
                    sb.Append(AVAILABLE_FORMATS.Select(x => "{" + x.Json + "}").Aggregate((a, b) => a + "," + b));
                }
                sb.Append("]");
                return(sb.ToString());
            }
            catch (Exception e) { WSStatus status = WSStatusBase.NONE.clone(); CFunc.RegError(GetType(), e, ref status); }

            return(string.Empty);
        }
 public string[] IsReadable(IsReadable request)
 {
     var response = base.SendRequest<TemplateScreenIds>("templatescreen.isreadable", request);
     return response.templatescreenids;
 }
Example #3
0
 public string[] IsReadable(IsReadable request)
 {
     var response = base.SendRequest<ItemIds>("item.isreadable", request);
     return response.itemids;
 }
Example #4
0
 public string[] IsReadable(IsReadable request)
 {
     var response = base.SendRequest<MapIds>("map.isreadable", request);
     return response.mapids;
 }
Example #5
0
 public string[] IsReadable(IsReadable request)
 {
     var response = base.SendRequest<HostIds>("host.isreadable", request);
     return response.hostids;
 }
 public string[] IsReadable(IsReadable request)
 {
     var response = base.SendRequest<DiscoveryRuleIds>("drule.isreadable", request);
     return response.druleids;
 }
Example #7
0
 public string[] IsReadable(IsReadable request)
 {
     var response = base.SendRequest<ServiceIds>("service.isreadable", request);
     return response.serviceids;
 }
Example #8
0
 public string[] IsReadable(IsReadable request)
 {
     var response = base.SendRequest<UserGroupIds>("usergroup.isreadable", request);
     return response.usrgrpids;
 }
Example #9
0
 public string[] IsReadable(IsReadable request)
 {
     var response = base.SendRequest<HostGroupIds>("hostgroup.isreadable", request);
     return response.groupids;
 }
Example #10
0
 public string[] IsReadable(IsReadable request)
 {
     var response = base.SendRequest<ProxyIds>("proxy.isreadable", request);
     return response.proxyids;
 }
Example #11
0
 public bool IsReadable(IsReadable request)
 {
     var response = base.SendRequest<bool>("trigger.isreadable", request);
     return response;
 }
Example #12
0
 public string[] IsReadable(IsReadable request)
 {
     var response = base.SendRequest<WebScenarioIds>("httptest.isreadable", request);
     return response.httptestids;
 }