Exemplo n.º 1
0
 public static List <DoanDL> GetAllDoanDL()
 {
     using (var db = new tourEntities())
     {
         return(db.DoanDLs.ToList <DoanDL>());
     }
 }
Exemplo n.º 2
0
 public static void Delete(DiaDiem diadiem)
 {
     using (var db = new tourEntities())
     {
         db.Entry(diadiem).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
Exemplo n.º 3
0
 public static List <Nguoi> getNhanVien()
 {
     using (var db = new tourEntities())
     {
         var result = from c in db.Nguois where c.MaVaiTro == 2 select c;
         return(result.ToList <Nguoi>());
     }
 }
Exemplo n.º 4
0
 public static void Update(Nguoi nguoi)
 {
     using (var db = new tourEntities())
     {
         db.Entry(nguoi).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 5
0
 public static void Insert(CTTour cttour)
 {
     using (var db = new tourEntities())
     {
         db.CTTours.Add(cttour);
         db.SaveChanges();
     }
 }
Exemplo n.º 6
0
 public static List <DoanDL> GetDoanByBatDau(DateTime dateTimeBD, DateTime dateTimeKT)
 {
     using (var db = new tourEntities())
     {
         var result = from c in db.DoanDLs where c.KhoiHanh >= dateTimeBD && c.KhoiHanh <= dateTimeKT select c;
         return(result.ToList <DoanDL>());
     }
 }
Exemplo n.º 7
0
 public static List <CTDoan> GetCTDoanByDoan(DoanDL doanDL)
 {
     using (var db = new tourEntities())
     {
         var result = from c in db.CTDoans where c.MaDoan == doanDL.Id select c;
         return(result.ToList <CTDoan>());
     }
 }
Exemplo n.º 8
0
 public static void Update(DoanDL doanDL)
 {
     using (var db = new tourEntities())
     {
         db.Entry <DoanDL>(doanDL).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 9
0
 public static List <LoaiCP> GetAllLoaiCP()
 {
     using (var db = new tourEntities())
     {
         var result = (from c in db.LoaiCPs select c);
         return(result.ToList <LoaiCP>());
     }
 }
Exemplo n.º 10
0
 public static void Update(LoaiCP loaiCP)
 {
     using (var db = new tourEntities())
     {
         db.Entry(loaiCP).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 11
0
 public static void Insert(LoaiCP loaiCP)
 {
     using (var db = new tourEntities())
     {
         db.LoaiCPs.Add(loaiCP);
         db.SaveChanges();
     }
 }
Exemplo n.º 12
0
 public static DoanDL GetDoanByChiPhi(ChiPhi chiphi)
 {
     using (var db = new tourEntities())
     {
         var result = from c in db.DoanDLs where c.Id == chiphi.MaDoan select c;
         return(result.ToList <DoanDL>().FirstOrDefault());
     }
 }
Exemplo n.º 13
0
 public static List <ChiPhi> GetChiPhiByLoaiCP(LoaiCP loaicp)
 {
     using (var db = new tourEntities())
     {
         var result = (from c in db.ChiPhis where c.LoaiChiPhi == loaicp.Id select c);
         return(result.ToList <ChiPhi>());
     }
 }
Exemplo n.º 14
0
 public static List <ChiPhi> GetChiPhiDoan(DoanDL doanDL)
 {
     using (var db = new tourEntities())
     {
         var result = (from c in db.ChiPhis where  c.MaDoan == doanDL.Id select c);
         return(result.ToList <ChiPhi>());
     }
 }
Exemplo n.º 15
0
 public static void Insert(ChiPhi chiPhi)
 {
     using (var db = new tourEntities())
     {
         db.ChiPhis.Add(chiPhi);
         db.SaveChanges();
     }
 }
Exemplo n.º 16
0
 public String GetTenChiPhiById(int Id)
 {
     using (var db = new tourEntities())
     {
         var result = from c in db.LoaiCPs where c.Id == Id select c.Ten;
         return(result.First().Trim());
     }
 }
Exemplo n.º 17
0
 public static void Insert(DoanDL doanDL)
 {
     using (var db = new tourEntities())
     {
         db.DoanDLs.Add(doanDL);
         db.SaveChanges();
     }
 }
Exemplo n.º 18
0
 public static List <Tour> getAllTour()
 {
     using (var db = new tourEntities())
     {
         var result = db.Tours.ToList <Tour>();
         return(result);
     }
 }
Exemplo n.º 19
0
 public static void Delete(DoanDL doanDL)
 {
     using (var db = new tourEntities())
     {
         db.Entry(doanDL).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
Exemplo n.º 20
0
 public static List <DoanDL> GetDoanDLCuaTour(Tour tour)
 {
     using (var db = new tourEntities())
     {
         var result = from c in db.DoanDLs where c.MaTour == tour.Id select c;
         return(result.ToList <DoanDL>());
     }
 }
Exemplo n.º 21
0
 public static List <Nguoi> GetNhanVienFromDoan(DoanDL doanDL)
 {
     using (var db = new tourEntities())
     {
         var result = from c in db.CTDoans join n in db.Nguois on c.MaNguoiThamGia equals n.Id where n.MaVaiTro == 2 select n;
         return(result.ToList <Nguoi>());
     }
 }
Exemplo n.º 22
0
 public static Tour getTourById(int Id)
 {
     using (var db = new tourEntities())
     {
         Tour result = (from c in db.Tours where c.Id == Id select c).First();
         return(result);
     }
 }
Exemplo n.º 23
0
 public static void Update(CTTour cttour)
 {
     using (var db = new tourEntities())
     {
         db.Entry(cttour).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 24
0
 public static int getMaxIdTour()
 {
     using (var db = new tourEntities())
     {
         var result = (from c in db.Tours select c).Max(c => c.Id);
         return(int.Parse(result.ToString()));
     }
 }
Exemplo n.º 25
0
 public static void Insert(Nguoi nguoi)
 {
     using (var db = new tourEntities())
     {
         db.Nguois.Add(nguoi);
         db.SaveChanges();
     }
 }
Exemplo n.º 26
0
 public static void Delete(Tour tour)
 {
     using (var db = new tourEntities())
     {
         db.Entry(tour).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
Exemplo n.º 27
0
 public static Nguoi GetNguoiById(int Id)
 {
     using (var db = new tourEntities())
     {
         var result = from c in db.Nguois where c.Id == Id select c;
         return((Nguoi)result.FirstOrDefault());
     }
 }
Exemplo n.º 28
0
 public static List <Gia> GetGiaByTour(Tour tour)
 {
     using (var db = new tourEntities())
     {
         var result = from c in db.Gias where c.MaTour == tour.Id select c;
         return(result.ToList <Gia>());
     }
 }
Exemplo n.º 29
0
 public static List <Nguoi> getAll()
 {
     using (var db = new tourEntities())
     {
         var result = from c in db.Nguois select c;
         return(result.ToList <Nguoi>());
     }
 }
Exemplo n.º 30
0
 public static void Insert(DiaDiem diadiem)
 {
     using (var db = new tourEntities())
     {
         db.DiaDiems.Add(diadiem);
         db.SaveChanges();
     }
 }