protected override void AddItem() { DBActions.Add <Storage>(new Storage { Name = "Новый элемент" + ListCurrentData.Count }); ListCurrentData = DBActions.Get <Storage>(); OnPropertyChanged("ListCurrentData"); SelectedDataItem = ListCurrentData[ListCurrentData.Count - 1]; }
protected override void AddItem() { DBActions.Add <Provider>(new Provider { FullName = "Поставщик новый " + ListCurrentData.Count }); ListCurrentData = DBActions.Get <Provider>(); OnPropertyChanged("ListCurrentData"); SelectedDataItem = ListCurrentData[ListCurrentData.Count - 1]; }
protected override void AddItem() { DBActions.Add <Client>(new Client { FullName = "Поставщик клиент " + ListCurrentData.Count }); ListCurrentData = DBActions.Get <Client>(); OnPropertyChanged("ListCurrentData"); SelectedDataItem = ListCurrentData[ListCurrentData.Count - 1]; }
protected override void EditItem() { System.Windows.MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show( "Вы уверены, что хотите внести изменения?", "Предупреждение", System.Windows.MessageBoxButton.YesNo, System.Windows.MessageBoxImage.Warning ); if (messageBoxResult == System.Windows.MessageBoxResult.No) { return; } DBActions.Update <Product>(TempItem); DBActions.Add <Price>(new Price { Cost = ((Product)TempItem).Price, IDProduct = ((Product)TempItem).ID, Data = DateTime.Now }); ListCurrentData[ListCurrentData.IndexOf(SelectedDataItem)] = TempItem; }