示例#1
0
 public static List <DoanDL> GetAllDoanDL()
 {
     using (var db = new tourEntities())
     {
         return(db.DoanDLs.ToList <DoanDL>());
     }
 }
示例#2
0
 public static void Delete(DiaDiem diadiem)
 {
     using (var db = new tourEntities())
     {
         db.Entry(diadiem).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
示例#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>());
     }
 }
示例#4
0
 public static void Update(Nguoi nguoi)
 {
     using (var db = new tourEntities())
     {
         db.Entry(nguoi).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
示例#5
0
 public static void Insert(CTTour cttour)
 {
     using (var db = new tourEntities())
     {
         db.CTTours.Add(cttour);
         db.SaveChanges();
     }
 }
示例#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>());
     }
 }
示例#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>());
     }
 }
示例#8
0
 public static void Update(DoanDL doanDL)
 {
     using (var db = new tourEntities())
     {
         db.Entry <DoanDL>(doanDL).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
示例#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>());
     }
 }
示例#10
0
 public static void Update(LoaiCP loaiCP)
 {
     using (var db = new tourEntities())
     {
         db.Entry(loaiCP).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
示例#11
0
 public static void Insert(LoaiCP loaiCP)
 {
     using (var db = new tourEntities())
     {
         db.LoaiCPs.Add(loaiCP);
         db.SaveChanges();
     }
 }
示例#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());
     }
 }
示例#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>());
     }
 }
示例#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>());
     }
 }
示例#15
0
 public static void Insert(ChiPhi chiPhi)
 {
     using (var db = new tourEntities())
     {
         db.ChiPhis.Add(chiPhi);
         db.SaveChanges();
     }
 }
示例#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());
     }
 }
示例#17
0
 public static void Insert(DoanDL doanDL)
 {
     using (var db = new tourEntities())
     {
         db.DoanDLs.Add(doanDL);
         db.SaveChanges();
     }
 }
示例#18
0
 public static List <Tour> getAllTour()
 {
     using (var db = new tourEntities())
     {
         var result = db.Tours.ToList <Tour>();
         return(result);
     }
 }
示例#19
0
 public static void Delete(DoanDL doanDL)
 {
     using (var db = new tourEntities())
     {
         db.Entry(doanDL).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
示例#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>());
     }
 }
示例#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>());
     }
 }
示例#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);
     }
 }
示例#23
0
 public static void Update(CTTour cttour)
 {
     using (var db = new tourEntities())
     {
         db.Entry(cttour).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
示例#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()));
     }
 }
示例#25
0
 public static void Insert(Nguoi nguoi)
 {
     using (var db = new tourEntities())
     {
         db.Nguois.Add(nguoi);
         db.SaveChanges();
     }
 }
示例#26
0
 public static void Delete(Tour tour)
 {
     using (var db = new tourEntities())
     {
         db.Entry(tour).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
示例#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());
     }
 }
示例#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>());
     }
 }
示例#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>());
     }
 }
示例#30
0
 public static void Insert(DiaDiem diadiem)
 {
     using (var db = new tourEntities())
     {
         db.DiaDiems.Add(diadiem);
         db.SaveChanges();
     }
 }