Beispiel #1
0
        //初始化窗口
        public OrgLocatinModel(IChooseDishesDataService dataService, IMessenger messenger)
            : base(messenger)
        {
            _DataService = dataService;

            Locations = new ObservableCollection <Location>();
            List <Location> loooo = _DataService.queryByLocation();

            bool a = loooo != null;

            if (a)
            {
                foreach (var loca in loooo)
                {
                    Locations.Add(new Location {
                        LocationId = loca.LocationId, Name = loca.Name, Code = loca.Code
                    });
                }
            }
        }
 //初始化窗口
 public OrgLocatinModel(IChooseDishesDataService dataService, IMessenger messenger)
     : base(messenger)
 {
     _DataService = dataService;
   
     Locations = new ObservableCollection<Location>();
     List<Location> loooo= _DataService.queryByLocation();
    
    bool a = loooo != null;
    if (a) { 
         foreach (var loca in loooo)
         {
             Locations.Add(new Location { LocationId = loca.LocationId, Name = loca.Name, Code = loca.Code });
         }
    }
 }