Beispiel #1
0
        public static ListOutputType1 ListPeriod(ListPeriodInputType input, string appToken, string userToken, SourceUsageOrder sourceUsageOrder)
        {
            var facade = new ListPeriodLookupFacadeMethodInfo()
            {
                ApplicationToken = appToken,
                UserToken        = userToken,
                Input            = new PeriodLookupInput()
                {
                    UUIDs            = input.UUID,
                    EffectDateFrom   = input.VirkningFraDato,
                    EffectDateTo     = input.VirkningTilDato,
                    SourceUsageOrder = sourceUsageOrder
                }
            };
            ListOutputType1 result = GetMethodOutput <ListOutputType1, LaesResultatType[]>(facade);

            string[] emptyRecords = ValidateResults(result.LaesResultat);
            CprBroker.Engine.Local.Admin.LogFormattedSuccess("# of empty records: {0}", emptyRecords.Length);
            if (emptyRecords.Length == 0)
            {
                result.StandardRetur = StandardReturType.OK();
            }
            else
            {
                result.StandardRetur = StandardReturType.NoContent(emptyRecords);
            }
            return(result);
        }
Beispiel #2
0
        public static ListOutputType1 ListAtTime(ListOejebliksbilledeInputType input, string appToken, string userToken, SourceUsageOrder sourceUsageOrder)
        {
            var facade = new ListPeriodLookupFacadeMethodInfo()
            {
                ApplicationToken = appToken,
                UserToken        = userToken,
                Input            = new PeriodLookupInput()
                {
                    UUIDs            = input.UUID,
                    EffectDateFrom   = input.VirkningDato,
                    EffectDateTo     = input.VirkningDato,
                    SourceUsageOrder = sourceUsageOrder
                }
            };
            ListOutputType1 result = GetMethodOutput <ListOutputType1, LaesResultatType[]>(facade);

            String[] emptyRecords = ValidateResults(result.LaesResultat);
            if (emptyRecords.Length == 0)
            {
                result.StandardRetur = StandardReturType.OK();
            }
            else
            {
                result.StandardRetur = StandardReturType.NoContent(emptyRecords);
            }
            return(result);
        }
Beispiel #3
0
        public static ListOutputType1 List(string userToken, string appToken, ListInputType input, SourceUsageOrder localAction, out QualityLevel?qualityLevel)
        {
            ListOutputType1 ret = null;

            ret = GetMethodOutput <ListOutputType1, LaesResultatType[]>(
                new ListFacadeMethodInfo(input, localAction, appToken, userToken)
                );

            //TODO: remove quality level because it applies to individual elements rather than the whole result
            qualityLevel = QualityLevel.LocalCache;
            return(ret);
        }
Beispiel #4
0
 public void ValidateListReturn(ListOutputType1 ret)
 {
     Assert.IsNotNull(ret);
     System.Console.WriteLine("Error message: " + ret.StandardRetur.FejlbeskedTekst);
     base.Validate(ret.StandardRetur.StatusKode, ret.StandardRetur.FejlbeskedTekst);
 }