Пример #1
0
 public bool DeleteNguoiDungByID(int IDNguoiDung)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     NguoiDung nguoiDung = data.NguoiDungs.Where(i => i.IDNguoiDung == IDNguoiDung).SingleOrDefault();
     data.NguoiDungs.DeleteOnSubmit(nguoiDung);
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
Пример #2
0
 public bool DeleteBenhNhanByID(string IDBenhNhan)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     BenhNhan BenhNhan = data.BenhNhans.Where(i => i.ID == IDBenhNhan).SingleOrDefault();
     data.BenhNhans.DeleteOnSubmit(BenhNhan);
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
Пример #3
0
 public bool DeleteNhomNDByID(int ID)
 {
     DataClassesDataContext dataContext = new DataClassesDataContext(Connection);
     NhomND listPQNhom = dataContext.NhomNDs.Where(i => i.IDNhomND == ID).SingleOrDefault();
     if (listPQNhom != null)
     {
         dataContext.NhomNDs.DeleteOnSubmit(listPQNhom);
         try
         {
             dataContext.SubmitChanges();
             return true;
         }
         catch (Exception)
         {
             return false;
         }
     }
     else
         return true;
 }
Пример #4
0
 public List<CTBenhNhanConditionVertebral> GetDSCTBenhNhanConditionVertebralByIDCTBenhNhan(String idCTBenhNhan)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     return data.CTBenhNhanConditionVertebrals.Where(i => i.IDCTBenhNhan == idCTBenhNhan).ToList();
 }
Пример #5
0
 public bool UpdateNguoiDung(NguoiDung nguoiDung)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     NguoiDung NDOld = data.NguoiDungs.Where(i => i.IDNguoiDung == nguoiDung.IDNguoiDung).SingleOrDefault();
     NDOld.Active = nguoiDung.Active;
     NDOld.DiaChi = nguoiDung.DiaChi;
     NDOld.DienThoai = nguoiDung.DienThoai;
     NDOld.Email = nguoiDung.Email;
     NDOld.IDNhomND = nguoiDung.IDNhomND;
     NDOld.IsAdmin = nguoiDung.IsAdmin;
     NDOld.KhoRole = nguoiDung.KhoRole;
     NDOld.MatKhau = nguoiDung.MatKhau;
     NDOld.Mapb = nguoiDung.Mapb;
     NDOld.TenDangNhap = nguoiDung.TenDangNhap;
     NDOld.TenHienThi = nguoiDung.TenHienThi;
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
Пример #6
0
 public bool InsertPQNhom(PQNhom pqNhom)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     data.PQNhoms.InsertOnSubmit(pqNhom);
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception e)
     {
         return false;
     }
 }
Пример #7
0
 //
 public bool InsertListCTBenhNhanSnapShot(List<CTBenhNhanSnapShot> listCTBenhNhanSnapShot)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     data.CTBenhNhanSnapShots.InsertAllOnSubmit(listCTBenhNhanSnapShot);
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception e)
     {
         return false;
     }
 }
Пример #8
0
 public bool InsertCTBenhNhanMRIImage(CTBenhNhanMRIImage CTBenhNhanMRIImage)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     data.CTBenhNhanMRIImages.InsertOnSubmit(CTBenhNhanMRIImage);
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception e)
     {
         return false;
     }
 }
Пример #9
0
 public List<NhomND> GetListNhomND()
 {
     DataClassesDataContext dataContext = new DataClassesDataContext(Connection);
     var q = dataContext.NhomNDs;
     return q.ToList();
 }
Пример #10
0
 public List<NguoiDung> GetListNguoiDungByNhomND(int IDNhomND)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     var q = data.NguoiDungs.Where(i => i.IDNhomND == IDNhomND);
     return q.ToList();
 }
Пример #11
0
 public List<NguoiDung> GetListNguoiDung()
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     var q = data.NguoiDungs;
     return q.ToList();
 }
Пример #12
0
 public List<BenhNhan> GetListBenhNhan()
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     var q = data.BenhNhans;
     return q.ToList();
 }
Пример #13
0
 public List<sp_GetDSExercisesResult> GetDSExercises()
 {
     DataClassesDataContext dataContext = new DataClassesDataContext(Connection);
     var q = dataContext.sp_GetDSExercises();
     return q.ToList();
 }
Пример #14
0
 public List<sp_GetDSExcerciseByIDCTBNResult> GetDSExcerciseByIDCTBN(string IDCTBN)
 {
     DataClassesDataContext dataContext = new DataClassesDataContext(Connection);
     var q = dataContext.sp_GetDSExcerciseByIDCTBN(IDCTBN);
     return q.ToList();
 }
Пример #15
0
 public List<CTBenhNhanSnapShot> GetDSCTBenhNhanSnapShotByIDCTBenhNhan(String idCTBenhNhan)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     return data.CTBenhNhanSnapShots.Where(i => i.IDCTBenhNhan == idCTBenhNhan).ToList();
 }
Пример #16
0
 public bool InsertCTBenhNhanConditionDicsJoint(CTBenhNhanConditionDicsJoint CTBenhNhanDicsJoint)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     data.CTBenhNhanConditionDicsJoints.InsertOnSubmit(CTBenhNhanDicsJoint);
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception e)
     {
         return false;
     }
 }
Пример #17
0
 public DataTable GetMenu()
 {
     DataClassesDataContext dataContext = new DataClassesDataContext(Connection);
     var q = from p in dataContext.ChucNangs orderby p.SapXep ascending select p;
     DataTable dt = GenericToDataTable.ConvertTo<ChucNang>(q.ToList());
     return dt;
 }
Пример #18
0
 // Lấy danh sách Menu được sử dụng của user đăng nhập
 public DataTable GetMenuByUser(int IDNhomND)
 {
     DataClassesDataContext dataContext = new DataClassesDataContext(Connection);
     var q = from p in dataContext.PQNhoms
             join k in dataContext.ChucNangs on p.IDChucNang equals k.IDChucNang
             where p.IDNhomND == IDNhomND && p.Xem == true
             select p;
     DataTable dt = GenericToDataTable.ConvertTo<PQNhom>(q.ToList());
     return dt;
 }
Пример #19
0
 //
 public bool InsertListCTBenhNhanConditionVertebral(List<CTBenhNhanConditionVertebral> listCTBenhNhanConditionVertebral)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     data.CTBenhNhanConditionVertebrals.InsertAllOnSubmit(listCTBenhNhanConditionVertebral);
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception e)
     {
         return false;
     }
 }
Пример #20
0
 public NguoiDung GetNguoiDungByID(int ID)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     var q = data.NguoiDungs.Where(i => i.IDNguoiDung == ID);
     return q.SingleOrDefault();
 }
Пример #21
0
 public bool InsertNguoiDung(NguoiDung nguoiDung)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     data.NguoiDungs.InsertOnSubmit(nguoiDung);
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception e)
     {
         return false;
     }
 }
Пример #22
0
 public NguoiDung GetNguoiDungByTenND(string tenND)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     var q = data.NguoiDungs.Where(i => i.TenDangNhap == tenND);
     return q.SingleOrDefault();
 }
Пример #23
0
 public bool InsertNhomND(NhomND nhomND)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     data.NhomNDs.InsertOnSubmit(nhomND);
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception e)
     {
         return false;
     }
 }
Пример #24
0
 public NhomND GetNhomND(int id)
 {
     DataClassesDataContext dataContext = new DataClassesDataContext(Connection);
     var q = dataContext.NhomNDs.Where(item => item.IDNhomND == id).SingleOrDefault();
     return q;
 }
Пример #25
0
 public bool UpdateBenhNhan(BenhNhan BenhNhan)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     BenhNhan NDOld = data.BenhNhans.Where(i => i.ID == BenhNhan.ID).SingleOrDefault();
     NDOld.DiaChi = BenhNhan.DiaChi;
     NDOld.ID = BenhNhan.ID;
     NDOld.NgayKhamLanDau = BenhNhan.NgayKhamLanDau;
     NDOld.NgaySinh = BenhNhan.NgaySinh;
     NDOld.SoDT = BenhNhan.SoDT;
     NDOld.TenBN = BenhNhan.TenBN;
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
Пример #26
0
 public List<sp_PQNhomResult> GetPQNhomByIDNhom(int IDNhom)
 {
     DataClassesDataContext dataContext = new DataClassesDataContext(Connection);
     var q = dataContext.sp_PQNhom(IDNhom);
     return q.ToList();
 }
Пример #27
0
 public bool UpdateNhomND(NhomND nhomND)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     NhomND NDOld = data.NhomNDs.Where(i => i.IDNhomND == nhomND.IDNhomND).SingleOrDefault();
     NDOld.IsAdminGroup = nhomND.IsAdminGroup;
     NDOld.Madv = nhomND.Madv;
     NDOld.MoTa = nhomND.MoTa;
     NDOld.Parent = nhomND.Parent;
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
Пример #28
0
 public bool InsertBenhNhan(BenhNhan BenhNhan)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     data.BenhNhans.InsertOnSubmit(BenhNhan);
     try
     {
         data.SubmitChanges();
         return true;
     }
     catch (Exception e)
     {
         return false;
     }
 }
Пример #29
0
 public bool DeletePQNhomByIDNhom(int IDNhomND)
 {
     DataClassesDataContext dataContext = new DataClassesDataContext(Connection);
     List<PQNhom> listPQNhom = dataContext.PQNhoms.Where(i => i.IDNhomND == IDNhomND).ToList();
     if (listPQNhom.Count > 0 && listPQNhom != null)
     {
         dataContext.PQNhoms.DeleteAllOnSubmit(listPQNhom);
         try
         {
             dataContext.SubmitChanges();
             return true;
         }
         catch (Exception)
         {
             return false;
         }
     }
     else
         return true;
 }
Пример #30
0
 public List<CTBenhNhan> GetCTBenhNhanByIDCTBenhNhan(string IDCTBenhNhan)
 {
     DataClassesDataContext data = new DataClassesDataContext(Connection);
     return data.CTBenhNhans.Where(i => i.IDCTBenhNhan == IDCTBenhNhan).ToList();
 }