private void ReopenButton_Click(object sender, RoutedEventArgs e)
 {
     _ticket.TicketUrgency = (Urgency)this.PriorityComboBoxinView.SelectedItem;
     TicketManager.SaveTicket(_ticket);
     (new MainWindow()).Show();
     this.Close();
 }
 private void CloseButton_Click(object sender, RoutedEventArgs e)
 {
     _ticket.TicketUrgency = Urgency.None;
     _ticket.TicketCloseDates.Add(DateTime.Now);
     TicketManager.SaveTicket(_ticket);
     (new MainWindow()).Show();
     this.Close();
 }
Esempio n. 3
0
        public MainWindow()
        {
            InitializeComponent();

            // Set Sources
            _tickets = TicketManager.GetTickets();
            TicketListView.ItemsSource = _tickets;

            _finances = FinanceManager.GetFinances();
            FinancesListView.ItemsSource = _finances;

            _businesses = CustomerManager.GetCustomers();
            BussinessListView.ItemsSource = _businesses;

            _techs = TechnicianManager.GetTechnicians();
            TechListView.ItemsSource = _techs;
        }
Esempio n. 4
0
        private void SubmitButton_Click(object sender, RoutedEventArgs e)
        {
            if (Utility.TextHasNoData(this.DueDateTextBox) || Utility.TextHasNoData(this.ProbDescriptionTextBox))
            {
                MessageBox.Show("Please Input into all fields");
                return;
            }
            if (PriorityComboBox.SelectedItem == null)
            {
                MessageBox.Show("Please Select a priority");
                return;
            }

            // Parse the due Date
            const DateTimeStyles style = DateTimeStyles.AllowWhiteSpaces;
            DateTime             dueDate;

            if (!DateTime.TryParseExact(DueDateTextBox.Text, "yyyy-MM-dd", CultureInfo.InvariantCulture, style, out dueDate))
            {
                MessageBox.Show("Invalid yyyy-MM-dd in due date box");
                return;
            }

            if (CustomerEntities.Count == 0)
            {
                MessageBox.Show("Please Select a Customer and Entity");
                return;
            }

            // Lets Create the Ticket
            Ticket ticket = new Ticket {
                TicketDescription = ProbDescriptionTextBox.Text,
                TicketHolder      = CustomerEntities[0].Entity,
                TicketRequested   = dueDate,
                TicketUrgency     = (Urgency)PriorityComboBox.SelectedItem,
                TicketOpenDates   = new ObservableCollection <DateTime>(),
                TicketCloseDates  = new ObservableCollection <DateTime>(),
                TicketTechnician  = Technicians
            };

            ticket.TicketOpenDates.Add(DateTime.Now);
            TicketManager.AddTicket(ticket);
        }