示例#1
0
        public CompanyPresenter(IUnityContainer container, ICompanyView view, IShellPresenter region)
        {
            View = view;
            this.container = container;
            this.region = region;
            this.service = new WMSServiceClient();
            View.Model = this.container.Resolve<CompanyModel>();

            //Event Delegate
            View.New += new EventHandler<EventArgs>(this.OnNew);
            View.LoadData += new EventHandler<DataEventArgs<Company>>(this.OnLoadData);
            View.Save += new EventHandler<EventArgs>(this.OnSave);
            View.Delete += new EventHandler<EventArgs>(this.OnDelete);
            View.SetLogo += new EventHandler<DataEventArgs<Stream>>(this.OnSetLogo);
            View.ViewConnections += new EventHandler<EventArgs>(this.OnViewConnections);


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

            View.Model.EntityList = service.GetCompany(new Company());

            //load status
            View.Model.Status = service.GetStatus(new Status { StatusType = new StatusType {  StatusTypeID = SStatusType.Active } });
            
            //los connections
            View.Model.ErpConn = service.GetConnection(new Connection());

            if (View.Model.EntityList != null && View.Model.EntityList.Count > 0)
            {
                LoadData(View.Model.EntityList[0]);
                View.ListRecords.SelectedIndex = 0;
            }

            pw.Close();

        }
示例#2
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 { });
        }