private void pbAddManufacturer_Click(object sender, EventArgs e)
 {
     AddEditManufacturer frmManufacturer = new AddEditManufacturer();
     frmManufacturer.updateManufacturer = new UpdateManufacturerList(addToItems);
     frmManufacturer.ShowDialog();
 }
Пример #2
0
 private void EditManufacturer(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex == -1)
         return;
     if (dgvManufacturer.SelectedRows.Count == Constant.CONSTANT_ZERO)
         return;
     DataGridViewRow selectedRow = dgvManufacturer.SelectedRows[Constant.CONSTANT_ZERO];
     string name = selectedRow.Cells[Constant.CONSTANT_ZERO].Value == null ? string.Empty : selectedRow.Cells[Constant.CONSTANT_ZERO].Value.ToString();
     string address = selectedRow.Cells[Constant.OPERATION_INDEX_ONE].Value == null ? string.Empty : selectedRow.Cells[Constant.OPERATION_INDEX_ONE].Value.ToString();
     string country = selectedRow.Cells[Constant.OPERATION_INDEX_TWO].Value == null ? string.Empty : selectedRow.Cells[Constant.OPERATION_INDEX_TWO].Value.ToString();
     string contact = selectedRow.Cells[Constant.OPERATION_INDEX_THREE].Value == null ? string.Empty : selectedRow.Cells[Constant.OPERATION_INDEX_THREE].Value.ToString();
     AddEditManufacturer frmEditManufacturer = new AddEditManufacturer(name, address, country, contact);
     frmEditManufacturer.ShowDialog();
 }