private void Add_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { DataCommon.Remove("CAR_EDIT"); PopupCar pop = new PopupCar(); pop.ShowDialog(); ReloadData(); }
private void Button_Click(object sender, RoutedEventArgs e) { try { int index = grdCar.SelectedIndex; string carCode = ((DataRowView)grdCar.SelectedItem).Row.ItemArray[0].ToString(); string carName = ((DataRowView)grdCar.SelectedItem).Row.ItemArray[1].ToString(); string carModel = ((DataRowView)grdCar.SelectedItem).Row.ItemArray[2].ToString(); string carEngine = ((DataRowView)grdCar.SelectedItem).Row.ItemArray[3].ToString(); CarData carItem = new CarDAL().GetItemCode(carCode, carName, carModel, carEngine); DataCommon.Set("CAR_EDIT", carItem); PopupCar pop = new PopupCar(); pop.ShowDialog(); ReloadData(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }