Ejemplo n.º 1
0
        // this will create a ticket specifically for appointments and will skip the rest of the questions
        // also writes to csv file if logging is enabled
        private void SendAppointment(string prob)
        {
            if (EmailLogging == true)
            {
                int result = SendTicket(StudentIDPage.StudentID, prob, prob, true); // send in otrs ticket 
                if (result < 0)
                {
                    return; // Don't write to file if attempt to send emails.. this will prevent duplicates and keep the summary page open
                }
            }

            if (Logging == true && _writer != null)
            {
                //write to csv file
                addToCurrent(StudentIDPage.StudentID);
                addToCurrent("Appointment");
                addToCurrent(AppointmentProbPage.Problem);
                writeLine();
            }

            //let customer know they can sit down
            MessageWindow mw = new MessageWindow("Thank you, please take a seat at a table and someone will help you shortly.", 4.0);
            mw.ShowDialog();

            //get back to first state
            Reset();
        }
Ejemplo n.º 2
0
        //automatically starts the day when the timer is hit
        private void AutoStartLog(object sender, EventArgs e) {
            startDayTimer.IsEnabled = false; // stop timer

            // start the log and display message
            // if it is Monday then we create a new log for the week.
            //we make the name of the log being the date in the MM-dd-yyyy format
            if (DateTime.Today.DayOfWeek != DayOfWeek.Saturday && DateTime.Today.DayOfWeek != DayOfWeek.Sunday) { // don't start logs on saturday/sunday
                if (DateTime.Now.DayOfWeek == DayOfWeek.Monday)
                {
                    CreateLog("Week_of_" + DateTime.Now.ToString("MM-dd-yyyy"), FileMode.Create); // creates a new .csv file for the week
                }

                StartLog(); // enable Logging & EmailLogging
                MessageWindow mw = new MessageWindow("Start New day \n" + DateTime.Now.ToString("MM-dd-yyyy"), 3.0);
                mw.Show();
            }

            startDayTimer.Interval = TimeUntilNextTimer(startTime); // update time to next day at 7:30 am
            startDayTimer.IsEnabled = true;
        }
Ejemplo n.º 3
0
        //automatically ends the log
        private void AutoEndLog(object sender, EventArgs e) {
            endDayTimer.IsEnabled = false; // stop timer

            // end the log and display message
            if (null != _writer) {
                EndLog();

                if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
                {
                    FinishLog(); // write final stats to weekly file if end of day on Friday
                }

                MessageWindow mw = new MessageWindow("End day \n" + DateTime.Now.ToString("MM-dd-yyyy"), 3.0);
                mw.Show();
            }

            endDayTimer.Interval = TimeUntilNextTimer(endTime); // update time to next day at 5:00 pm
            endDayTimer.IsEnabled = true;
        }
Ejemplo n.º 4
0
        // User submits their info and it gets written to the csv file and sent to OTRS if enabled
        private void _summary_page_PageFinished(object sender, EventArgs e)
        {

            /// Removed rental and Device
            if (EmailLogging == true)
            { // don't send tickets that are rentals (ramsay creates one)
                int result = SendTicket(StudentIDPage.StudentID, ProblemPage.Problem, ProblemPage.Description, false); // send in otrs ticket 
                if (result < 0)
                {
                    return; // Don't write to file if attempt to send emails.. this will prevent duplicates and keep the summary page open
                }
            }

            if (Logging == true && _writer != null)
            {
                //write to csv file
                addToCurrent(StudentIDPage.StudentID);
                addToCurrent(ProblemPage.Problem);
                addToCurrent(ProblemPage.Description);
                writeLine();
            }

            //let customer know they can sit down
            MessageWindow mw = new MessageWindow("Thank you, please take a seat at a table and someone will help you shortly.", 4.0);
            mw.ShowDialog();

            //get back to first state
            Reset();
        }