Beispiel #1
0
        public SysUserPresenter(IUnityContainer container, ISysUserView view)
        {
            View = view;
            this.container = container;
            this.service = new WMSServiceClient();
            View.Model = this.container.Resolve<SysUserModel>();

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

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

            View.Model.EntityList = service.GetSysUser(new SysUser());
            //View.Model.Record = null;

            View.Model.LocationList = service.GetLocation(new Location { Company = App.curCompany }).OrderBy(f => f.Name).ToList();
            View.Model.ListRol = service.GetRol(new Rol()).OrderBy(f=>f.Name).ToList();

            pw.Close();

        }
Beispiel #2
0
        public RolPresenter(IUnityContainer container, IRolView view)
        {
            View = view;
            this.container = container;
            this.service = new WMSServiceClient();
            View.Model = this.container.Resolve<RolModel>();

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

            View.AddRolMenuOption += new EventHandler<EventArgs>(OnAddRolMenuOption);

            View.Model.EntityList = service.GetRol(new Rol());
            View.Model.Record = null;

        }