예제 #1
0
        public LocationPresenter(IUnityContainer container, ILocationView view)
        {
            View = view;
            this.container = container;
            this.service = new WMSServiceClient();
            View.Model = this.container.Resolve<LocationModel>();

            //Event Delegate
            View.LoadSearch += new EventHandler<DataEventArgs<string>>(this.OnLoadSearch);
            View.New += new EventHandler<EventArgs>(this.OnNew);
            View.LoadData += new EventHandler<DataEventArgs<Location>>(this.OnLoadData);
            View.Save += new EventHandler<EventArgs>(this.OnSave);
            View.Delete += new EventHandler<EventArgs>(this.OnDelete);

            ProcessWindow pw = new ProcessWindow("Loading ...");

            View.Model.EntityList = service.GetLocation(new Location());
            View.Model.Record = new Location { Status = new Status() };

            //List Height
            View.ListRecords.MaxHeight = SystemParameters.FullPrimaryScreenHeight - 250;

            pw.Close();

        }
        public LocationPresenter(IUnityContainer container, ILocationView view)
        {
            View           = view;
            this.container = container;
            this.service   = new WMSServiceClient();
            View.Model     = this.container.Resolve <LocationModel>();

            //Event Delegate
            View.LoadSearch += new EventHandler <DataEventArgs <string> >(this.OnLoadSearch);
            View.New        += new EventHandler <EventArgs>(this.OnNew);
            View.LoadData   += new EventHandler <DataEventArgs <Location> >(this.OnLoadData);
            View.Save       += new EventHandler <EventArgs>(this.OnSave);
            View.Delete     += new EventHandler <EventArgs>(this.OnDelete);

            ProcessWindow pw = new ProcessWindow("Loading ...");

            View.Model.EntityList = service.GetLocation(new Location());
            View.Model.Record     = new Location {
                Status = new Status()
            };

            //List Height
            View.ListRecords.MaxHeight = SystemParameters.FullPrimaryScreenHeight - 250;

            pw.Close();
        }
예제 #3
0
        public LocationPresenter(ILocationView view, ILocationService locationService)
        {
            if (view == null)
            {
                throw new ArgumentNullException(nameof(view));
            }
            if (locationService == null)
            {
                throw new ArgumentNullException(nameof(locationService));
            }

            _view            = view;
            _view.Observer   = this;
            _locationService = locationService;
        }