public CompanyPresenter(ICompanyView view, Empresa empresa, IUnityContainer container) { if (view == null) { throw new ArgumentNullException("view"); } if (empresa == null) { throw new ArgumentNullException("empresa"); } if (container == null) { throw new ArgumentNullException("container"); } this.SubmitCommand = new DelegateCommand <object>(this.Submit, this.CanSubmit); this.CancelCommand = new DelegateCommand <object>(this.Cancel); this.SearchZipCodeCommand = new DelegateCommand <object>(this.SearchZipCode); this._view = view; this._view.SetPresenter(this); this._container = container; this.Empresa = empresa; }
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(); }
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(); }
public CompanyViewPresenter(ICompanyView p_view) { m_view = p_view; m_companyDao = new CompanyDao(); m_printerDao = new PrinterDao(); }
public CompanyPresenter(ICompanyView view, ICompanyModel model) { this.view = view; this.model = model; SetStructure(); }