/// <summary> /// Edit current customer in dialog window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridView_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { e.Handled = true; var countries = _operations.GetCountries(); countries.Insert(0, new CountryItem() { CountryIdentifier = 0, CountyName = "Select" }); var contactTitles = _operations.GetContactTypes(); contactTitles.Insert(0, new ContactType() { ContactTypeIdentifier = 0, ContactTitle = "Select" }); var f = new CustomerEditorForm(countries, contactTitles); try { if (f.ShowDialog() == DialogResult.OK) { } } finally { f.Dispose(); } } }
private void btnNewCustomer_Click(object sender, EventArgs e) { CustomerEditorForm editor = Bootstrapper.Resolve <CustomerEditorForm>(); editor.ShowDialog(this); btnSearch.PerformClick(); }
private void cmsEditData_Click(object sender, EventArgs e) { if (_selectedCustomer != null) { CustomerEditorForm editor = Bootstrapper.Resolve <CustomerEditorForm>(); editor.SelectedCustomer = _selectedCustomer; editor.ShowDialog(this); btnSearch.PerformClick(); } }