Exemplo n.º 1
0
 public addEditPDR(PatientDiseaseRelation pdr, AdminPanel parentForm)
 {
     InitializeComponent();
     patientBindingSource.DataSource = db.Patients.ToList();
     diseaseBindingSource.DataSource = db.Diseases.ToList();
     if (pdr == null)
     {
         patientDiseaseRelationBindingSource.DataSource = new PatientDiseaseRelation();
         basePDR           = patientDiseaseRelationBindingSource.Current as PatientDiseaseRelation;
         basePDR.DiseaseID = 1;
         basePDR.PatientID = 1;
         basePDR.ChangedOn = DateTime.Now;
         isNew             = true;
     }
     else
     {
         patientDiseaseRelationBindingSource.DataSource = pdr;
         db.PatientDiseaseRelations.Attach(pdr);
         basePDR = pdr;
     }
     getInitialState();
 }
 public addEditPrescription(Form parentForm, PatientDiseaseRelation pdr)
 {
     InitializeComponent();
     doctorBindingSource.DataSource = db.Doctors.Where(x => x.DiseaseID == pdr.DiseaseID).ToList();
     this.pdr = pdr;
 }