private void stockgroup_Create_Click(object sender, RoutedEventArgs e) { Main.Content = ""; AddStockGroup addStockGroupWindown = new AddStockGroup(); addStockGroupWindown.ShowDialog(); }
private void Button_Click_Update(object sender, RoutedEventArgs e) { AddStockGroup addStockGroupWindow = new AddStockGroup(); if (datagrid.SelectedIndex >= 0) { stock_group_master stckgroup = datagrid.SelectedItem as stock_group_master; addStockGroupWindow.StockGroupName.Text = stckgroup.name; addStockGroupWindow.StockGroupId.Text = stckgroup.id.ToString(); addStockGroupWindow.btnModify.Visibility = Visibility.Visible; addStockGroupWindow.btnSave.Visibility = Visibility.Hidden; addStockGroupWindow.ShowDialog(); } else { MessageBox.Show("Something went wroung!"); } }