Style tempStyle; //Temproary style variable #endregion Fields #region Constructors public Window_AdminLogin(Controller controller_in) { InitializeComponent(); controller = controller_in; txtbxMessages.Text = "Enter the registration code for this" + Environment.NewLine + "kiosk to return to the admin panel."; }
public Window_NoCode(Controller controller_in) { InitializeComponent(); controller = controller_in; txtbxMessages.Text = "This feature is disabled in offline mode."; txtbxEmail.IsEnabled = false; btnSearch.IsEnabled = false; }
public static Boolean Print(Registrant registrant, Controller controller) { // Format the two strings for the label var label = (DYMO.Label.Framework.ILabel)null; string labelName = registrant.FirstName + ((registrant.FirstName.Length + registrant.LastName.Length >= 16) ? "\n" : " ") + registrant.LastName; string labelDetails = FormatRegistrant(registrant); // Liable to throw System.IO.FileNotFoundException, and DYMO.DLS.Runtime.DlsRuntimeException label = DYMO.Label.Framework.Label.Open("ERK.label"); label.SetObjectText("Name", labelName); label.SetObjectText("Details", labelDetails); ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_Printer"); string printerName = ""; foreach (ManagementObject printer in searcher.Get()) { printerName = printer["Name"].ToString(); if (printerName.Equals(@"DYMO LabelWriter 450 DUO Label")) { if (printer["WorkOffline"].ToString().ToLower().Equals("true")) { MessageBox.Show("'DYMO LabelWriter 450 DUO Label' - Printer not found."); if(controller != null) { controller.LogError("'DYMO LabelWriter 450 DUO Label' - Printer not found."); } return false; } else { try { label.Print("DYMO LabelWriter 450 DUO Label"); return true; } catch (DYMO.DLS.Runtime.DlsRuntimeException e) { MessageBox.Show("'DYMO LabelWriter 450 DUO Label' - Failed to print"); if(controller != null) { controller.LogError("'DYMO LabelWriter 450 DUO Label' - Failed to print", e.Message); } return false; } } } } return false; }
public Window_RegisterKiosk(Controller controller_in) { InitializeComponent(); controller = controller_in; txtbxMessages.Text = String.Format("{1}{0}{2}{0}{3}", Environment.NewLine, "Kiosk is in offline mode.", "To connect to an event database, enter", "the kiosk registration code below."); }
public Window_StartMenu() { InitializeComponent(); controller = new Controller(this); usingCustomEventname = false; btnNameMode.IsEnabled = false; txtbxMessages.Text = String.Format("{1}{0}{2}", Environment.NewLine, "Click 'Register Kiosk' to connect to an event database.", "Click 'Open Kiosk' to run the kiosk in offline mode."); }
public Window_Kiosk(Controller controller_in) { InitializeComponent(); controller = controller_in; }
public void SetMode(Controller.RegistrantMode mode) { if (mode < Controller.RegistrantMode.RESET || mode > Controller.RegistrantMode.REGISTER) { return; } //Reset the form to the intial state #region RESET if (mode == Controller.RegistrantMode.RESET) { //Clear controller.activeRegistrant, if any controller.ClearRegistrant(); if(controller.IsOnlineEnabled) { //Set welcome message and starting instructions txtbxMessages.Text = String.Format("{1}{0}{2}{0}{3}{0}{4}", Environment.NewLine, "Enter your 6-digit code if you pre-registered online.", "Don't have your code? Click 'No Code' to check in by email.", "Otherwise, click 'Register' to check in.", "Employers, click 'Register' to receive a name tag."); //Show grdCheckInStart elements rctCheckInStart.Visibility = System.Windows.Visibility.Visible; txtbxEnterCode.IsEnabled = true; txtbxEnterCode.Clear(); txtbxEnterCode.Visibility = System.Windows.Visibility.Visible; txtbxEnterCode.Focus(); btnEnterCode.IsEnabled = false; btnEnterCode.Visibility = System.Windows.Visibility.Visible; btnNoCode.IsEnabled = true; btnNoCode.Visibility = System.Windows.Visibility.Visible; btnRegister.IsEnabled = true; btnRegister.Visibility = System.Windows.Visibility.Visible; //Hide 'Start Over' button rctStartOver.Visibility = System.Windows.Visibility.Hidden; btnStartOver.Visibility = System.Windows.Visibility.Hidden; btnStartOver.IsEnabled = false; //Hide and reset grdInputFields elements rctRegistrantType.Visibility = System.Windows.Visibility.Hidden; lblRegistrantType.Visibility = System.Windows.Visibility.Hidden; cmbRegistrantType.Visibility = System.Windows.Visibility.Hidden; selectionLocked = true; cmbRegistrantType.SelectedIndex = (int)Controller.RegistrantMode.RESET; selectionLocked = false; cmbRegistrantType.IsEnabled = false; rctFirstName.Visibility = System.Windows.Visibility.Hidden; lblFirstName.Visibility = System.Windows.Visibility.Hidden; txtbxFirstName.Visibility = System.Windows.Visibility.Hidden; txtbxFirstName.Clear(); txtbxFirstName.IsEnabled = false; rctLastName.Visibility = System.Windows.Visibility.Hidden; lblLastName.Visibility = System.Windows.Visibility.Hidden; txtbxLastName.Visibility = System.Windows.Visibility.Hidden; txtbxLastName.Clear(); txtbxLastName.IsEnabled = false; rctSchoolOrOrganization.Visibility = System.Windows.Visibility.Hidden; lblSchoolOrOrganization.Visibility = System.Windows.Visibility.Hidden; lblSchoolOrOrganization.Content = "School"; txtbxSchoolOrOrganization.Visibility = System.Windows.Visibility.Hidden; txtbxSchoolOrOrganization.Clear(); txtbxSchoolOrOrganization.IsEnabled = false; rctMajorOrPosition.Visibility = System.Windows.Visibility.Hidden; lblMajorOrPosition.Visibility = System.Windows.Visibility.Hidden; lblMajorOrPosition.Content = "Major"; txtbxMajorOrPosition.Visibility = System.Windows.Visibility.Hidden; txtbxMajorOrPosition.Clear(); txtbxMajorOrPosition.IsEnabled = false; rctClassStanding.Visibility = System.Windows.Visibility.Hidden; lblClassStanding.Visibility = System.Windows.Visibility.Hidden; cmbClassStanding.Visibility = System.Windows.Visibility.Hidden; cmbClassStanding.SelectedIndex = (int)Controller.ClassStanding.SELECT; cmbClassStanding.IsEnabled = false; //Hide 'Check In' button rctCheckInFinish.Visibility = System.Windows.Visibility.Hidden; btnCheckIn.Visibility = System.Windows.Visibility.Hidden; btnCheckIn.IsEnabled = false; return; } else { txtbxFirstName.Clear(); txtbxLastName.Clear(); txtbxSchoolOrOrganization.Clear(); txtbxMajorOrPosition.Clear(); cmbRegistrantType.Focus(); mode = Controller.RegistrantMode.REGISTER; } } #endregion //If not RESET, prepare kiosk for check-in #region PREPARE FOR CHECK-IN //Show 'Start Over' button rctStartOver.Visibility = System.Windows.Visibility.Visible; btnStartOver.IsEnabled = true; btnStartOver.Visibility = System.Windows.Visibility.Visible; //Show 'Check In' button rctCheckInFinish.Visibility = System.Windows.Visibility.Visible; btnCheckIn.IsEnabled = true; btnCheckIn.Visibility = System.Windows.Visibility.Visible; //Hide grdCheckInStart elements txtbxEnterCode.Visibility = System.Windows.Visibility.Collapsed; txtbxEnterCode.Clear(); txtbxEnterCode.IsEnabled = false; btnEnterCode.Visibility = System.Windows.Visibility.Collapsed; btnEnterCode.IsEnabled = false; btnNoCode.Visibility = System.Windows.Visibility.Collapsed; btnNoCode.IsEnabled = false; btnRegister.Visibility = System.Windows.Visibility.Collapsed; btnRegister.IsEnabled = false; //Show registration type selector rctRegistrantType.Visibility = System.Windows.Visibility.Visible; lblRegistrantType.Visibility = System.Windows.Visibility.Visible; cmbRegistrantType.IsEnabled = true; cmbRegistrantType.Visibility = System.Windows.Visibility.Visible; #endregion //Registrant is a student #region STUDENT if (mode == Controller.RegistrantMode.STUDENT) { txtbxMessages.Text = String.Format("{1}{0}{2}", Environment.NewLine, "Welcome!", "Please fill in all the fields below."); //Set grdInputFields for STUDENT parameters //Watch for bugs! See declaration of selectionLocked for cautionary info selectionLocked = true; cmbRegistrantType.SelectedIndex = (int)Controller.RegistrantMode.STUDENT; selectionLocked = false; rctFirstName.Visibility = System.Windows.Visibility.Visible; lblFirstName.Visibility = System.Windows.Visibility.Visible; txtbxFirstName.Visibility = System.Windows.Visibility.Visible; txtbxFirstName.IsEnabled = true; rctLastName.Visibility = System.Windows.Visibility.Visible; lblLastName.Visibility = System.Windows.Visibility.Visible; txtbxLastName.Visibility = System.Windows.Visibility.Visible; txtbxLastName.IsEnabled = true; rctSchoolOrOrganization.Visibility = System.Windows.Visibility.Visible; lblSchoolOrOrganization.Content = "School"; lblSchoolOrOrganization.Visibility = System.Windows.Visibility.Visible; txtbxSchoolOrOrganization.IsEnabled = true; txtbxSchoolOrOrganization.Visibility = System.Windows.Visibility.Visible; rctMajorOrPosition.Visibility = System.Windows.Visibility.Visible; lblMajorOrPosition.Content = "Major"; lblMajorOrPosition.Visibility = System.Windows.Visibility.Visible; txtbxMajorOrPosition.IsEnabled = true; txtbxMajorOrPosition.Visibility = System.Windows.Visibility.Visible; rctClassStanding.Visibility = System.Windows.Visibility.Visible; lblClassStanding.Visibility = System.Windows.Visibility.Visible; cmbClassStanding.IsEnabled = true; cmbClassStanding.Visibility = System.Windows.Visibility.Visible; return; } #endregion //STUDENT //Registrant is an employer or employee #region EMPLOYER if (mode == Controller.RegistrantMode.EMPLOYEE) { txtbxMessages.Text = String.Format("{1}{0}{2}{0}{3}", Environment.NewLine, "Welcome!", "Fill in the fields below and click 'Check In' to receive a name tag.", "All fields are optional."); //Set grdInputFields for EMPLOYER parameters //Watch for bugs! See declaration of selectionLocked for cautionary info selectionLocked = true; cmbRegistrantType.SelectedIndex = (int)Controller.RegistrantMode.EMPLOYEE; selectionLocked = false; rctFirstName.Visibility = System.Windows.Visibility.Visible; lblFirstName.Visibility = System.Windows.Visibility.Visible; txtbxFirstName.Visibility = System.Windows.Visibility.Visible; txtbxFirstName.IsEnabled = true; rctLastName.Visibility = System.Windows.Visibility.Visible; lblLastName.Visibility = System.Windows.Visibility.Visible; txtbxLastName.Visibility = System.Windows.Visibility.Visible; txtbxLastName.IsEnabled = true; rctSchoolOrOrganization.Visibility = System.Windows.Visibility.Visible; lblSchoolOrOrganization.Content = "Organization"; lblSchoolOrOrganization.Visibility = System.Windows.Visibility.Visible; txtbxSchoolOrOrganization.IsEnabled = true; txtbxSchoolOrOrganization.Visibility = System.Windows.Visibility.Visible; rctMajorOrPosition.Visibility = System.Windows.Visibility.Visible; lblMajorOrPosition.Content = "Job Title"; lblMajorOrPosition.Visibility = System.Windows.Visibility.Visible; txtbxMajorOrPosition.IsEnabled = true; txtbxMajorOrPosition.Visibility = System.Windows.Visibility.Visible; rctClassStanding.Visibility = System.Windows.Visibility.Hidden; lblClassStanding.Visibility = System.Windows.Visibility.Hidden; cmbClassStanding.Visibility = System.Windows.Visibility.Hidden; cmbClassStanding.IsEnabled = false; return; } #endregion //EMPLOYER //Registrant is general #region GENERAL if (mode == Controller.RegistrantMode.GENERAL) { txtbxMessages.Text = String.Format("{1}{0}{2}", Environment.NewLine, "Welcome!", "Please enter your first and last name."); //Set grdInputFields for GENERAL parameters //Watch for bugs! See declaration of selectionLocked for cautionary info selectionLocked = true; cmbRegistrantType.SelectedIndex = (int)Controller.RegistrantMode.GENERAL; selectionLocked = false; rctFirstName.Visibility = System.Windows.Visibility.Visible; lblFirstName.Visibility = System.Windows.Visibility.Visible; txtbxFirstName.Visibility = System.Windows.Visibility.Visible; txtbxFirstName.IsEnabled = true; rctLastName.Visibility = System.Windows.Visibility.Visible; lblLastName.Visibility = System.Windows.Visibility.Visible; txtbxLastName.Visibility = System.Windows.Visibility.Visible; txtbxLastName.IsEnabled = true; rctSchoolOrOrganization.Visibility = System.Windows.Visibility.Hidden; lblSchoolOrOrganization.Visibility = System.Windows.Visibility.Hidden; txtbxSchoolOrOrganization.Visibility = System.Windows.Visibility.Hidden; txtbxSchoolOrOrganization.IsEnabled = false; rctMajorOrPosition.Visibility = System.Windows.Visibility.Hidden; lblMajorOrPosition.Visibility = System.Windows.Visibility.Hidden; txtbxMajorOrPosition.Visibility = System.Windows.Visibility.Hidden; txtbxMajorOrPosition.IsEnabled = false; rctClassStanding.Visibility = System.Windows.Visibility.Hidden; lblClassStanding.Visibility = System.Windows.Visibility.Hidden; cmbClassStanding.Visibility = System.Windows.Visibility.Hidden; cmbClassStanding.IsEnabled = false; return; } #endregion //GENERAL //User is new registrant #region REGISTER if (mode == Controller.RegistrantMode.REGISTER) { //Set welcome message and starting instructions txtbxMessages.Text = String.Format("{1}{0}{2}{0}{3}", Environment.NewLine, "Welcome!", "Are you a student, employer, or general attendee?", "Please make a selection below."); //Watch for bugs! See declaration of selectionLocked for cautionary info selectionLocked = true; cmbRegistrantType.SelectedIndex = (int)Controller.RegistrantMode.RESET; selectionLocked = false; //Hide all other grdInputFields elements until registrant type is selected rctFirstName.Visibility = System.Windows.Visibility.Hidden; lblFirstName.Visibility = System.Windows.Visibility.Hidden; txtbxFirstName.IsEnabled = false; txtbxFirstName.Visibility = System.Windows.Visibility.Hidden; rctLastName.Visibility = System.Windows.Visibility.Hidden; lblLastName.Visibility = System.Windows.Visibility.Hidden; txtbxLastName.IsEnabled = false; txtbxLastName.Visibility = System.Windows.Visibility.Hidden; rctSchoolOrOrganization.Visibility = System.Windows.Visibility.Hidden; lblSchoolOrOrganization.Visibility = System.Windows.Visibility.Hidden; txtbxSchoolOrOrganization.Visibility = System.Windows.Visibility.Hidden; txtbxSchoolOrOrganization.IsEnabled = false; rctMajorOrPosition.Visibility = System.Windows.Visibility.Hidden; lblMajorOrPosition.Visibility = System.Windows.Visibility.Hidden; txtbxMajorOrPosition.Visibility = System.Windows.Visibility.Hidden; txtbxMajorOrPosition.IsEnabled = false; rctClassStanding.Visibility = System.Windows.Visibility.Hidden; lblClassStanding.Visibility = System.Windows.Visibility.Hidden; cmbClassStanding.IsEnabled = false; cmbClassStanding.Visibility = System.Windows.Visibility.Hidden; cmbClassStanding.SelectedIndex = (int)Controller.ClassStanding.SELECT; return; } #endregion //REGISTER }
private Window_AdminLogin() { InitializeComponent(); controller = null; }