private void AddOO() { int ooCode; if (int.TryParse(tbOOCode.Text, out ooCode)) { OrgAddEdit.AddOO(ooCode, (int)comboAteName.SelectedValue, tbLongName.Text, tbShortName.Text, (int)comboMembership.SelectedValue, checkIsPPE9.Checked, checkIsPPE11.Checked, tbDirector.Text, tbPhone.Text, tbEmail.Text, tbAdress.Text); } }
private void tsbtnOrgRemove_Click(object sender, EventArgs e) { if (dgvOrg.SelectedRows.Count > 0) { int idOO = int.Parse(dgvOrg.SelectedRows[0].Cells[3].Value.ToString()); if (MessageBox.Show("Вы уверены, что хотите удалить данную организацию? Все договоры с ее участием также будут удалены!", "Подтверждение удаления", MessageBoxButtons.OKCancel) == DialogResult.OK) { OrgAddEdit.RemoveOO(idOO); Refresh_OrganizationsDataGridView(); } } }
public void LoadForTwoModes() { InitializeComponent(); orgAddEdit = new OrgAddEdit(); comboATEs.DataSource = new BindingSource(orgAddEdit.ATEs, null); comboATEs.DisplayMember = "Value"; comboATEs.ValueMember = "Key"; if (dgvOrgShort.Columns.Count > 0) { dgvOrgShort.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; dgvOrgShort.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; } }
private void FillFormEditingOrg() { comboAteName.SelectedValue = OrgAddEdit.GetCurrentAte(idOO); comboMembership.SelectedValue = OrgAddEdit.GetCurrentMembership(idOO); tbOOCode.Text = more.Organization.ooCode.ToString(); tbLongName.Text = more.Organization.ooLongName.ToString(); tbShortName.Text = more.Organization.ooShortName.ToString(); checkIsPPE9.Checked = more.Organization.isPPE9; checkIsPPE11.Checked = more.Organization.isPPE11; tbDirector.Text = more.Organization.DirectorFIO.ToString(); tbEmail.Text = more.Organization.Email.ToString(); tbPhone.Text = more.Organization.Phone.ToString(); tbAdress.Text = more.Organization.Adress.ToString(); }
public SelectOrgForContractForm(int idOO) { try { LoadForTwoModes(); OrgId = idOO; comboATEs.SelectedValue = OrgAddEdit.GetCurrentAte(idOO); tbSearchQuery.Text = idOO.ToString(); } catch (Exception e) { MessageBox.Show(e.Message); } }