private void biEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { using (AccountEditingForm form = new AccountEditingForm()) { form.Edit((AccountInfo)this.gridView1.GetFocusedRow()); form.Owner = this; if (form.ShowDialog() == DialogResult.OK) { form.Account.Exchange = Exchange.Registered.FirstOrDefault(ee => ee.Type == form.Account.Type); form.Account.Exchange.Save(); this.gridView1.RefreshData(); } } }
private void biAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { using (AccountEditingForm form = new AccountEditingForm()) { form.AddNew(); form.Owner = this; if (form.ShowDialog() == DialogResult.OK) { form.Account.Exchange = Exchange.Registered.FirstOrDefault(ee => ee.Type == form.Account.Type); Keys.Add(form.Account); form.Account.Exchange.Save(); } } }