예제 #1
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;

        }