示例#1
0
 private void Cleardata()
 {
     T_Name.Clear();
     T_Email.Clear();
     T_Password.Clear();
     T_Phone.Clear();
     T_Zip.Clear();
     textBox1.Clear();
     dataGridView1.Refresh();
     textBox5.Text        = "";
     radioButton1.Checked = false;
     radioButton2.Checked = false;
 }
示例#2
0
 // Method to Toggle Visibility
 private void IsLoggedIn(bool value)
 {
     if (value)
     {
         // Control Visibilities
         TI_Hosts.Visibility    = Visibility.Visible;
         TI_Jobs.Visibility     = Visibility.Visible;
         TI_Status.Visibility   = Visibility.Visible;
         SP_Settings.Visibility = Visibility.Visible;
         T_URI.IsEnabled        = false;
         T_Username.IsEnabled   = false;
         T_Password.IsEnabled   = false;
         EX_Login.IsExpanded    = false;
         B_Login.Content        = "Logout";
         Properties.Settings.Default.userName = T_URI.Text;
         Properties.Settings.Default.ucd_url  = T_Username.Text;
         Properties.Settings.Default.Save();
         // Populating UI
         //LB_Users.ItemsSource = teamInfo.Data.roleMappings.Select(dn => dn.user.displayName).ToList();
     }
     else if (!value)
     {
         // Control Visibilities
         L_PassOverlay.Visibility = Visibility.Visible;
         TI_Hosts.Visibility      = Visibility.Collapsed;
         TI_Jobs.Visibility       = Visibility.Collapsed;
         TI_Status.Visibility     = Visibility.Collapsed;
         SP_Settings.Visibility   = Visibility.Collapsed;
         T_Password.Clear();
         T_URI.IsEnabled      = true;
         T_Username.IsEnabled = true;
         T_Password.IsEnabled = true;
         // Checking for saved settings
         if (string.IsNullOrEmpty(Properties.Settings.Default.ucd_url) || string.IsNullOrEmpty(Properties.Settings.Default.userName))
         {
             T_URI.Clear();
             T_Username.Clear();
             L_URIOverlay.Visibility  = Visibility.Visible;
             L_UserOverlay.Visibility = Visibility.Visible;
         }
         else
         {
             T_URI.Text               = Properties.Settings.Default.userName;
             T_Username.Text          = Properties.Settings.Default.ucd_url;
             L_URIOverlay.Visibility  = Visibility.Collapsed;
             L_UserOverlay.Visibility = Visibility.Collapsed;
         }
         B_Login.Content = "Login";
     }
 }