private void button1_Click(object sender, EventArgs e) { using (contractorAdd = new ContractorAdd()) { contractorAdd.ButtonOkClicked += new EventHandler(AddRowCon); LoadCategories(); contractorAdd.ActiveItemsCombobox(0, 0, 0); contractorAdd.ShowDialog(); } }
private void btnEdit_Click(object sender, EventArgs e) { if (!(gridMain.Rows.Count == 0)) { using (contractorAdd = new ContractorAdd()) { contractorAdd.ButtonOkClicked += new EventHandler(EditRowCon); contractorAdd.ContrTIN = gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[4].Value.ToString(); contractorAdd.ContrName = gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[5].Value.ToString(); LoadCategories(); contractorAdd.ActiveItemsCombobox(Convert.ToInt32(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[1].Value.ToString()), Convert.ToInt32(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[2].Value.ToString()), Convert.ToInt32(gridMain.Rows[gridMain.CurrentCell.RowIndex].Cells[3].Value.ToString())); contractorAdd.FormCaption = "Редактировать"; contractorAdd.ShowDialog(); } } }