示例#1
0
 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;
 }
示例#2
0
 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();
 }