private void OnAddNewMedicineClick(object sender, EventArgs e) { Medicine obj = new Medicine(this.mOPDPrescription); MedicineForm.ShowForm(obj); MedicineCollection opdMedicineList = new MedicineCollection(); this.cmbMedicine.DataSource = opdMedicineList; this.cmbMedicine.DisplayMember = "DisplayName"; }
protected override void OnDataShow() { base.OnDataShow(); this.cmbMedicine.Select(); this.Text = "Prescription"; //Medicine MedicineCollection opdMedicineList = new MedicineCollection(); this.cmbMedicine.DataSource = opdMedicineList; this.cmbMedicine.DisplayMember = "DisplayName"; this.cmbMedicine.SelectedItem = null; this.txtDoseage.Text = this.mOPDPrescription.Doseage; this.txtTimings.Text = this.mOPDPrescription.Timings; if (!string.IsNullOrEmpty(this.mOPDPrescription.OPDPrescriptionDate.ToString()) && (this.mOPDPrescription.OPDPrescriptionDate != DateTime.MinValue)) { this.dptPrescriptionDate.Value = this.mOPDPrescription.OPDPrescriptionDate; } // Medicine if (this.OPDMedicines.Count > 0) { for (int i = 0; i < cmbMedicine.Items.Count; i++) { for (int j = 0; j < this.OPDMedicines.Count; j++) { if (OPDMedicines[j].MedicineGuid == new Guid(cmbMedicine.Items[i].ToString())) { cmbMedicine.SetItemChecked(i, true); break; } } } } LoadListPrescriptionData(GetSelectedProcedure(this.dgvPrescription)); }
public IList <MedicineModel> GetList() { var objs = MedicineCollection.GetAll(); return(_mapper.Map <IList <MedicineModel> >(objs)); }