Exemplo n.º 1
0
        public async Task AddCar()
        {
            CarAdd car = new CarAdd()
            {
                BodyStyle      = this.BodyStyle,
                DateProduction = this.DateProduction,
                EngineType     = this.EngineType,
                FuelType       = this.FuelType,
                Id             = this.Id,
                Model          = this.Model,
                OdoMeter       = this.OdoMeter
            };

            //
            try
            {
                await _car2EndPoint.PostCar(car);

                _addedViewModel.UpdateMessage("Komunikat", "Dodano rekord");
                _windowManager.ShowWindow(_addedViewModel);
            }
            catch
            {
                _addedViewModel.UpdateMessage("Ostrzeżenie", "Nie dodano rekord");
                _windowManager.ShowWindow(_addedViewModel);
            }
        }
Exemplo n.º 2
0
        public async Task AddModel()
        {
            ModelAdd model = new ModelAdd()
            {
                Name   = this.Name2,
                Brand_ = this.Brand,
                FirstDateProduction = this.FirstDateProduction
            };

            //
            try
            {
                await _modelEndPoint.PostModel(model);

                _addedViewModel.UpdateMessage("Komunikat", "Dodano rekord");
                _windowManager.ShowWindow(_addedViewModel);
            }
            catch
            {
                _addedViewModel.UpdateMessage("Ostrzeżenie", "Nie dodano rekord");
                _windowManager.ShowWindow(_addedViewModel);
            }
        }
Exemplo n.º 3
0
        public async Task AddBrand()
        {
            BrandAdd brand = new BrandAdd()
            {
                Name        = this.Name2,
                Country     = this.Country,
                Owner       = this.Owner,
                DateCreated = this.DateCreated
            };

            //
            try
            {
                await _brandEndPoint.PostBrand(brand);

                _addedViewModel.UpdateMessage("Komunikat", "Dodano rekord");
                _windowManager.ShowWindow(_addedViewModel);
            }
            catch
            {
                _addedViewModel.UpdateMessage("Ostrzeżenie", "Nie dodano rekord");
                _windowManager.ShowWindow(_addedViewModel);
            }
        }