private void CheckBoxCommand()
 {
     if (UserActionEntity == null)
     {
         UserActionEntity            = new UserActionEntity();
         UserActionEntity.IsPermit   = IsAccessSet;
         UserActionEntity.ActionID   = ActionEntity.ActionID;
         UserActionEntity.UserID     = CurrentSelectUserEntity.UserID;
         UserActionEntity.UserAction = new ProductManager.Web.Model.user_action();
         UserActionEntity.DUpdate();
         SystemManageDomainContext.user_actions.Add(UserActionEntity.UserAction);
         UpdateChanged("IsAccess");
     }
     else
     {
         UserActionEntity.IsPermit = IsAccessSet;
         UserActionEntity.DUpdate();
     }
 }
        private void OnCheckBoxCommand()
        {
            if (UserActionEntity == null)
            {
                UserActionEntity            = new UserActionEntity();
                UserActionEntity.IsPermit   = IsAccessSet;
                UserActionEntity.ActionID   = ActionEntity.ActionID;
                UserActionEntity.UserID     = CurrentSelectUserEntity.UserID;
                UserActionEntity.UserAction = new ProductManager.Web.Model.user_action();
                UserActionEntity.DUpdate();
                SystemManageDomainContext.user_actions.Add(UserActionEntity.UserAction);
                UpdateChanged("IsAccess");
            }
            else
            {
                UserActionEntity.IsPermit = IsAccessSet;
                UserActionEntity.DUpdate();
            }

            if (!IsAccessSet)
            {
                if (ChildList != null)
                {
                    foreach (ActionAndUserActionEntity actionAndUserActionEntity in ChildList)
                    {
                        if (actionAndUserActionEntity.UserActionEntity != null)
                        {
                            actionAndUserActionEntity.UserActionEntity.IsPermit = IsAccessSet;
                            actionAndUserActionEntity.IsAccessSet = IsAccessSet;
                            if (actionAndUserActionEntity.ChildList != null)
                            {
                                actionAndUserActionEntity.OnCheckBoxCommand();
                            }
                            else
                            {
                                actionAndUserActionEntity.CheckBoxCommand();
                            }
                            actionAndUserActionEntity.UpdateChanged("IsAccess");
                        }
                    }
                }
            }

            if (IsAccessSet)
            {
                if (ChildList != null)
                {
                    foreach (ActionAndUserActionEntity actionAndUserActionEntity in ChildList)
                    {
                        actionAndUserActionEntity.IsAccessSet = IsAccessSet;
                        actionAndUserActionEntity.OnCheckBoxCommand();
                    }
                }
            }

            if (ParentActionAdnUserActionEntity != null)
            {
                if (IsAccessSet == true)
                {
                    if (ParentActionAdnUserActionEntity.IsAccessSet == false)
                    {
                        ParentActionAdnUserActionEntity.IsAccessSet = true;
                        ParentActionAdnUserActionEntity.CheckBoxCommand();
                    }
                    ParentActionAdnUserActionEntity.UpdateChanged("IsAccess");
                }
            }

            UpdateChanged("IsAccess");
        }
        private void OnCheckBoxCommand()
        {
            if (UserActionEntity == null)
            {
                UserActionEntity = new UserActionEntity();
                UserActionEntity.IsPermit = IsAccessSet;
                UserActionEntity.ActionID = ActionEntity.ActionID;
                UserActionEntity.UserID = CurrentSelectUserEntity.UserID;
                UserActionEntity.UserAction = new ProductManager.Web.Model.user_action();
                UserActionEntity.DUpdate();
                SystemManageDomainContext.user_actions.Add(UserActionEntity.UserAction);
                UpdateChanged("IsAccess");
            }
            else
            {
                UserActionEntity.IsPermit = IsAccessSet;
                UserActionEntity.DUpdate();
            }

            if (!IsAccessSet)
            {
                if (ChildList != null)
                {
                    foreach (ActionAndUserActionEntity actionAndUserActionEntity in ChildList)
                    {
                        if (actionAndUserActionEntity.UserActionEntity != null)
                        {
                            actionAndUserActionEntity.UserActionEntity.IsPermit = IsAccessSet;
                            actionAndUserActionEntity.IsAccessSet = IsAccessSet;
                            if (actionAndUserActionEntity.ChildList != null)
                            {
                                actionAndUserActionEntity.OnCheckBoxCommand();
                            }
                            else
                            {
                                actionAndUserActionEntity.CheckBoxCommand();
                            }
                            actionAndUserActionEntity.UpdateChanged("IsAccess");
                        }
                    }
                }
            }

            if (IsAccessSet)
            {
                if (ChildList != null)
                {
                    foreach (ActionAndUserActionEntity actionAndUserActionEntity in ChildList)
                    {
                        actionAndUserActionEntity.IsAccessSet = IsAccessSet;
                        actionAndUserActionEntity.OnCheckBoxCommand();
                    }
                }
            }

            if (ParentActionAdnUserActionEntity != null)
            {
                if (IsAccessSet == true)
                {
                    if (ParentActionAdnUserActionEntity.IsAccessSet == false)
                    {
                        ParentActionAdnUserActionEntity.IsAccessSet = true;
                        ParentActionAdnUserActionEntity.CheckBoxCommand();
                    }
                    ParentActionAdnUserActionEntity.UpdateChanged("IsAccess");
                }
            }

            UpdateChanged("IsAccess");
        }
        void loadOperation_UserActionCompleted(object sender, EventArgs e)
        {
            LoadOperation loadOperation = sender as LoadOperation;
            foreach (ProductManager.Web.Model.user_action user_action in loadOperation.Entities)
            {
                UserActionEntity userActionEntity = new UserActionEntity();
                userActionEntity.UserAction = user_action;
                userActionEntity.Update();
                ActionAndUserActionEntity actionAndUserActionEntity;
                if (ActionAndUserActionEntityDictionary.TryGetValue(userActionEntity.ActionID, out actionAndUserActionEntity))
                {
                    actionAndUserActionEntity.UserActionEntity = userActionEntity;
                }
            }

            RootActionAndUserActionEntity.ChildList.Clear();
            foreach (KeyValuePair<int, ActionAndUserActionEntity> actionAndUserActionEntityPair in ActionAndUserActionEntityDictionary)
            {
                actionAndUserActionEntityPair.Value.CurrentSelectUserEntity = SelectUserEntity;
                int supperActionID = actionAndUserActionEntityPair.Value.ActionEntity.SupperActionID;
                if (supperActionID == 0)
                {
                    RootActionAndUserActionEntity.ChildList.Add(actionAndUserActionEntityPair.Value);
                }
            }
            UpdateChanged("RootActionAndUserActionEntity");

            IsBusy = false;
        }
 private void CheckBoxCommand()
 {
     if (UserActionEntity == null)
     {
         UserActionEntity = new UserActionEntity();
         UserActionEntity.IsPermit = IsAccessSet;
         UserActionEntity.ActionID = ActionEntity.ActionID;
         UserActionEntity.UserID = CurrentSelectUserEntity.UserID;
         UserActionEntity.UserAction = new ProductManager.Web.Model.user_action();
         UserActionEntity.DUpdate();
         SystemManageDomainContext.user_actions.Add(UserActionEntity.UserAction);
         UpdateChanged("IsAccess");
     }
     else
     {
         UserActionEntity.IsPermit = IsAccessSet;
         UserActionEntity.DUpdate();
     }
 }