/// <summary> /// Add the selected roles /// </summary> private void AddSelectedRoles() { SEC_USER_ROLES secuserroles; try { if (_selectedItemsRoleMaster != null) { while (_selectedItemsRoleMaster.Count > 0) { SEC_ROLES_MASTER srm = (SEC_ROLES_MASTER)_selectedItemsRoleMaster[0]; secuserroles = new SEC_USER_ROLES(); secuserroles.ROLE_NAME = srm.ROLE_NAME; secuserroles.USER_NAME = _userName; Sec_Roles_Master_List.Remove(srm); Sec_User_Roles_List.Add(secuserroles); } NotifyPropertyChanged("Sec_User_Roles_List"); NotifyPropertyChanged("Sec_Roles_Master_List"); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Process Designer"); } }
/// <summary> /// Add all the roles /// </summary> private void AddAllRoles() { SEC_USER_ROLES secuserroles; try { foreach (SEC_ROLES_MASTER srm in Sec_Roles_Master_List) { secuserroles = new SEC_USER_ROLES(); secuserroles.ROLE_NAME = srm.ROLE_NAME; secuserroles.USER_NAME = _userName; Sec_User_Roles_List.Add(secuserroles); } Sec_Roles_Master_List.Clear(); NotifyPropertyChanged("Sec_User_Roles_List"); NotifyPropertyChanged("Sec_Roles_Master_List"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Process Designer"); } }