Пример #1
0
        public void CT6_ListSummary()
        {
            POSBranchConfigService service = (POSBranchConfigService)_service.FindService <Model.Connector.POSBranchConfig>();

            List <Criteria> criterias = new List <Criteria>();

            var lista = service.ListSummary(criterias).Result;

            Assert.IsNotNull(lista);
            Assert.IsTrue(lista.Count != 0);

            lista.ForEach(l =>
            {
                Console.WriteLine($"id: {l.RecId}, filial: {l.BranchId}-{l.BranchName}, cliente: {l.DefaultCustomer}-{l.DefaultCustomerName}, utilização: {l.UsageCode}, data {l.OpeningDate}");
            });
        }
Пример #2
0
        async public Task <ActionResult> ListSummary([FromBody] Core.QueryRequest request)
        {
            ActionResult result = BadRequest();

            POSBranchConfigService service = (POSBranchConfigService)Service.FindService <Model.POSBranchConfig>();

            List <Criteria> criterias = new List <Criteria>();
            long            page      = request.page == null ? -1 : request.page.Value;
            long            size      = request.size == null ? -1 : request.size.Value;

            try
            {
                var lista = await service.ListSummary(criterias, page, size);

                Core.Utilities.ApiResponseBase response = new Core.Utilities.ApiResponseBase()
                {
                    success = true,
                    data    = lista,
                    message = null
                };

                result = Ok(response);
            }
            catch (Exception ex)
            {
                Core.Utilities.ApiResponseBase response = new Core.Utilities.ApiResponseBase()
                {
                    success = false,
                    data    = null,
                    message = ex.Message
                };

                result = BadRequest(response);
            }

            return(result);
        }