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

            //Event Delegate
            View.LoadSearch += new EventHandler<DataEventArgs<string>>(this.OnLoadSearch);
            View.New += new EventHandler<EventArgs>(this.OnNew);
            View.LoadData += new EventHandler<DataEventArgs<Account>>(this.OnLoadData);
            View.Save += new EventHandler<EventArgs>(this.OnSave);
            View.Delete += new EventHandler<EventArgs>(this.OnDelete);
            //View.SaveAccountAddress += new EventHandler<EventArgs>(this.OnSaveAccountAddress);
            //View.DeleteAccountAddress += new EventHandler<EventArgs>(this.OnDeleteAccountAddress);
            //View.LoadDataAccountAddress += new EventHandler<DataEventArgs<AccountAddress>>(this.OnLoadDataAccountAddress);
            //View.NewAccountAddress += new EventHandler<EventArgs>(this.OnNewAccountAddress);

            View.Model.EntityList = service.GetAccount(new Account {Company = App.curCompany});
            View.Model.Record = null;
            View.Model.RecordAddress = new AccountAddress();
        }
Ejemplo n.º 2
0
        public LabelMappingPresenter(IUnityContainer container, ILabelMappingView view)
        {
            View = view;
            this.container = container;
            this.service = new WMSServiceClient();
            View.Model = this.container.Resolve<LabelMappingModel>();

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

            View.Model.LabelTypeList = service.GetDocumentType(new DocumentType())
                .Where(f=>f.DocClass.DocClassID == SDocClass.Label || f.DocClass.DocClassID == SDocClass.Message || f.DocClass.DocClassID == SDocClass.DocumentForm )
                .ToList();

            View.Model.AccountList = service.GetAccount(new Account());

            View.Model.EntityList = service.GetLabelMapping(new LabelMapping());
            View.Model.Record = null;

        }