Exemplo n.º 1
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            var window = Container.Resolve <AddGarnitureWindow>();

            window.ShowDialog();
            if (window.DialogResult == true)
            {
                if (!list.Contains(logicGarnitures.Read(new GarnitureBindingModel {
                    Id = window.Id
                })[0]))
                {
                    list.Add(logicGarnitures.Read(new GarnitureBindingModel {
                        Id = window.Id
                    })[0]);
                    LoadData();
                }
            }
        }
Exemplo n.º 2
0
 private void LoadData()
 {
     try
     {
         var list = _logic.Read(null);
         if (list != null)
         {
             DataGridView.ItemsSource           = list;
             DataGridView.Columns[0].Visibility = Visibility.Hidden;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Exemplo n.º 3
0
        private void Window_loaded(object sender, RoutedEventArgs e)
        {
            var list = _logic.Read(null);

            if (list.Count > 0)
            {
                try
                {
                    cbGarnitures.DisplayMemberPath = "Name";
                    cbGarnitures.ItemsSource       = list;
                    cbGarnitures.SelectedItem      = null;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }