예제 #1
0
        public List <eExaminationResult> getAllExaminationResultByDispenser()
        {
            List <eExaminationResult> ls = new List <eExaminationResult>();

            foreach (ExaminationResult record in erdal.getAllExaminationResultByDispenser())
            {
                eExaminationResult temp = new eExaminationResult();
                temp.Description = record.Description;
                Employee  result = empdal.getOneEmployee(record.DoctorID);
                eEmployee e      = new eEmployee();
                e.Active                 = result.Active;
                e.Address                = result.Address;
                e.BirthDay               = result.BirthDay.ToString("yyyy-MM-dd");
                e.FirstName              = result.FirstName;
                e.Gender                 = result.Gender;
                e.IdentifyCard           = result.IdentifyCard;
                e.LastName               = result.LastName;
                e.MiddleName             = result.MiddleName;
                e.Phone                  = result.Phone;
                e.Position               = result.Position;
                e.IdentifyCard           = result.IdentifyCard;
                e.EmployeeID             = result.EmployeeID;
                temp.Doctor              = e;
                temp.ExaminationResultID = record.ExaminationResultID;
                ePatient tem = new ePatient();
                Patient  p   = patientdal.getOnePatient(record.PatientID);
                tem.FirstName  = p.FirstName;
                tem.LastName   = p.LastName;
                tem.MiddleName = p.MiddleName;
                temp.Patient   = tem;
                temp.Time      = record.Time.ToShortDateString();
                temp.Result    = record.Result;
                List <ePrescriptionDetail> lspd = new List <ePrescriptionDetail>();
                foreach (PrescriptionDetail pd in presdal.getAllPrescriptionDetail(record.ExaminationResultID))
                {
                    ePrescriptionDetail temp1 = new ePrescriptionDetail();
                    temp1.Day                  = pd.Day;
                    temp1.Description          = pd.Description;
                    temp1.Dosage               = pd.Dosage;
                    temp1.DrugID               = pd.DrugID;
                    temp1.DrugName             = drugdal.getOneDrug(pd.DrugID).Name;
                    temp1.ExaminationResultID  = pd.ExaminationResultID;
                    temp1.PrescriptionDetailID = pd.PrescriptionDetailID;
                    temp1.Price                = Convert.ToDouble(pd.Price);
                    temp1.Quantity             = pd.Quantity;
                    temp1.Usage                = pd.Usage;

                    lspd.Add(temp1);
                }
                temp.listpd = lspd;
                ls.Add(temp);
            }
            return(ls);
        }
예제 #2
0
        public List <eExaminationResult> getAllExaminationResult()
        {
            List <eExaminationResult> ls = new List <eExaminationResult>();

            foreach (ExaminationResult record in erdal.getAllExaminationResult())
            {
                eExaminationResult temp = new eExaminationResult();
                temp.Description = record.Description;
                Employee  result = empdal.getOneEmployee(record.DoctorID);
                eEmployee e      = new eEmployee();
                e.Active                 = result.Active;
                e.Address                = result.Address;
                e.BirthDay               = result.BirthDay;
                e.FirstName              = result.FirstName;
                e.Gender                 = result.Gender;
                e.IdentifyCard           = result.IdentifyCard;
                e.LastName               = result.LastName;
                e.MiddleName             = result.MiddleName;
                e.Phone                  = result.Phone;
                e.Position               = result.Position;
                e.IdentifyCard           = result.IdentifyCard;
                e.EmployeeID             = result.EmployeeID;
                temp.Doctor              = e;
                temp.ExaminationResultID = record.ExaminationResultID;
                result         = empdal.getOneEmployee(Convert.ToInt32(record.DispenserID));
                e.Active       = result.Active;
                e.Address      = result.Address;
                e.BirthDay     = result.BirthDay;
                e.FirstName    = result.FirstName;
                e.Gender       = result.Gender;
                e.IdentifyCard = result.IdentifyCard;
                e.LastName     = result.LastName;
                e.MiddleName   = result.MiddleName;
                e.Phone        = result.Phone;
                e.Position     = result.Position;
                e.IdentifyCard = result.IdentifyCard;
                e.EmployeeID   = result.EmployeeID;
                temp.Dispenser = e;
                ePatient tem = new ePatient();
                Patient  p   = patientdal.getOnePatient(record.PatientID);
                tem.FirstName  = p.FirstName;
                tem.LastName   = p.LastName;
                tem.MiddleName = p.MiddleName;
                temp.Patient   = tem;
                temp.Time      = record.Time;
                temp.Result    = record.Result;

                ls.Add(temp);
            }
            return(ls);
        }
예제 #3
0
        public eExaminationResult getOneExaminationResult(int id)
        {
            var result = erdal.getOneExaminationResult(id);
            eExaminationResult temp = new eExaminationResult();

            temp.Description         = result.Description;
            temp.DispenserID         = Convert.ToInt32(result.DispenserID);
            temp.DoctorID            = result.DoctorID;
            temp.ExaminationResultID = result.ExaminationResultID;
            temp.PatientID           = result.PatientID;
            temp.Time   = result.Time;
            temp.Result = result.Result;
            return(temp);
        }
예제 #4
0
 public bool updateExaminationResult(eExaminationResult e)
 {
     try
     {
         ExaminationResult temp = new ExaminationResult();
         temp.Description         = e.Description;
         temp.DispenserID         = Convert.ToInt32(e.DispenserID);
         temp.DoctorID            = e.DoctorID;
         temp.ExaminationResultID = e.ExaminationResultID;
         temp.PatientID           = e.PatientID;
         temp.Time   = e.Time;
         temp.Result = e.Result;
         erdal.updateExaminationResult(temp);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
예제 #5
0
 public int insertExaminationResult(eExaminationResult e)
 {
     try
     {
         ExaminationResult temp = new ExaminationResult();
         temp.Description = e.Description;
         temp.DispenserID = null;
         temp.DoctorID    = e.DoctorID;
         temp.PatientID   = e.PatientID;
         temp.Time        = DateTime.Now;
         temp.Result      = e.Result;
         int           id  = erdal.insertExaminationResult(temp);
         PartientOfDay pod = new PartientOfDay();
         pod.PartientID = temp.PatientID;
         pod.Status     = true;
         potdal.updatePartientOfDay(pod);
         return(id);
     }
     catch
     {
         return(0);
     }
 }