public MessageRuleByCompanyPresenter(IUnityContainer container, IMessageRuleByCompanyView view)
        {
            View = view;
            this.container = container;
            this.service = new WMSServiceClient();
            View.Model = this.container.Resolve<MessageRuleByCompanyModel>();

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

            View.Model.ClassEntityList = service.GetClassEntity(new ClassEntity());
            view.Model.LabelTemplateList = service.GetLabelTemplate(new LabelTemplate
            {
                LabelType = new DocumentType { DocClass = new DocumentClass { DocClassID = SDocClass.Message } }
            });


            View.Model.EntityList = service.GetMessageRuleByCompany(new MessageRuleByCompany());
            View.Model.Record = null;

        }
        public AdminInformationPresenter(IUnityContainer container, IAdminInformationView view)
        {
            View = view;
            this.container = container;
            this.service = new WMSServiceClient();
            View.Model = this.container.Resolve<AdminInformationModel>();

            #region Metodos

            #region Busqueda

            View.LoadData += new EventHandler<DataEventArgs<ClassEntity>>(this.OnLoadData);
            View.ShowFields += new EventHandler<DataEventArgs<ClassEntity>>(this.OnShowFields);

            #endregion

            #region Datos Estaticos

            View.AsignarProducto += new EventHandler<DataEventArgs<Product>>(this.OnAsignarProducto);
            View.CargarDatos += new EventHandler<DataEventArgs<Location>>(this.OnCargarDatos);

            #endregion

            #region Datos Generales

            #endregion

            #region Eventos Botones

            View.UpdateData += new EventHandler<EventArgs>(this.OnUpdateData);
            View.DeleteData += new EventHandler<EventArgs>(this.OnDeleteData);

            #endregion

            #endregion

            #region Datos

            //Obtengo el cliente
            View.Model.RecordCliente = service.GetLocation(new Location { LocationID = App.curLocation.LocationID }).First();
            //Obtengo las opciones de Documento y Label
            View.Model.SearchTypeList = service.GetClassEntity(new ClassEntity())
                .Where(f => f.ClassEntityID == EntityID.Document || f.ClassEntityID == EntityID.Label).ToList();
            //Obtengo las ubicaciones del cliente
            View.Model.BinList = service.GetBin(new Bin { Location = View.Model.RecordCliente });
            //Consulto los productos definidos para el cliente
            //View.Model.ProductsLocationList = service.GetProduct(new Product { Reference = View.Model.RecordCliente.LocationID.ToString() });
            //View.Model.ProductsLocationList.Insert(0, service.GetProduct(new Product { ProductCode = WmsSetupValues.DEFAULT }).First());
            //Obtengo los estados de los equipos
            View.Model.StatusList = App.EntityStatusList;

            #endregion
        }
Ejemplo n.º 3
0
        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 { });
        }