示例#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>());
        }
示例#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>());
        }
示例#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>());
        }
示例#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>());
        }