コード例 #1
0
 public DataTable GetAll()
 {
     using (var db = new ClinicDB())
     {
         return(db.MedicalRecord.ToDataTable());
     }
 }
コード例 #2
0
 public MedicalRecord GetByMedicalRecordID(int medicalRecordID)
 {
     using (var db = new ClinicDB())
     {
         return(db.MedicalRecord.Find(medicalRecordID));
     }
 }
コード例 #3
0
 public DataTable GetByStatus(string status)
 {
     using (var db = new ClinicDB())
     {
         var notPaymentTB = from notpm in db.MedicalRecord
                            join patient in db.Patient on notpm.PatientID equals patient.PatientID
                            where notpm.Status == status
                            select new
         {
             notpm.MedicalRecordID,
             notpm.PatientID,
             notpm.DoctorID,
             notpm.ExamineReason,
             notpm.Diagnostic,
             notpm.Note,
             notpm.ExamineDate,
             notpm.ReExamineDate,
             notpm.Status,
             patient.FullName,
             patient.Gender,
             patient.DateOfBirth
         };
         return(notPaymentTB.ToDataTable());
     }
 }
コード例 #4
0
 public Service GetByServiceID(int serviceID)
 {
     using (var db = new ClinicDB())
     {
         return(db.Service.Find(serviceID));
     }
 }
コード例 #5
0
 public DataTable GetAll()
 {
     using (var db = new ClinicDB())
     {
         return(db.Permission.ToDataTable());
     }
 }
コード例 #6
0
 public System.Data.DataTable GetAll()
 {
     using (var db = new ClinicDB())
     {
         return(db.PharmacyType.ToDataTable());
     }
 }
コード例 #7
0
 public Queue GetQueueById(int queueID)
 {
     using (var db = new ClinicDB())
     {
         return(db.Queue.Find(queueID));
     }
 }
コード例 #8
0
 public UserGroup GetByUserGroupID(int userGroupID)
 {
     using (var db = new ClinicDB())
     {
         return(db.UserGroup.Find(userGroupID));
     }
 }
コード例 #9
0
 public Prescription GetByPrescriptionID(int prescriptionID)
 {
     using (var db = new ClinicDB())
     {
         return(db.Prescription.Find(prescriptionID));
     }
 }
コード例 #10
0
 public Patient GetById(int id)
 {
     using (var db = new ClinicDB())
     {
         return(db.Patient.Find(id));
     }
 }
コード例 #11
0
 public DataTable GetAll()
 {
     using (var db = new ClinicDB())
     {
         return(db.ServiceDetail.ToDataTable());
     }
 }
コード例 #12
0
 public DataTable GetAll()
 {
     using (var db = new ClinicDB())
     {
         return(db.MedicineType.ToDataTable());
     }
 }
コード例 #13
0
 public DataTable GetAll()
 {
     using (var db = new ClinicDB())
     {
         return(db.Unit.ToDataTable());
     }
 }
コード例 #14
0
 public DataTable GetAll()
 {
     using (var db = new ClinicDB())
     {
         return(db.PrescriptionDetail.ToDataTable());
     }
 }
コード例 #15
0
        public DataTable GetByCondition(string name, DateTime dateOfBirth, string gender)
        {
            var result = new DataTable();

            using (var db = new ClinicDB())
            {
                if (name == "" && dateOfBirth != null && gender == "Tất cả")

                {
                    var patient = from p in db.Patient
                                  where p.DateOfBirth == dateOfBirth
                                  select p;
                    result = patient.ToDataTable();
                }
                if (name != "" && dateOfBirth != null && gender == "Tất cả")
                {
                    var patient = from p in db.Patient
                                  where p.DateOfBirth == dateOfBirth && p.FullName.Contains(name)
                                  select p;
                    result = patient.ToDataTable();
                }
                if (name == "" && dateOfBirth != null && gender != "Tất cả")
                {
                    var patient = from p in db.Patient
                                  where p.DateOfBirth == dateOfBirth && p.Gender == gender
                                  select p;
                    result = patient.ToDataTable();
                }
                if (name != "" && dateOfBirth != null && gender != "Tất cả")
                {
                    var patient = from p in db.Patient
                                  where p.DateOfBirth == dateOfBirth && p.Gender == gender && p.FullName.Contains(name)
                                  select p;
                    result = patient.ToDataTable();
                }
                if (name == "" && dateOfBirth == DateTime.Today && gender != "Tất cả")
                {
                    var patient = from p in db.Patient
                                  where  p.Gender == gender
                                  select p;
                    result = patient.ToDataTable();
                }
                if (name != "" && dateOfBirth == DateTime.Today && gender == "Tất cả")
                {
                    var patient = from p in db.Patient
                                  where p.FullName.Contains(name)
                                  select p;
                    result = patient.ToDataTable();
                }
                if (name != "" && dateOfBirth == DateTime.Today && gender != "Tất cả")
                {
                    var patient = from p in db.Patient
                                  where p.FullName.Contains(name) && p.Gender == gender
                                  select p;
                    result = patient.ToDataTable();
                }
            }
            return(result);
        }
コード例 #16
0
 // Get all orderby CreateDate desc
 public DataTable GetAll()
 {
     using (var db = new ClinicDB())
     {
         var result = from d in db.Patient orderby d.PatientID descending select d;
         return(result.ToDataTable());
     }
 }
コード例 #17
0
 public User GetByUserName(string username)
 {
     using (var db = new ClinicDB())
     {
         var query = from user in db.User
                     where user.Username == username
                     select user;
         return(query.FirstOrDefault());
     }
 }
コード例 #18
0
 public DataTable GetByCondition(DateTime dateForm, DateTime dateTo)
 {
     using (var db = new ClinicDB())
     {
         var schedule = from sch in db.Schedule
                        where sch.ScheduleDate >= dateForm && sch.ScheduleDate <= dateTo
                        select sch;
         return(schedule.ToDataTable());
     }
 }
コード例 #19
0
 public DataTable GetAllWithUnit()
 {
     using (var db = new ClinicDB())
     {
         var query = from m in db.Medicine
                     join u in db.Unit on m.UnitID equals u.UnitID
                     select new { m.MedicineID, m.MedicineName, u.UnitName };
         return(query.ToDataTable());
     }
 }
コード例 #20
0
 public Medicine GetByMedicineID(int medicineID)
 {
     using (var db = new ClinicDB())
     {
         var query = from m in db.Medicine
                     where m.MedicineID == medicineID
                     select m;
         return(query.First());
     }
 }
コード例 #21
0
 public decimal GetMedicineFee(int medicalReordID)
 {
     using (var db = new ClinicDB())
     {
         var fees = from prescription in db.Prescription
                    where prescription.MedicalRecordID == medicalReordID
                    select prescription;
         var totalFee = fees.Sum(f => f.Amount);
         return(totalFee);
     }
 }
コード例 #22
0
 public decimal GetTotalFee(int medicalReordID)
 {
     using (var db = new ClinicDB())
     {
         var fees = from svd in db.ServiceDetail
                    where svd.MedicalRecordID == medicalReordID
                    select svd;
         var fee = fees.Sum(f => f.ServiceFee);
         return(fee);
     }
 }
コード例 #23
0
        public DataTable GetByMedicalRecordID(int medicalRecordID)
        {
            using (var db = new ClinicDB())
            {
                var query = from sd in db.ServiceDetail
                            where sd.MedicalRecordID == medicalRecordID
                            select sd;

                return(query.ToDataTable());
            }
        }
コード例 #24
0
 public DataTable GetbyId(int medicalRecordID)
 {
     using (var db = new ClinicDB())
     {
         var serviceDt = from svd in db.ServiceDetail
                         join service in db.Service on svd.ServiceID equals service.ServiceID
                         where svd.MedicalRecordID == medicalRecordID
                         select new { svd.ServiceID, service.ServiceName, svd.ServiceFee };
         return(serviceDt.ToDataTable());
     }
 }
コード例 #25
0
 public DataTable GetAllDoctor()
 {
     using (var db = new ClinicDB())
     {
         var query = from user in db.User
                     join userGroup in db.UserGroup on user.UserGroupID equals userGroup.UserGroupID
                     where userGroup.UserGroupName == "Doctor"
                     select user;
         return(query.ToDataTable());
     }
 }
コード例 #26
0
        // Chose all medicin with type
        public DataTable GetByCondition(int medicineTypeID)
        {
            using (var db = new ClinicDB())
            {
                var medicine = from b in db.Medicine
                               where (b.MedicineTypeID == medicineTypeID)
                               select b;

                return(medicine.ToDataTable());
            }
        }
コード例 #27
0
        // Chose all Tpye ( lookup null)
        public DataTable GetByCondition(string medicineName)
        {
            using (var db = new ClinicDB())
            {
                var medicine = from b in db.Medicine
                               where (b.MedicineName.Contains(medicineName))
                               select b;

                return(medicine.ToDataTable());
            }
        }
コード例 #28
0
 public DataTable GetByCondition(string medicineName, int medicineTypeID)
 {
     using (var db = new ClinicDB())
     {
         var medicine = from b in db.Medicine
                        where (b.MedicineName.Contains(medicineName) && b.MedicineTypeID == medicineTypeID)
                        //b.MedicineName.Contains(medicineName) is query same LIKE query
                        select b;
         return(medicine.ToDataTable());
     }
 }
コード例 #29
0
 public DataTable GetByPrescriptionID(int id)
 {
     using (var db = new ClinicDB())
     {
         var prescription = from pret in db.PrescriptionDetail
                            join m in db.Medicine on pret.MedicineID equals m.MedicineID
                            join Service in db.Service on pret.MedicineID equals Service.ServiceID
                            where pret.PrescriptionID == id
                            select new { pret.MedicineID, m.MedicineName, pret.Quantity, Service.ServiceName, pret.HowToUse };
         return(prescription.ToDataTable());
     }
 }
コード例 #30
0
        public DataTable GetAllWithUserGroupName()
        {
            using (var db = new ClinicDB())
            {
                var query = from u in db.User
                            join ug in db.UserGroup on u.UserGroupID equals ug.UserGroupID
                            select new { u.Username, u.UserID, u.UserGroupID, u.Password,
                                         u.FullName, u.Email, u.DateOfBirth, u.Address, ug.UserGroupName };

                return(query.ToDataTable());
            }
        }