Esempio n. 1
0
        public static IQueryable <Patient> GetPatients(Patient searchCrit)
        {
            DataClassesClinicDataContext dc = new DataClassesClinicDataContext();
            var res = from el in dc.Patients
                      where
                      (String.IsNullOrEmpty(searchCrit.LastName) || el.LastName.StartsWith(searchCrit.LastName))
                      &&
                      ((searchCrit.IdPatient == 0) || el.IdPatient == searchCrit.IdPatient)
                      // && inne ...
                      select el;

            return(res);
        }
Esempio n. 2
0
        public static void NewPatientData(Patient pat)
        {
            using (DataClassesClinicDataContext dc = new DataClassesClinicDataContext())
            {
                var res = new Patient();

                res.LastName  = pat.LastName;
                res.FirstName = pat.FirstName;
                res.PESEL     = pat.PESEL;

                dc.Patients.InsertOnSubmit(res);
                dc.SubmitChanges();
            }
        }
Esempio n. 3
0
        public static IQueryable GetVisits(Visit searchCrit)
        {
            DataClassesClinicDataContext dc = new DataClassesClinicDataContext();
            var res = from vis in dc.Visits
                      select
                      new
            {
                vis.IdVisit,
                FirstName = vis.Patient.FirstName,
                LastName  = vis.Patient.LastName,
                vis.Description,
                vis.Diagnosis
            };

            return(res);
        }
Esempio n. 4
0
 /// <summary>
 /// nie musi być void
 /// </summary>
 /// <param name="pat"></param>
 public static void UpdatePatientData(Patient pat)
 {
     using (DataClassesClinicDataContext dc = new DataClassesClinicDataContext())
     {
         var res = (from el in dc.Patients
                    where el.IdPatient == pat.IdPatient
                    select el).SingleOrDefault();
         if (res == null)
         {
             return;
         }
         res.LastName  = pat.LastName;
         res.FirstName = pat.FirstName;
         dc.SubmitChanges();
     }
 }
Esempio n. 5
0
        public static IQueryable GetDoctors(Doctor searchCrit)
        {
            DataClassesClinicDataContext dc = new DataClassesClinicDataContext();
            var res = from doc in dc.Doctors
                      select
                      new
            {
                //FirstName = vis.Patient.FirstName,
                //LastName = vis.Patient.LastName,
                doc.Id_Doc,
                doc.Name,
                doc.Surname,
            };

            return(res);
        }