private void CheckBoxCommand() { if (RoleActionEntity == null) { RoleActionEntity = new RoleActionEntity(); RoleActionEntity.IsPermit = IsAccessSet; RoleActionEntity.RoleID = CurrentRoleEntity.RoleID; RoleActionEntity.ActionID = ActionEntity.ActionID; RoleActionEntity.RoleAction = new ProductManager.Web.Model.role_action(); RoleActionEntity.DUpdate(); SystemManageDomainContext.role_actions.Add(RoleActionEntity.RoleAction); UpdateChanged("IsAccess"); } else { RoleActionEntity.IsPermit = IsAccessSet; RoleActionEntity.DUpdate(); } }
private void OnCheckBoxCommand() { if (RoleActionEntity == null) { RoleActionEntity = new RoleActionEntity(); RoleActionEntity.IsPermit = IsAccessSet; RoleActionEntity.RoleID = CurrentRoleEntity.RoleID; RoleActionEntity.ActionID = ActionEntity.ActionID; RoleActionEntity.RoleAction = new ProductManager.Web.Model.role_action(); RoleActionEntity.DUpdate(); SystemManageDomainContext.role_actions.Add(RoleActionEntity.RoleAction); UpdateChanged("IsAccess"); } else { RoleActionEntity.IsPermit = IsAccessSet; RoleActionEntity.DUpdate(); } if (!IsAccessSet) { if (ChildList != null) { foreach (ActionAndRoleActionEntity actionAndRoleActionEntity in ChildList) { if (actionAndRoleActionEntity.RoleActionEntity != null) { actionAndRoleActionEntity.RoleActionEntity.IsPermit = IsAccessSet; actionAndRoleActionEntity.IsAccessSet = IsAccessSet; if (actionAndRoleActionEntity.ChildList != null) { actionAndRoleActionEntity.OnCheckBoxCommand(); } else { actionAndRoleActionEntity.CheckBoxCommand(); } actionAndRoleActionEntity.UpdateChanged("IsAccess"); } } } } if (IsAccessSet) { if (ChildList != null) { foreach (ActionAndRoleActionEntity actionAndRoleActionEntity in ChildList) { actionAndRoleActionEntity.IsAccessSet = IsAccessSet; actionAndRoleActionEntity.OnCheckBoxCommand(); } } } if (ParentActionAndRoleActionEntity != null) { if (IsAccessSet == true) { if (ParentActionAndRoleActionEntity.IsAccessSet == false) { ParentActionAndRoleActionEntity.IsAccessSet = true; ParentActionAndRoleActionEntity.CheckBoxCommand(); } } ParentActionAndRoleActionEntity.UpdateChanged("IsAccess"); } UpdateChanged("IsAccess"); }
void loadOperation_RoleActionCompleted(object sender, EventArgs e) { LoadOperation loadOperation = sender as LoadOperation; foreach (ProductManager.Web.Model.role_action role_action in loadOperation.Entities) { RoleActionEntity roleActionEntity = new RoleActionEntity(); roleActionEntity.RoleAction = role_action; roleActionEntity.Update(); ActionAndUserActionEntity actionAndUserActionEntity; if (ActionAndUserActionEntityDictionary.TryGetValue(roleActionEntity.ActionID, out actionAndUserActionEntity)) { actionAndUserActionEntity.RoleActionEntity = roleActionEntity; } } UpdateUserAction(); }
void loadOperation_RoleActionCompleted(object sender, EventArgs e) { LoadOperation loadOperation = sender as LoadOperation; foreach (ProductManager.Web.Model.role_action role_action in loadOperation.Entities) { RoleActionEntity roleActionEntity = new RoleActionEntity(); roleActionEntity.RoleAction = role_action; roleActionEntity.Update(); ActionAndRoleActionEntity actionAndRoleActionEntity; if (ActionAndRoleAnctionEntityDictionary.TryGetValue(roleActionEntity.ActionID, out actionAndRoleActionEntity)) { actionAndRoleActionEntity.RoleActionEntity = roleActionEntity; } } RootActionAndRoleActionEntity.ChildList.Clear(); foreach (KeyValuePair<int, ActionAndRoleActionEntity> actionAndRoleActionEntityPair in ActionAndRoleAnctionEntityDictionary) { actionAndRoleActionEntityPair.Value.CurrentRoleEntity = SelectRoleEntity; int supperActionID = actionAndRoleActionEntityPair.Value.ActionEntity.SupperActionID; if (supperActionID == 0) { RootActionAndRoleActionEntity.ChildList.Add(actionAndRoleActionEntityPair.Value); } } UpdateChanged("RootActionAndRoleActionEntity"); IsBusy = false; }