Ejemplo n.º 1
0
        public DocumentManagerPresenter(IUnityContainer container, IDocumentManagerView view)
        {
            View = view;
            this.container = container;
            this.service = new WMSServiceClient();
            View.Model = this.container.Resolve<DocumentManagerModel>();

            //Event Delegate
            View.SaveHeader += new EventHandler<EventArgs>(this.OnSaveHeader);
            View.ChangeVendorCustomer += new EventHandler<DataEventArgs<DocumentType>>(this.OnChangeVendorCustomer);
            View.DeleteDocumentLines += new EventHandler<EventArgs>(this.OnDeleteDocumentLines);
            View.SearchAddress += new EventHandler<DataEventArgs<int>>(OnSearchAddress);

            //ProcessWindow pw = new ProcessWindow("Loading ...");
            //Inicializo las variables del sistema y los listados a mostrar
            View.Model.Record = new Document();
            View.Model.RecordShippingAddress = new DocumentAddress();
            View.Model.RecordBildAddress = new DocumentAddress();
            View.Model.DocumentLine = new DocumentLine();
            View.Model.DocumentLineList = new List<DocumentLine>();
            View.Model.DocTypeList = service.GetDocumentType(new DocumentType()).Where(f => f.DocClass.HasAdmin == true).ToList();
            /*View.Model.DocConceptList = service.GetDocumentConcept(new DocumentConcept());
            View.Model.DocStatusList = service.GetStatus(new Status());*/
            View.Model.LocationList = service.GetLocation(new Location());
            View.Model.ShippingMethodList = service.GetShippingMethod(new ShippingMethod());
            View.Model.PickingMethodList = service.GetPickMethod(new PickMethod());
            View.DocumentDate.Text = DateTime.Now.ToString();
            View.AdminDocumentLine.PresenterParent = this;

            //Asigno los campos obligatorios para el documento de cabecera
            View.Model.Record.Company = new Company { CompanyID = App.curCompany.CompanyID };
            View.Model.Record.IsFromErp = false;
            View.Model.Record.Priority = 0;
            View.Model.Record.CrossDocking = false;
            View.Model.Record.CreatedBy = App.curUser.UserName;
            View.Model.Record.CreationDate = DateTime.Now;

            //Asigno los campos obligatorios para los registros de direcciones de envio y facturacion
            View.Model.RecordShippingAddress.CreatedBy = App.curUser.UserName;
            view.Model.RecordShippingAddress.CreationDate = DateTime.Now;
            View.Model.RecordBildAddress.CreatedBy = App.curUser.UserName;
            view.Model.RecordBildAddress.CreationDate = DateTime.Now;

            //pw.Close();
        }
Ejemplo n.º 2
0
        public ShippingMethodPresenter(IUnityContainer container, IShippingMethodView view)
        {
            View = view;
            this.container = container;
            this.service = new WMSServiceClient();
            View.Model = this.container.Resolve<ShippingMethodModel>();

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

            View.Model.EntityList = service.GetShippingMethod(new ShippingMethod());
            View.Model.Record = null;

        }