Ejemplo n.º 1
0
        private async Task <IList <OrderStatusModel> > GetOrderStatusAsync()
        {
            try
            {
                using (var dataService = DataServiceFactory.CreateDataService())
                {
                    var items = await dataService.GetOrderStatusAsync();

                    return(items.Select(r => new OrderStatusModel
                    {
                        Status = r.Status,
                        Name = r.Name
                    })
                           .ToList());
                }
            }
            catch (Exception ex)
            {
                LogException("LookupTables", "Load OrderStatus", ex);
            }
            return(new List <OrderStatusModel>());
        }
Ejemplo n.º 2
0
        private async Task <IList <PaymentTypeModel> > GetPaymentTypesAsync()
        {
            try
            {
                using (var dataService = DataServiceFactory.CreateDataService())
                {
                    var items = await dataService.GetPaymentTypesAsync();

                    return(items.Select(r => new PaymentTypeModel
                    {
                        PaymentTypeID = r.PaymentTypeID,
                        Name = r.Name
                    })
                           .ToList());
                }
            }
            catch (Exception ex)
            {
                LogException("LookupTables", "Load PaymentTypes", ex);
            }
            return(new List <PaymentTypeModel>());
        }
Ejemplo n.º 3
0
        private async Task <IList <CountryCodeModel> > GetCountryCodesAsync()
        {
            try
            {
                using (var dataService = DataServiceFactory.CreateDataService())
                {
                    var items = await dataService.GetCountryCodesAsync();

                    return(items.OrderBy(r => r.Name).Select(r => new CountryCodeModel
                    {
                        CountryCodeID = r.CountryCodeID,
                        Name = r.Name
                    })
                           .ToList());
                }
            }
            catch (Exception ex)
            {
                LogException("LookupTables", "Load CountryCodes", ex);
            }
            return(new List <CountryCodeModel>());
        }
Ejemplo n.º 4
0
        private async Task <IList <ShipperModel> > GetShippersAsync()
        {
            try
            {
                using (var dataService = DataServiceFactory.CreateDataService())
                {
                    var items = await dataService.GetShippersAsync();

                    return(items.Select(r => new ShipperModel
                    {
                        ShipperID = r.ShipperID,
                        Name = r.Name,
                        Phone = r.Phone
                    })
                           .ToList());
                }
            }
            catch (Exception ex)
            {
                LogException("LookupTables", "Load Shippers", ex);
            }
            return(new List <ShipperModel>());
        }