public static DishesCollection cloneFromListDishes(List <Dish> dises) { DishesCollection collectionDishes = new DishesCollection(); foreach (var dish in dises) { collectionDishes.Add(dish); } return(collectionDishes); }
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); }
public static List <Dish> SetDescendingPositionAccordingToDate(DishesCollection dishes) { return(dishes.OrderByDescending(c => Convert.ToDateTime(c.DateCreate)).ToList()); }
public static List <Dish> SetDescendingPositionAccordingToName(DishesCollection dishes) { return(dishes.OrderByDescending(c => c.Name).ToList()); }
public static List <Dish> SetDefaultPosition(DishesCollection dishes) { return(dishes.OrderBy(c => c.DishCode).ToList()); }