public DishDetailViewModel(IChooseDishesDataService dataService, IMessenger messenger)
            : base(messenger)
        {
            _IChooseDishesDataService = dataService;
            //加载菜品大类
            _DishTypeBig = _IChooseDishesDataService.FindDishTypeByType(0);
            //加载菜品小类
            _DishTypeSmail = new ObservableCollection <DishType>();
            List <DishType> listsmail = _IChooseDishesDataService.FindDishTypeByType(-1);

            _DishTypeSmail.Clear();
            foreach (var element in listsmail)
            {
                _DishTypeSmail.Add(element);
            }
            //加载菜品
            List <Dish> list = _IChooseDishesDataService.FindDishPackages(0);

            _DishesMenusSelected.Clear();

            foreach (var element in list)
            {
                DishBean dishBean = new DishBean().CreateDishBean(element);
                //注入大类,小类
                for (int i = 0; i < _DishTypeSmail.Count; i++)
                {
                    if (element.DishTypeId == _DishTypeSmail[i].DishTypeId)
                    {
                        dishBean.DishTypeName = _DishTypeSmail[i].Name;
                        bool flag = false;
                        for (int j = 0; j < _DishTypeBig.Count; j++)
                        {
                            if (_DishTypeSmail[i].ParentId == _DishTypeBig[j].DishTypeId)
                            {
                                dishBean.DishTypeBigName = _DishTypeBig[j].Name;
                                flag = true;
                                break;
                            }
                        }
                        if (flag)
                        {
                            break;
                        }
                    }
                }
                DishesMenusSelected.Add(dishBean);
            }
        }
        //加载所有的 菜品 大类 小类
        public void LoadDishObject()
        {
            //加载所有小类
            _DishTypeSmail = new ObservableCollection <DishType>();
            List <DishType> listsmail = _DataService.FindDishTypeByType(-1);

            _DishTypeSmail.Clear();
            foreach (var element in listsmail)
            {
                _DishTypeSmail.Add(element);
            }

            //加载所有的菜品
            List <Dish> list = _DataService.FindDishPackages(0);

            _DishesMenusSelected.Clear();

            foreach (var element in list)
            {
                DishBean dishBean = new DishBean();
                dishBean = dishBean.CreateDishBean(element);
                dishBean.InjectBeanPrice();
                //注入大类,小类
                for (int i = 0; i < _DishTypeSmail.Count; i++)
                {
                    if (element.DishTypeId == _DishTypeSmail[i].DishTypeId)
                    {
                        dishBean.DishTypeName = _DishTypeSmail[i].Name;
                        bool flag = false;
                        for (int j = 0; j < _DishTypeBig.Count; j++)
                        {
                            if (_DishTypeSmail[i].ParentId == _DishTypeBig[j].DishTypeId)
                            {
                                dishBean.DishTypeBigName = _DishTypeBig[j].Name;
                                flag = true;
                                break;
                            }
                        }
                        if (flag)
                        {
                            break;
                        }
                    }
                }
                DishesMenusSelected.Add(dishBean);
            }
        }
        public DishDetailViewModel(IChooseDishesDataService dataService, IMessenger messenger)
            : base(messenger)
        {
            _IChooseDishesDataService = dataService;
            //加载菜品大类
            _DishTypeBig = _IChooseDishesDataService.FindDishTypeByType(0);
            //加载菜品小类
            _DishTypeSmail = new ObservableCollection<DishType>();
            List<DishType> listsmail = _IChooseDishesDataService.FindDishTypeByType(-1);
            _DishTypeSmail.Clear();
            foreach (var element in listsmail)
            {
                _DishTypeSmail.Add(element);
            }
            //加载菜品
             List<Dish> list = _IChooseDishesDataService.FindDishPackages(0);
            _DishesMenusSelected.Clear();

            foreach (var element in list)
            {
                DishBean dishBean = new DishBean().CreateDishBean(element);
                //注入大类,小类
                for (int i = 0; i < _DishTypeSmail.Count; i++)
                {
                    if (element.DishTypeId == _DishTypeSmail[i].DishTypeId)
                    {
                        dishBean.DishTypeName = _DishTypeSmail[i].Name;
                        bool flag = false;
                        for (int j = 0; j < _DishTypeBig.Count; j++)
                        {
                            if (_DishTypeSmail[i].ParentId == _DishTypeBig[j].DishTypeId)
                            {
                                dishBean.DishTypeBigName = _DishTypeBig[j].Name;
                                flag = true;
                                break;
                            }
                        }
                        if (flag) break;
                    }
                }
                DishesMenusSelected.Add(dishBean);
            }

        }