示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
文件: Trips.cs 项目: thaimoc/ETour
 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;
     }));
 }
示例#4
0
文件: Trips.cs 项目: thaimoc/ETour
 public Chuyen Single(int code)
 {
     if (List == null)
     {
         List = Chuyen.All();
     }
     return(List.Find(delegate(Chuyen t) {
         return t.MChuyen == code;
     }));
 }
示例#5
0
文件: Trips.cs 项目: thaimoc/ETour
 public List <Chuyen> FindByCodeTour(int _tourCode)
 {
     if (List == null)
     {
         List = Chuyen.All();
     }
     return(List.FindAll(delegate(Chuyen t)
     {
         return t.MTour == _tourCode;
     }));
 }
示例#6
0
文件: Trips.cs 项目: thaimoc/ETour
 public List <Chuyen> FindByStatus(int _status)
 {
     if (List == null)
     {
         List = Chuyen.All();
     }
     return(List.FindAll(delegate(Chuyen t)
     {
         return t.TrangThai == _status;
     }));
 }
示例#7
0
文件: Trips.cs 项目: thaimoc/ETour
 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);
 }
示例#8
0
文件: Trips.cs 项目: thaimoc/ETour
        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);
        }
示例#9
0
        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);
        }
示例#10
0
文件: Trips.cs 项目: thaimoc/ETour
 public Trips()
 {
     List = new List <Chuyen>();
     List = Chuyen.All();
 }
示例#11
0
        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);
        }
示例#12
0
        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));
        }