Example #1
0
        public async Task UpdateFields()
        {
            Country country = await CountryService.GetCountryWithName(CountryName);

            Purchasers = await PurchaserService.GetPurchasersForCountry(country.Id);

            Customers = await VailedForCustomerService.GetVailedCustomers(country.Id);
        }
Example #2
0
        public async void UpdateCustomers()
        {
            foreach (int delete in CustomersToDelete)
            {
                VailedForCustomerService.DeleteVailedForCustomer(delete);
            }

            foreach (VailedForCustomer customer in Customers)
            {
                if (customer.Id == 0)
                {
                    await VailedForCustomerService.CreateVailedForCustomer(customer);
                }
                else
                {
                    VailedForCustomerService.UpdateVailedForCustomer(customer.Id, customer);
                }
            }
        }
Example #3
0
        protected async override Task OnInitializedAsync()
        {
            profile  = $"/profile_admin/{Id}";
            country  = $"/country_view/{Id}";
            user     = $"/user_view/{Id}";
            article  = $"/article_view/{Id}";
            overview = $"/overview_admin/{Id}";

            CurrentCountry = new Country();
            CurrentCountry = await CountryService.GetCountry(Id);

            Customers = await VailedForCustomerService.GetVailedCustomers(CurrentCountry.Id);

            if (Customers == null)
            {
                Customers = new List <VailedForCustomer>
                {
                    new VailedForCustomer()
                    {
                        Id = 0
                    }
                };
            }
            else
            {
                NumberOfCustomers = Customers.Count - 1;
            }

            CompanyCodes = new List <CompanyCode>();
            CompanyCodes = await CompanyCodeService.GetCompanyCodes(CurrentCountry.Id);

            if (CompanyCodes.Count == 0)
            {
                CompanyCodes.Add(new CompanyCode());
            }
            else
            {
                NumberOfCodes = CompanyCodes.Count - 1;
            }

            Units = new List <SupplierDeliveryUnit>();
            Units = await SupplierDeliveryUnitService.GetSupplierDeliveryUnits(CurrentCountry.Id);

            if (Units.Count == 0)
            {
                Units.Add(new SupplierDeliveryUnit());
            }
            else
            {
                NumberOfUnits = Units.Count - 1;
            }

            OrderPickGroups = new List <Ilosorderpickgroup>();
            OrderPickGroups = await ILOSOrderpickgroupService.GetILOSOrderpickgroup(CurrentCountry.Id);

            if (OrderPickGroups.Count == 0)
            {
                OrderPickGroups.Add(new Ilosorderpickgroup());
            }
            else
            {
                NumberOfOrders = OrderPickGroups.Count - 1;
            }

            ILOSCodes = new List <PrimaryDciloscode>();
            ILOSCodes = await PrimaryDCILOSCodeService.GetPrimaryDCILOSCodes(CurrentCountry.Id);

            if (ILOSCodes.Count == 0)
            {
                ILOSCodes.Add(new PrimaryDciloscode());
            }
            else
            {
                NumberOfPrim = ILOSCodes.Count - 1;
            }


            TaxCodes = new List <VatTaxCode>();
            TaxCodes = await VatTaxCodeService.GetVatTaxCodes(CurrentCountry.Id);

            if (TaxCodes.Count == 0)
            {
                TaxCodes.Add(new VatTaxCode());
            }
            else
            {
                NumberOfTAX = TaxCodes.Count - 1;
            }

            ILOSCategories = new List <Iloscategory>();
            ILOSCategories = await ILOSCategoriesService.GetILOSCategories(CurrentCountry.Id);

            if (ILOSCategories.Count == 0)
            {
                ILOSCategories.Add(new Iloscategory());
            }
            else
            {
                NumberOfCat = ILOSCategories.Count - 1;
            }
        }