コード例 #1
0
        public static DishesCollection cloneFromListDishes(List <Dish> dises)
        {
            DishesCollection collectionDishes = new DishesCollection();

            foreach (var dish in dises)
            {
                collectionDishes.Add(dish);
            }
            return(collectionDishes);
        }
コード例 #2
0
        public static DishesCollection GetAllDishes()
        {
            DishesCollection dishes = new DishesCollection();
            DataTable        data   = DishDAO.Instance.getAllDishes();

            foreach (var dish in from DataRow row in data.Rows
                     let dish = new Dish(row)
                                select dish)
            {
                dishes.Add(dish);
            }

            return(dishes);
        }
コード例 #3
0
 public static List <Dish> SetDescendingPositionAccordingToDate(DishesCollection dishes)
 {
     return(dishes.OrderByDescending(c => Convert.ToDateTime(c.DateCreate)).ToList());
 }
コード例 #4
0
 public static List <Dish> SetDescendingPositionAccordingToName(DishesCollection dishes)
 {
     return(dishes.OrderByDescending(c => c.Name).ToList());
 }
コード例 #5
0
 public static List <Dish> SetDefaultPosition(DishesCollection dishes)
 {
     return(dishes.OrderBy(c => c.DishCode).ToList());
 }