public lichsugiatour find(int value) { lichsugiatour a = new lichsugiatour(); a = lichsu.Find(c => c.idtour == value).OrderByDescending(c => c.id).FirstOrDefault(); return(a); }
public void capnhatgiatour(tour tourcapnhatgia) { lichsugiatour lsgt = new lichsugiatour(); lsgt = find(tourcapnhatgia.id); if (lsgt.giatour != tourcapnhatgia.giatour) { lsgt.ngayketthuc = tourcapnhatgia.ngaycapnhat; update(lsgt); lichsugiatour ls = new lichsugiatour(); ls.idtour = tourcapnhatgia.id; ls.giatour = tourcapnhatgia.giatour; ls.ngaybatdau = tourcapnhatgia.ngaycapnhat; ls.ngayketthuc = null; add(ls); } }
public bool update(lichsugiatour entity) { return(lichsu.Attach(entity)); }
public bool add(lichsugiatour entity) { return(lichsu.Add(entity)); }