public DataTable GetAll() { using (var db = new ClinicDB()) { return(db.MedicalRecord.ToDataTable()); } }
public MedicalRecord GetByMedicalRecordID(int medicalRecordID) { using (var db = new ClinicDB()) { return(db.MedicalRecord.Find(medicalRecordID)); } }
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()); } }
public Service GetByServiceID(int serviceID) { using (var db = new ClinicDB()) { return(db.Service.Find(serviceID)); } }
public DataTable GetAll() { using (var db = new ClinicDB()) { return(db.Permission.ToDataTable()); } }
public System.Data.DataTable GetAll() { using (var db = new ClinicDB()) { return(db.PharmacyType.ToDataTable()); } }
public Queue GetQueueById(int queueID) { using (var db = new ClinicDB()) { return(db.Queue.Find(queueID)); } }
public UserGroup GetByUserGroupID(int userGroupID) { using (var db = new ClinicDB()) { return(db.UserGroup.Find(userGroupID)); } }
public Prescription GetByPrescriptionID(int prescriptionID) { using (var db = new ClinicDB()) { return(db.Prescription.Find(prescriptionID)); } }
public Patient GetById(int id) { using (var db = new ClinicDB()) { return(db.Patient.Find(id)); } }
public DataTable GetAll() { using (var db = new ClinicDB()) { return(db.ServiceDetail.ToDataTable()); } }
public DataTable GetAll() { using (var db = new ClinicDB()) { return(db.MedicineType.ToDataTable()); } }
public DataTable GetAll() { using (var db = new ClinicDB()) { return(db.Unit.ToDataTable()); } }
public DataTable GetAll() { using (var db = new ClinicDB()) { return(db.PrescriptionDetail.ToDataTable()); } }
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); }
// 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()); } }
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()); } }
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()); } }
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()); } }
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()); } }
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); } }
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); } }
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()); } }
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()); } }
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()); } }
// 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()); } }
// 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()); } }
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()); } }
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()); } }
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()); } }