Пример #1
0
        private async void tbEdit_Click(object sender, EventArgs e)
        {
            NewBatch obj = newBatchBindingSource.Current as NewBatch;

            if (obj != null)
            {
                using (frmNewBatchInfo frm = new frmNewBatchInfo(obj))
                {
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        try
                        {
                            newBatchBindingSource.EndEdit();
                            await db.SaveChangesAsync();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
        }
Пример #2
0
 public frmNewBatchInfo(NewBatch obj)
 {
     InitializeComponent();
     newBatchBindingSource.DataSource = obj;
 }