private void Button_Click_Add(object sender, RoutedEventArgs e) { if (TabItem_Users.IsSelected) { var user = new ViewUser(); var userWindow = new UserWindow(user); userWindow.ShowDialog(); UpdateUsers(); } else if(TabItem_ObjOfTransact.IsSelected) { var objOfTransact = new ViewObjOfTransact(); var objOfTransactWindow = new ObjOfTransactWindow(objOfTransact); objOfTransactWindow.ShowDialog(); UpdateObjectOfTransaction(); } else if(TabItem_Deals.IsSelected) { var viewDeal = new ViewDeal(); var dealWindow = new DealWindow(viewDeal); dealWindow.ShowDialog(); UpdateDeals(); } }
private void Button_Click_Correct(object sender, RoutedEventArgs e) { if (TabItem_Users.IsSelected ) { if (DataGrid_Users.SelectedItem != null) { var user = (ViewUser)DataGrid_Users.SelectedItem; var userWindow = new UserWindow(user); userWindow.ShowDialog(); UpdateUsers(); } else { MessageBox.Show("Select some item!"); } } else if (TabItem_ObjOfTransact.IsSelected) { if (DataGrid_ObjOfTransact.SelectedItem != null) { var objOfTransact = (ViewObjOfTransact)DataGrid_ObjOfTransact.SelectedItem; var objOfTransactWindow = new ObjOfTransactWindow(objOfTransact); objOfTransactWindow.ShowDialog(); UpdateObjectOfTransaction(); } else { MessageBox.Show("Select some item!"); } } else if (TabItem_Deals.IsSelected) { if (DataGrid_Deals.SelectedItem != null) { var viewDeal = (ViewDeal)DataGrid_Deals.SelectedItem; var dealWindow = new DealWindow(viewDeal); dealWindow.ShowDialog(); UpdateDeals(); } else { MessageBox.Show("Select some item!"); } } }