/* * /// <summary> * /// Forms a ticket to be sent to Jira via the cougtech walk in email service. * /// </summary> * /// <param name="id">Users WSU NID.</param> * /// <param name="prob">Problem type.</param> * /// <param name="descr">The problem description.</param> * /// <param name="isAppt">Boolean for if the ticket is an appointment.</param> * /// <returns>0 if the ticket was submitted. -1 if the ticket submission failed.</returns> * public int SendTicket_Email(string id, string prob, string descr, bool isAppt) * { * //New mail object * MailMessage msg = new MailMessage(); * MailAddress mailFrom = new MailAddress("*****@*****.**" + "<" + wsuEmail + ">"); * MailAddress mailTo = new MailAddress("*****@*****.**"); * * msg.To.Add(mailTo); * msg.From = mailFrom; * * SmtpClient client = new SmtpClient("mail.wsu.edu"); * * * //Format the subject based on the ticket information * if (StudentIDPage.IsTest) //Test ticket * { * msg.Subject = "##CTtest : " + prob + " : " + id; * } * else if (StudentIDPage.IsQuickPick) //Quickpick ticket * { * msg.Subject = "##CTwi : " + StudentIDPage.QuickCode; * } * else if (isAppt) //Appointment ticket * { * msg.Subject = "##CTapt : " + prob + " : " + id + " : " + QueryFirstName(id); * } * else //Standard walk-in ticket * { * msg.Subject = "##CTwi : " + prob + " : " + id + " : " + QueryFirstName(id); * } * * //Build the message body * StringBuilder sb = new StringBuilder(); * sb.AppendLine(DateTime.Now.ToLongTimeString() + "\n" + id + "\n\n" + prob + "\n\n" + descr); * sb.AppendLine("\n\nVerify the Customer's information in the Reporter field."); * sb.AppendLine("Assign to yourself, if not already assigned."); * sb.AppendLine("Start work notes using Start Work."); * sb.AppendLine("Finish with Close or Move."); * msg.Body = sb.ToString(); * * //Change the cursor * Cursor = Cursors.AppStarting; * * //Send the message * try * { * client.Send(msg); * } * catch (Exception e) * { * MessageBox.Show("Ticket failed to send\nPlease try again."); * Cursor = Cursors.Arrow; * return -1; //-1 for error * } * * //Change the cursor back * Cursor = Cursors.Arrow; * * return 0; //0 for success * } */ // Private Functions /////////////////////////////////////////////////////////////////// /// <summary> /// /// </summary> private void AdminWindow_Login() { AdminWindow adminWindow = new AdminWindow(this, Cougtech_CustomerLogger.Logging_En, Cougtech_CustomerLogger.Ticketing_Email_En, Cougtech_CustomerLogger.Ticketing_Jira_En); if (adminWindow.Authenticate()) { adminWindow.ShowDialog(); } }
//opens the admin button, after the user successfully puts in our secret password private void AdminButton_Click(object sender, RoutedEventArgs e) { PasswordWindow ap = new PasswordWindow(""); ap.ShowDialog(); //This is also terrible, but easy to use... but still, we should move this out to a file somewhere //because this is dumb //and bad, and should be fixed if we want to do this correctly //woot woot for hardcoded passwords.... if (ap.Password == "couglolz") // open admin window only if password is correct { AdminWindow aw = new AdminWindow(this); aw.ShowDialog(); // keeps admin window on top of all other windows, preventing multiple admin windows from opening } }
//opens the admin button, after the user successfully puts in our secret password private void AdminButton_Click(object sender, RoutedEventArgs e) { PasswordWindow ap = new PasswordWindow(""); ap.ShowDialog(); //This is also terrible, but easy to use... but still, we should move this out to a file somewhere //because this is dumb //and bad, and should be fixed if we want to do this correctly //woot woot for hardcoded passwords.... if (ap.Password == "couglolz") { // open admin window only if password is correct AdminWindow aw = new AdminWindow(this); aw.ShowDialog(); // keeps admin window on top of all other windows, preventing multiple admin windows from opening } }