예제 #1
0
 private void button2_Click(object sender, EventArgs e)// addnew
 {
     if (productList != null)
     {
         if (thread == null || !thread.IsAlive)
         {
             EditDialog editDialog = new EditDialog();
             if (editDialog.ShowDialog() == DialogResult.OK)
             {
                 if (editDialog.product != null)
                 {
                     productList.Products.Add(editDialog.product);
                     UpdateGrid();
                     IsValueChanged = true;
                     this.Text      = filename + " *";
                 }
                 else
                 {
                     MessageBox.Show("Data not valid");
                 }
             }
         }
         else
         {
             MessageBox.Show("Calculation in procces", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
예제 #2
0
 private void button1_Click(object sender, EventArgs e)//editSected
 {
     if (thread == null || !thread.IsAlive)
     {
         if (selectedRow != null)
         {
             EditDialog editDialog = new EditDialog(selectedRow);
             if (editDialog.ShowDialog() == DialogResult.OK)
             {
                 if (editDialog.product != null)
                 {
                     productList.Products[selectedRow.Index] = editDialog.product;
                     DataGrid.Refresh();
                     IsValueChanged = true;
                     this.Text      = filename + " *";
                 }
                 else
                 {
                     MessageBox.Show("Data not valid");
                 }
             }
         }
     }
     else
     {
         MessageBox.Show("Calculation in procces", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }