public void LoadUserControl(BreedHomeEditView view)
        {
            var list = iBreedAreaService.GetPagerBreedArea("", 1, 100);

            view.cbBreedArea.ItemsSource       = list;
            view.cbBreedArea.DisplayMemberPath = "AreaName";
            view.cbBreedArea.SelectedValuePath = "AreaID";

            var list2 = _varietyService.GetVarietyList();

            view.cbVarietyType.ItemsSource       = list2;
            view.cbVarietyType.DisplayMemberPath = "VarietyName";
            view.cbVarietyType.SelectedValuePath = "VarietyName";
        }
 private void LoadData(string key, int pageIndex = 1, int pageSize = 10)
 {
     pbLoading.Visibility = Visibility.Visible;
     Task.Factory.StartNew(() =>
     {
         var list        = iBreedAreaService.GetPagerBreedArea(key, pageIndex, pageSize);
         var total       = iBreedAreaService.GetBreedAreaCount(key);
         var pageCount   = total / pageSize == 0 ? 1 : (total / pageSize) + (total % pageSize == 0 ? 0 : 1);
         ModelCollection = new BindableCollection <BreedAreaModel>(list);
         PagerModel      = new PagerModel {
             TotalCount = total, PageCount = pageCount, DetailMsg = string.Format("[共{0}页/共{1}条]", pageCount, total)
         };
     }).ContinueWith((task) => {
         System.Windows.Application.Current.Dispatcher.Invoke(new System.Action(() =>
         {
             pbLoading.Visibility = Visibility.Collapsed;
         }));
     });
 }
        public void LoadUserControl(BreedBatchDetailEditView view)
        {
            ViewSelf = view;
            view.cbBreedBase.ItemsSource       = iBreedBaseService.GetPagerBreedBase("", 1, 100); //.Select(_=>_.BreedBase);
            view.cbBreedBase.DisplayMemberPath = "BreedName";                                     // "BreedBase.BreedName";
            view.cbBreedBase.SelectedValuePath = "BreedID";

            view.cbBreedArea.ItemsSource       = iBreedAreaService.GetPagerBreedArea("", 1, 100); //.Select(_=>_.BreedBase);
            view.cbBreedArea.DisplayMemberPath = "AreaName";                                      // "BreedBase.BreedName";
            view.cbBreedArea.SelectedValuePath = "AreaID";

            view.cbBreedBatch.ItemsSource       = iBreedBatchService.GetPagerBreedBatch("", 1, 100); //.Select(_=>_.BreedBase);
            view.cbBreedBatch.DisplayMemberPath = "BatchNO";                                         // "BreedBase.BreedName";
            view.cbBreedBatch.SelectedValuePath = "BreedBatchID";

            view.cbBreedHome.ItemsSource       = iBreedHomeService.GetPagerBreedHome("", 1, 100); //.Select(_=>_.BreedBase);
            view.cbBreedHome.DisplayMemberPath = "HomeName";                                      // "BreedBase.BreedName";
            view.cbBreedHome.SelectedValuePath = "HomeID";

            view.cbCultivationBase.ItemsSource       = iCultivationBaseService.GetPagerCultivationBase("", 1, 100); //.Select(_=>_.BreedBase);
            view.cbCultivationBase.DisplayMemberPath = "CultivationID";                                             // "BreedBase.BreedName";
            view.cbCultivationBase.SelectedValuePath = "CultivationID";
        }