private void newCustomerPersonButton_Click( object sender, EventArgs e ) { DBObjects.CustomerPerson item = customerPersonComboBox.SelectedItem as DBObjects.CustomerPerson; DBObjects.CustomerCompany selectedCompany = customerCompanyComboBox.SelectedItem as DBObjects.CustomerCompany; DBObjects.CustomerCompany company = item==null?selectedCompany:item.Company; DBObjects.CustomerPerson person = new DBObjects.CustomerPerson(); CustomerPersonEditForm form = new CustomerPersonEditForm( company, person ); if ( form.ShowDialog( this ) == DialogResult.OK ) { FillCustomerPersonList( company ); FillGroupList( company ); SelectCustomerPerson( person ); } }
private void editCustomerPersonButton_Click( object sender, EventArgs e ) { DBObjects.CustomerPerson item = customerPersonComboBox.SelectedItem as DBObjects.CustomerPerson; DBObjects.CustomerCompany company = item.Company; CustomerPersonEditForm form = new CustomerPersonEditForm( company, item ); if ( form.ShowDialog( this ) == DialogResult.OK ) { int index = customerPersonComboBox.SelectedIndex; FillCustomerPersonList( company ); FillGroupList( company ); customerPersonComboBox.SelectedIndex = index; UpdateUI(); } }
void newItem_Click( object sender, EventArgs e ) { ToolStripMenuItem item = sender as ToolStripMenuItem; DBObjects.CustomerPerson person = item.Tag as DBObjects.CustomerPerson; DBObjects.CustomerCompany company = person.Company; CustomerPersonEditForm form = new CustomerPersonEditForm( company, person ); form.ShowDialog( this ); }
private void newpersonToolStripMenuItem_Click( object sender, EventArgs e ) { DBObjects.CustomerCompany company = customerCompanyTreeView.SelectedNode.Tag as DBObjects.CustomerCompany; DBObjects.CustomerPerson person = new DBObjects.CustomerPerson(); CustomerPersonEditForm form = new CustomerPersonEditForm( company, person ); form.ShowDialog( this ); }
private void personsListView_DoubleClick( object sender, EventArgs e ) { DBObjects.CustomerPerson person = personsListView.SelectedItems[0].Tag as DBObjects.CustomerPerson; CustomerPersonEditForm form = new CustomerPersonEditForm( item, person ); if ( form.ShowDialog( this ) == DialogResult.OK ) { FillPersonsList(); } }
private void newToolStripMenuItem_Click( object sender, EventArgs e ) { // Must store parent before adding child. Store(); DBObjects.CustomerPerson person = new DBObjects.CustomerPerson(); CustomerPersonEditForm form = new CustomerPersonEditForm( item, person ); if ( form.ShowDialog( this ) == DialogResult.OK ) { FillPersonsList(); } }