Ejemplo n.º 1
0
        private async void tbEdit_Click(object sender, EventArgs e)
        {
            Roo obj = rooBindingSource.Current as Roo;

            if (obj != null)
            {
                using (frmRooInfo frm = new frmRooInfo(obj))
                {
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        try
                        {
                            rooBindingSource.EndEdit();
                            await db.SaveChangesAsync();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public frmRooInfo(Roo obj)
 {
     InitializeComponent();
     rooBindingSource.DataSource = obj;
 }