示例#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());
 }