Beispiel #1
0
        public void GetRfProtectionDocs(GetRfPatentListArgument argument, GetRfPatentListResult result)
        {
            if (!argument.DateBegin.HasValue)
            {
                throw new ArgumentNullException(nameof(argument.DateBegin));
            }
            if (!argument.DateEnd.HasValue)
            {
                throw new ArgumentNullException(nameof(argument.DateEnd));
            }
            var rfPatents        = new List <RfPatent>();
            var rfProtectionDocs = _niisWebContext.ProtectionDocParents
                                   .Where(x => x.DateCreate.Date >= argument.DateBegin.Value.Date &&
                                          x.DateCreate.Date <= argument.DateEnd.Value.Date)
                                   .Select(x => new
            {
                ParentBarcode = x.Parent.Barcode,
                ChildBarcode  = x.Child.Barcode
            });

            foreach (var rfProtectionDoc in rfProtectionDocs)
            {
                rfPatents.Add(new RfPatent
                {
                    ChildPatentUID  = rfProtectionDoc.ChildBarcode,
                    ParentPatentUID = rfProtectionDoc.ParentBarcode
                });
                result.List = rfPatents.ToArray();
            }
        }
Beispiel #2
0
        public GetRfPatentListResult GetRfPatentList(GetRfPatentListArgument arg)
        {
            var result = new GetRfPatentListResult();
            var query  = new RfProtectionDocList.Query
            {
                Result   = result,
                Argument = arg
            };

            _mediator.Send(query).Wait();
            return(result);
        }