public static int CompareScenicByTourName(Chuyen a, Chuyen b) { string x = a.TenTour; string y = b.TenTour; //return String.Compare(x, y); return(CompareLength(x, y)); }
public static int CompareScenicByStartPlace(Chuyen a, Chuyen b) { string x = a.XuatPhat; string y = b.XuatPhat; //return String.Compare(x, y); return(CompareLength(x, y)); }
public List <Chuyen> FindByCodeTourAndStatus(int _tourCode, int _status) { if (List == null) { List = Chuyen.All(); } return(List.FindAll(delegate(Chuyen t){ return t.MTour == _tourCode && t.TrangThai == _status; })); }
public Chuyen Single(int code) { if (List == null) { List = Chuyen.All(); } return(List.Find(delegate(Chuyen t) { return t.MChuyen == code; })); }
public List <Chuyen> FindByCodeTour(int _tourCode) { if (List == null) { List = Chuyen.All(); } return(List.FindAll(delegate(Chuyen t) { return t.MTour == _tourCode; })); }
public List <Chuyen> FindByStatus(int _status) { if (List == null) { List = Chuyen.All(); } return(List.FindAll(delegate(Chuyen t) { return t.TrangThai == _status; })); }
private bool Find(Chuyen trip, List <DatCho> orders) { for (int i = 0; i < orders.Count; i++) { if (orders[i].MChuyen == trip.MChuyen) { orders.RemoveAt(i); return(true); } } return(false); }
public List <Chuyen> FindByLessThanPrice(double _price) { List <Chuyen> result = new List <Chuyen>(); if (List == null) { List = Chuyen.All(); } result = List.FindAll(delegate(Chuyen t) { return(t.Gia <= _price); }); IOrderedEnumerable <Chuyen> temp = result.OrderByDescending(x => x.Gia); result = new List <Chuyen>(); foreach (Chuyen item in temp) { result.Add(item); } return(result); }
public List <Tour> Find(List <Chuyen> trips) { List <Tour> result = new List <Tour>(); List <Chuyen> tripscopy = new List <Chuyen>(); foreach (Chuyen item in trips) { Chuyen i = new Chuyen(); i.MTour = item.MTour; tripscopy.Add(i); } foreach (Tour item in List) { if (Find(item, tripscopy)) { result.Add(item); } } return(result); }
public Trips() { List = new List <Chuyen>(); List = Chuyen.All(); }
public static bool Update(Chuyen c) { object rs = DataProvider.Instance.ExecuteNonQuery("Chuyen_Update", c.MChuyen, c.MTour, c.NgayDi, c.NgayVe, c.Gia, c.TrangThai); return(MyConvert.ToInt32(rs) > 0 ? true : false); }
public static int Add(Chuyen c) { object rs = DataProvider.Instance.ExecuteNonQueryWithOutput("@MChuyen", "Chuyen_Add", c.MChuyen, c.MTour, c.NgayDi, c.NgayVe, c.Gia, c.TrangThai); return(MyConvert.ToInt32(rs)); }