public static DrugDisease Build(DrugDisease dd, Drug drug, Disease disease) { if(dd!=null) { dd.DiseaseId = disease.DiseaseId; dd.DrugId = drug.DrugId; dd.DrugName = drug.Name; dd.DiseaseName = disease.Name; dd.DiseaseInfo = disease.Info; } return dd; }
public static Drug Build(Drug drug, Storage storage, ApplicationType appType ) { if(drug!=null) { drug.ApplicationTypeId = appType.AppTypeId; drug.StorageId = storage.StorageId; drug.ApplicationType = appType.AppType; drug.Storage = storage.Place; drug.StorageInfo = storage.Name; } return drug; }
private void EditButtonClick(object sender, EventArgs e) { if ((storageComboBox.SelectedIndex > -1) && (appTypeComboBox.SelectedIndex > -1) && (nameTextBox.Text != "") && (infoTextBox.Text != "")) { Storage st = storages[storageComboBox.SelectedIndex]; ApplicationType appType = appTypes[appTypeComboBox.SelectedIndex]; item.Name = nameTextBox.Text; item.Info = infoTextBox.Text; item = Drug.Build(item, st, appType); this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show(errorEditString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public EditDrugForm(Drug item) { this.item = item; InitializeComponent(); }