public static List <DoanDL> GetAllDoanDL() { using (var db = new tourEntities()) { return(db.DoanDLs.ToList <DoanDL>()); } }
public static void Delete(DiaDiem diadiem) { using (var db = new tourEntities()) { db.Entry(diadiem).State = EntityState.Deleted; db.SaveChanges(); } }
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>()); } }
public static void Update(Nguoi nguoi) { using (var db = new tourEntities()) { db.Entry(nguoi).State = EntityState.Modified; db.SaveChanges(); } }
public static void Insert(CTTour cttour) { using (var db = new tourEntities()) { db.CTTours.Add(cttour); db.SaveChanges(); } }
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>()); } }
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>()); } }
public static void Update(DoanDL doanDL) { using (var db = new tourEntities()) { db.Entry <DoanDL>(doanDL).State = EntityState.Modified; db.SaveChanges(); } }
public static List <LoaiCP> GetAllLoaiCP() { using (var db = new tourEntities()) { var result = (from c in db.LoaiCPs select c); return(result.ToList <LoaiCP>()); } }
public static void Update(LoaiCP loaiCP) { using (var db = new tourEntities()) { db.Entry(loaiCP).State = EntityState.Modified; db.SaveChanges(); } }
public static void Insert(LoaiCP loaiCP) { using (var db = new tourEntities()) { db.LoaiCPs.Add(loaiCP); db.SaveChanges(); } }
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()); } }
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>()); } }
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>()); } }
public static void Insert(ChiPhi chiPhi) { using (var db = new tourEntities()) { db.ChiPhis.Add(chiPhi); db.SaveChanges(); } }
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()); } }
public static void Insert(DoanDL doanDL) { using (var db = new tourEntities()) { db.DoanDLs.Add(doanDL); db.SaveChanges(); } }
public static List <Tour> getAllTour() { using (var db = new tourEntities()) { var result = db.Tours.ToList <Tour>(); return(result); } }
public static void Delete(DoanDL doanDL) { using (var db = new tourEntities()) { db.Entry(doanDL).State = EntityState.Deleted; db.SaveChanges(); } }
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>()); } }
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>()); } }
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); } }
public static void Update(CTTour cttour) { using (var db = new tourEntities()) { db.Entry(cttour).State = EntityState.Modified; db.SaveChanges(); } }
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())); } }
public static void Insert(Nguoi nguoi) { using (var db = new tourEntities()) { db.Nguois.Add(nguoi); db.SaveChanges(); } }
public static void Delete(Tour tour) { using (var db = new tourEntities()) { db.Entry(tour).State = EntityState.Deleted; db.SaveChanges(); } }
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()); } }
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>()); } }
public static List <Nguoi> getAll() { using (var db = new tourEntities()) { var result = from c in db.Nguois select c; return(result.ToList <Nguoi>()); } }
public static void Insert(DiaDiem diadiem) { using (var db = new tourEntities()) { db.DiaDiems.Add(diadiem); db.SaveChanges(); } }