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(); }
public LabelTemplatePresenter(IUnityContainer container, ILabelTemplateView view) { View = view; this.container = container; this.service = new WMSServiceClient(); View.Model = this.container.Resolve<LabelTemplateModel>(); //Event Delegate View.LoadSearch += new EventHandler<DataEventArgs<string>>(this.OnLoadSearch); View.New += new EventHandler<EventArgs>(this.OnNew); View.LoadData += new EventHandler<DataEventArgs<LabelTemplate>>(this.OnLoadData); View.Save += new EventHandler<EventArgs>(this.OnSave); View.Delete += new EventHandler<EventArgs>(this.OnDelete); //View.Model.LabelTypeList = service.GetLabelType(); View.Model.EntityList = service.GetLabelTemplate(new LabelTemplate()); View.Model.LabelTypeList = service.GetDocumentType(new DocumentType()) .Where(f => f.DocClass.DocClassID == 10 || f.DocClass.DocClassID == 11 || f.DocClass.DocClassID == 12).ToList(); View.Model.Record = null; }
public static void LoadServiceMasters() { WMSServiceClient service = new WMSServiceClient(); //Status App.DocStatusList = service.GetStatus(new Status()); App.EntityStatusList = App.DocStatusList.Where(f => f.StatusType.StatusTypeID == SStatusType.Active).ToList(); App.DocStatusList = App.DocStatusList.Where(f => f.StatusType.StatusTypeID == SStatusType.Document).ToList(); //Pick Methods App.PickMethodList = service.GetPickMethod(new PickMethod { Active = true }); //Document Types App.DocTypeList = service.GetDocumentType(new DocumentType()); //Locations App.LocationList = service.GetLocation(new Location { Status = new Status { StatusID = EntityStatus.Active } }) .OrderBy(f => f.Name).ToList(); //Companies App.CompanyList = service.GetCompany(new Company()); //Data Types App.DataTypeList = service.GetDataType(new DataType()); //DocumentConcepts App.DocumentConceptList = service.GetDocumentConcept(new DocumentConcept()); //Bin Directions Hashtable binDirections = new Hashtable(); binDirections.Add(2, "Out only"); binDirections.Add(1, "In only"); binDirections.Add(0, "In/Out"); App.BinDirectionList = binDirections; //Custom Process App.CustomProcessList = service.GetCustomProcess(new CustomProcess()); //Connection Printers App.PrinterConnectionList = service.GetConnection(new Connection { ConnectionType = new ConnectionType { RowID = CnnType.Printer } }); App.ClassEntityList = service.GetClassEntity(new ClassEntity { }); }