private void AddButton_Click(object sender, RoutedEventArgs e) { ChangeWin chaingeWin = new ChangeWin(this); chaingeWin.Save_but_ON(); chaingeWin.Show(); chaingeWin.ID_zn_Label.Content = "1"; }
private void ChangeButton_Click(object sender, RoutedEventArgs e) { DataRowView oDataRowView = nomenclature.SelectedItem as DataRowView; string id_num = oDataRowView.Row.ItemArray.GetValue(0).ToString(); string name = oDataRowView.Row.ItemArray.GetValue(1).ToString(); string price = oDataRowView.Row.ItemArray.GetValue(2).ToString(); string fromDate = oDataRowView.Row.ItemArray.GetValue(3).ToString(); string toDate = oDataRowView.Row.ItemArray.GetValue(4).ToString(); ChangeWin chaingeWin = new ChangeWin(this); chaingeWin.ID_zn_Label.Content = id_num; chaingeWin.textBoxName.Text = name; chaingeWin.textBoxPrice.Text = price; chaingeWin.fromDatePicker.SelectedDate = Convert.ToDateTime(fromDate); chaingeWin.toDatePicker.SelectedDate = Convert.ToDateTime(toDate); chaingeWin.Change_but_ON(); chaingeWin.Show(); }