private void addButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         EditTable editTable = new EditTable();
         editTable.OldName.Text = tbkName.Text;
         editTable.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Пример #2
0
        private void butEdit_Click(object sender, EventArgs e)
        {
            EditTable upcl = new EditTable();

            upcl.id.Text           = dataGridView1.CurrentRow.Cells[0].Value.ToString();
            upcl.dayBox.Text       = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            upcl.maskedStart.Text  = dataGridView1.CurrentRow.Cells[2].Value.ToString();
            upcl.maskedFinish.Text = dataGridView1.CurrentRow.Cells[3].Value.ToString();


            this.Hide();
            upcl.ShowDialog();
            updateData();
            this.Show();
        }