Esempio n. 1
0
        private void SynchronizeStorePlaces()
        {
            _storePlacesDTO = _storePlaceController.GetAllStorePlaces();
            warehouseComboBox.Items.Clear();

            if (_storePlacesDTO.StorePlaces != null)
            {
                foreach (var s in _storePlacesDTO.StorePlaces)
                {
                    warehouseComboBox.Items.Add(s.Name);
                }
            }
        }
Esempio n. 2
0
        private void SynchronizeStorePlaces()
        {
            _storePlacesDTO = _storePlaceController.GetAllStorePlaces();
            listStorePlace.Items.Clear();

            switch (_storePlacesDTO.Status)
            {
            case CollectionGetStatus.Failure:
                MessageBox.Show(
                    "Wystąpił problem z odczytem placówek z bazy danych. Skontatkuj się z administratorem usługi.",
                    "Błąd odczytu placówek",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );

                break;

            case CollectionGetStatus.Empty:

                string[] info =
                {
                    "---",
                    "Brak placówek do wyświetlenia",
                    "------"
                };
                listStorePlace.Items.Add(new ListViewItem(info));

                break;

            case CollectionGetStatus.Success:

                foreach (var sp in _storePlacesDTO.StorePlaces)
                {
                    string[] storePlaceInfo =
                    {
                        sp.Id.ToString(),
                        sp.Name.ToString(),
                        sp.Type == 0 ? "Magazyn" : "Punkt wysyłki"
                    };

                    listStorePlace.Items.Add(new ListViewItem(storePlaceInfo));
                }

                break;
            }
        }