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);
        }
Exemple #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);
        }
Exemple #3
0
        public ePatient getOnePatient(int id)
        {
            var      result = patientdal.getOnePatient(id);
            ePatient temp   = new ePatient();

            temp.Address      = result.Address;
            temp.FirstName    = result.FirstName;
            temp.Gender       = Convert.ToBoolean(result.Gender);
            temp.IdentifyCard = result.IdentifyCard;
            temp.LastName     = result.LastName;
            temp.MiddleName   = result.MiddleName;
            temp.PatientID    = result.PatientID;
            temp.Phone        = result.Phone;
            return(temp);
        }
Exemple #4
0
        public List <ePatient> getAllPatient()
        {
            List <ePatient> ls = new List <ePatient>();

            foreach (Patient record in patientdal.getAllPatient())
            {
                ePatient temp = new ePatient();
                temp.Address      = record.Address;
                temp.FirstName    = record.FirstName;
                temp.Gender       = Convert.ToBoolean(record.Gender);
                temp.IdentifyCard = record.IdentifyCard;
                temp.LastName     = record.LastName;
                temp.MiddleName   = record.MiddleName;
                temp.PatientID    = record.PatientID;
                temp.Phone        = record.Phone;
                ls.Add(temp);
            }
            return(ls);
        }
Exemple #5
0
 public bool updatePatient(ePatient e)
 {
     try
     {
         Patient temp = new Patient();
         temp.Address      = e.Address;
         temp.FirstName    = e.FirstName;
         temp.Gender       = Convert.ToBoolean(e.Gender);
         temp.IdentifyCard = e.IdentifyCard;
         temp.LastName     = e.LastName;
         temp.MiddleName   = e.MiddleName;
         temp.PatientID    = e.PatientID;
         temp.Phone        = e.Phone;
         patientdal.updatePatient(temp);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
        public List <ePatient> getPatientOfDaysByDoctorID(int DoctorID)
        {
            List <ePatient> ls = new List <ePatient>();

            foreach (Patient record in potdal.getPatientOfDaysByDoctorID(DoctorID))
            {
                ePatient temp = new ePatient();
                temp.Address      = record.Address;
                temp.FirstName    = record.FirstName;
                temp.Gender       = Convert.ToBoolean(record.Gender);
                temp.IdentifyCard = record.IdentifyCard;
                temp.LastName     = record.LastName;
                temp.MiddleName   = record.MiddleName;
                temp.PatientID    = record.PatientID;
                temp.Phone        = record.Phone;
                PartientOfDay pod = potdal.getOnePartientOfDay(record.PatientID);
                temp.Status = pod.Status.Value;
                ls.Add(temp);
            }
            return(ls);
        }
        public List <ePatient> getAllPatient()
        {
            List <ePatient> ls = new List <ePatient>();

            foreach (Patient record in patientdal.getAllPatient())
            {
                ePatient temp = new ePatient();
                temp.Address      = record.Address;
                temp.FirstName    = record.FirstName;
                temp.Gender       = Convert.ToBoolean(record.Gender);
                temp.IdentifyCard = record.IdentifyCard;
                temp.LastName     = record.LastName;
                temp.MiddleName   = record.MiddleName;
                temp.PatientID    = record.PatientID;
                temp.Phone        = record.Phone;
                PartientOfDay pod = potdal.getOnePartientOfDay(temp.PatientID);
                temp.Number = pod == null ? 0 : pod.Number;
                temp.Room   = pod == null ? "" : roomdal.getOneRoom(pod.RoomID).Room1;
                ls.Add(temp);
            }
            return(ls);
        }
Exemple #8
0
 public ePatientOfDay insertPatient(ePatient e)
 {
     try
     {
         Patient temp = new Patient();
         temp.Address      = e.Address;
         temp.FirstName    = e.FirstName;
         temp.Gender       = Convert.ToBoolean(e.Gender);
         temp.IdentifyCard = e.IdentifyCard;
         temp.LastName     = e.LastName;
         temp.MiddleName   = e.MiddleName;
         temp.PatientID    = e.PatientID;
         temp.Phone        = e.Phone;
         patientdal.insertPatient(temp);
         ePatientOfDay pod = new ePatientOfDay();
         pod = insertPatientOfDay(temp.PatientID);
         return(pod);
     }
     catch
     {
         return(null);
     }
 }