public void updateRow(DataSets.dsModuleStructure3.dtLabwareTypeLabwareParameterTypeRow updateRow) { try { taLabwareTypeLabwareParameterType.Update(updateRow); } catch (Exception ex) { MessageBox.Show("Invalid action type, try again !", "Error !", MessageBoxButtons.OK, MessageBoxIcon.Error); dsModuleStructureGUI.RejectChanges(); } }
private void crudOptions_AddClickHandler(object sender, EventArgs e) { /* * DataSets.dsModuleStructure3.dtLabwareTypeLabwareParameterTypeRow labwareParameterType = * dsModuleStructureGUI.dtLabwareTypeLabwareParameterType.NewdtLabwareTypeLabwareParameterTypeRow(); * DataSets.dsModuleStructure3.dtLabwareTypeRow labwareRow = getSelectedLabwareTypeRow(); */ abstractDialog dialog = new abstractDialog("Action type", "Add"); namedInputTextBox description = new namedInputTextBox("Description: "); dialog.addNamedInputTextBox(description); namedComboBox cbActionValueTupe = new namedComboBox("Labware parameter: "); cbActionValueTupe.getComboBox().DataSource = bsLabwareParameterType; cbActionValueTupe.getComboBox().DisplayMember = "description"; dialog.addControl(cbActionValueTupe); dialog.ShowDialog(); if (dialog.DialogResult.Equals(DialogResult.OK)) { DataSets.dsModuleStructure3.dtLabwareTypeLabwareParameterTypeRow row = dsModuleStructureGUI.dtLabwareTypeLabwareParameterType.NewdtLabwareTypeLabwareParameterTypeRow(); DataSets.dsModuleStructure3.dtLabwareParameterTypeRow dtLabwareParameterTypeRow = getSelectedLabwareParameterTypeRow(); DataSets.dsModuleStructure3.dtLabwareTypeRow dtLabwareTypeRow = getSelectedLabwareTypeRow(); if (dtLabwareParameterTypeRow == null) { return; } if (dtLabwareTypeRow == null) { return; } row.fk_labware_parameter_type_id = dtLabwareParameterTypeRow.pk_id; row.fk_labware_type_id = dtLabwareTypeRow.pk_id; row.value = description.getInputTextValue(); dsModuleStructureGUI.dtLabwareTypeLabwareParameterType.AdddtLabwareTypeLabwareParameterTypeRow(row); updateRow(row); } }