Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public ePrescriptionDetail getOnePrescriptionDetail(int id)
        {
            var result = presdal.getOnePrescriptionDetail(id);
            ePrescriptionDetail temp = new ePrescriptionDetail();

            temp.Day                  = result.Day;
            temp.Description          = result.Description;
            temp.Dosage               = result.Dosage;
            temp.DrugID               = result.DrugID;
            temp.ExaminationResultID  = result.ExaminationResultID;
            temp.PrescriptionDetailID = result.PrescriptionDetailID;
            temp.Price                = Convert.ToDouble(result.Price);
            temp.Quantity             = result.Quantity;
            temp.Usage                = result.Usage;

            return(temp);
        }
Exemplo n.º 3
0
        public List <ePrescriptionDetail> getAllPrescriptionDetail()
        {
            List <ePrescriptionDetail> ls = new List <ePrescriptionDetail>();

            foreach (PrescriptionDetail record in presdal.getAllPrescriptionDetail())
            {
                ePrescriptionDetail temp = new ePrescriptionDetail();
                temp.Day                  = record.Day;
                temp.Description          = record.Description;
                temp.Dosage               = record.Dosage;
                temp.DrugID               = record.DrugID;
                temp.ExaminationResultID  = record.ExaminationResultID;
                temp.PrescriptionDetailID = record.PrescriptionDetailID;
                temp.Price                = Convert.ToDouble(record.Price);
                temp.Quantity             = record.Quantity;
                temp.Usage                = record.Usage;

                ls.Add(temp);
            }
            return(ls);
        }
Exemplo n.º 4
0
 public bool updatePrescriptionDetail(ePrescriptionDetail e)
 {
     try
     {
         PrescriptionDetail temp = new PrescriptionDetail();
         temp.Day                  = e.Day;
         temp.Description          = e.Description;
         temp.Dosage               = e.Dosage;
         temp.DrugID               = e.DrugID;
         temp.ExaminationResultID  = e.ExaminationResultID;
         temp.PrescriptionDetailID = e.PrescriptionDetailID;
         temp.Price                = Convert.ToDecimal(e.Price);
         temp.Quantity             = e.Quantity;
         temp.Usage                = e.Usage;
         presdal.updatePrescriptionDetail(temp);
         return(true);
     }
     catch
     {
         return(false);
     }
 }