예제 #1
0
        public ProducerPresenter(IProducerView view, IProducerService producerService)
        {
            if (view == null)
            {
                throw new ArgumentNullException(nameof(view));
            }
            if (producerService == null)
            {
                throw new ArgumentNullException(nameof(producerService));
            }

            _view            = view;
            _view.Observer   = this;
            _producerService = producerService;
        }
예제 #2
0
        public ProducerPresenter(IProducerView view)
        {
            baseUrl = @"http://lasmargaritasdev.azurewebsites.net/";
            if (ConfigurationManager.AppSettings["baseUrl"] != null)
            {
                baseUrl = ConfigurationManager.AppSettings["baseUrl"];
            }

            insertAction              = "Producer/Add";
            updateAction              = "Producer/Update";
            deleteAction              = "Producer/Delete";
            getAllAction              = "Producer/GetAll";
            getByIdAction             = "Producer/GetById";
            getLastModification       = "LastModification/GetLastModification";
            getSelectableModelsAction = "Producer/GetSelectableModels";
            getStatesAction           = "Catalog/GetStates";
            getRegimesAction          = "Catalog/GetRegimes";
            getCivilStatusAction      = "Catalog/GetCivilStatus";
            getGenderAction           = "Catalog/GetGenders";
            producerView              = view;
            cacher = new Cacher <Producer>("producers.json");
        }
예제 #3
0
        public ProducerPresenter(IProducerView view, Fabricante fabricante, IUnityContainer container)
        {
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }
            if (fabricante == null)
            {
                throw new ArgumentNullException("fabricante");
            }
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            this.SubmitCommand = new DelegateCommand <object>(this.Submit, this.CanSubmit);
            this.CancelCommand = new DelegateCommand <object>(this.Cancel);

            this._view = view;
            this._view.SetPresenter(this);
            this._container = container;

            this.Fabricante = fabricante;
        }