Example #1
0
 private void cmbUser_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         if (!(RoleUtil.AllUsers.Contains((sender as ComboBox).Text)) || (sender as ComboBox).SelectedItem == null)
         {
             lblMessage.Content    = "Enter valid user ID.";
             lblMessage.Foreground = new SolidColorBrush(Colors.Red);
         }
         else
         {
             GetUserDetails(sender, (sender as ComboBox).Text);
         }
     }
     else
     {
         if (!isListsCleared)
         {
             lstUnassignedRoles.ItemsSource = null;
             lstAssignedRoles.ItemsSource   = null;
             lblMessage.Content             = "";
             RoleUtil.ClearAll();
             isListsCleared = true;
         }
     }
 }
Example #2
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     lstUnassignedRoles.ItemsSource = null;
     lstAssignedRoles.ItemsSource   = null;
     lblMessage.Content             = "";
     cmbUser.Text = "";
     RoleUtil.ClearAll();
 }