///<summary>
        /// Prepare the Model.
        ///</summary>
        override public void Execute(INotification notification)
        {
            // Create User Proxy,
            UserProxy userProxy = new UserProxy();

            //Populate it with dummy data
            userProxy.AddItem(new UserVo {
                Username = "******", Fname = "Larry", Lname = "Stooge", Email = "*****@*****.**", Password = "******", Department = DeptEnum.ACCT
            });
            userProxy.AddItem(new UserVo {
                Username = "******", Fname = "Curly", Lname = "Stooge", Email = "*****@*****.**", Password = "******", Department = DeptEnum.SALES
            });
            userProxy.AddItem(new UserVo {
                Username = "******", Fname = "Moe", Lname = "Stooge", Email = "*****@*****.**", Password = "******", Department = DeptEnum.PLANT
            });

            // register it
            Facade.RegisterProxy(userProxy);

            // Create Role Proxy
            RoleProxy roleProxy = new RoleProxy();

            //Populate it with dummy data
            RoleEnum[] lstoogeRoles = { RoleEnum.PAYROLL, RoleEnum.EMP_BENEFITS };
            roleProxy.AddItem(new RoleVo("lstooge", new ObservableCollection <RoleEnum>(lstoogeRoles)));

            RoleEnum[] cstoogeRoles = { RoleEnum.ACCT_PAY, RoleEnum.ACCT_RCV, RoleEnum.GEN_LEDGER };
            roleProxy.AddItem(new RoleVo("cstooge", new ObservableCollection <RoleEnum>(cstoogeRoles)));

            RoleEnum[] mstoogeRoles = { RoleEnum.INVENTORY, RoleEnum.PRODUCTION, RoleEnum.SALES, RoleEnum.SHIPPING };
            roleProxy.AddItem(new RoleVo("mstooge", new ObservableCollection <RoleEnum>(mstoogeRoles)));

            // register it
            Facade.RegisterProxy(roleProxy);
        }
Exemplo n.º 2
0
        void UserForm_AddUser()
        {
            UserVO user = UserForm.User;

            userProxy.AddItem(user);
            SendNotification(NotificationConst.USER_ADDED, user);
            UserForm.ClearForm();
        }
Exemplo n.º 3
0
    /// <summary>
    /// retrieve the user and role proxies and delete the user
    /// and his roles. then send the USER_DELETED notification
    /// </summary>
    /// <param name="notification"></param>
    public override void Execute(INotification notification)
    {
        UserVO    user      = (UserVO)notification.Body;
        UserProxy userProxy = (UserProxy)Facade.RetrieveProxy(UserProxy.NAME);

        userProxy.AddItem(user);
        SendNotification(EventsEnum.USER_ADDED, user);
    }
        private void OnAdd(object sender)
        {
            UserVo user = UserForm.User;

            UserProxy.AddItem(user);
            SendNotification(ApplicationFacade.USER_ADDED, user);
            ClearForm();
        }
Exemplo n.º 5
0
    void UserForm_AddUser()
    {
        UserVO user = View.User;

        userProxy.AddItem(user);
        SendNotification(EventsEnum.USER_ADDED, user);
        View.ClearForm();
    }
Exemplo n.º 6
0
        void UserForm_AddUser(object sender, EventArgs e)
        {
            UserVO user = UserForm.User;

            userProxy.AddItem(user);
            SendNotification(ApplicationFacade.USER_ADDED, user);
            UserForm.ClearForm();
        }