Ejemplo n.º 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;
     }
 }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 4
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;
 }
Ejemplo n.º 5
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;
     }
 }
Ejemplo n.º 6
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;
     }
 }
Ejemplo n.º 7
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;
     }
 }
Ejemplo n.º 8
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;
     }
 }
Ejemplo n.º 9
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;
     }
 }
Ejemplo n.º 10
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;
     }
 }
Ejemplo n.º 11
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;
     }
 }
Ejemplo n.º 12
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;
     }
 }
Ejemplo n.º 13
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;
     }
 }
Ejemplo n.º 14
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;
     }
 }
Ejemplo n.º 15
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;
     }
 }