示例#1
0
 private void LoadDay(DateTime value)
 {
     FilePusher.ReadDay(value);
     lbSched.ItemsSource = FilePusher.shows;
     LTotalTicks.Content = "Today's Total: " + FilePusher.TotalShows.ToString();
     LoadShow(0);
     if (value.Date.Equals(DateTime.Today))
     {
         Lwarn.Visibility = Visibility.Hidden;
         if (FilePusher.HasMoreShows)
         {
             timer.Interval = FilePusher.NextShowTime - DateTime.Now;
             timer.Start();
         }
         else
         {
             if (timer.IsEnabled)
             {
                 timer.Stop();
             }
         }
     }
     else
     {
         Lwarn.Visibility = Visibility.Visible;
         if (timer.IsEnabled)
         {
             timer.Stop();
         }
     }
 }
示例#2
0
 public MainWindow()
 {
     InitializeComponent();
     Directory.CreateDirectory(FilePusher.folder);
     FilePusher.init();
     timer.Tick           += Timer_Tick;
     FilePusher.TotMessage = LTotalTicks;
     LoadDay(DateTime.Today);
 }
示例#3
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (NoShow)
     {
         MessageBox.Show("No suitable Show Times", "Alert", MessageBoxButton.OK, MessageBoxImage.Information);
         return;
     }
     item.ShowTime = SOI[CMBShowsAvalible.SelectedIndex].DTShowTime;
     FilePusher.RemoveTicket(ShowIndex, TicketIndex);
     FilePusher.AddTicket(item);
     FilePusher.TotMessage.Content = "Today's Total: " + FilePusher.TotalShows.ToString();
     this.Close();
 }
示例#4
0
 //Q: How will this work if the schedule crosses Midnight?
 //A: Don't worry about that. It's outside the scope of this project.
 void Timer_Tick(object sender, EventArgs e)
 {
     if (FilePusher.shows[0].DTShowTime.Date == DateTime.Today)
     {
         FilePusher.UpLastColor();
     }
     if (FilePusher.HasMoreShows)
     {
         timer.Interval = FilePusher.NextShowTime - DateTime.Now;
     }
     else
     {
         timer.Stop();
     }
 }
示例#5
0
 private void SetShows(DateTime _dt)
 {
     //Check if FilePusher.shows is the same day as _dt
     SOI    = FilePusher.MakeShowOptions(_dt, FilePusher.shows[ShowIndex].Tickets[TicketIndex ?? 0].NumTickets);
     NoShow = false;
     if (SOI.Count == 0)
     {
         SOI.Add(new ShowOptionItem()
         {
             ShowOption = "No Available Shows"
         });
         NoShow = true;
     }
     CMBShowsAvalible.ItemsSource   = SOI;
     CMBShowsAvalible.SelectedIndex = 0;
 }
示例#6
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var clean = new System.Text.RegularExpressions.Regex(@"[^\d]");
            var phone = clean.Replace(TBPhone.Text, "");

            if (phone.Length != 10 && phone.Length != 7)
            {
                phone = "";
            }
            var t = new TicketItem()
            {
                ShowTime = SchedItemShow, SaleType = RBFree.IsChecked ?? false ? 'F' : RBDiscount.IsChecked ?? false ? 'D' : 'P', NumTickets = CMBTicketAvalible.SelectedIndex + 1, BuyerName = TBName.Text.Replace(',', '.'), Phone = phone, Created = DateTime.Now
            };

            FilePusher.AddTicket(t);
            Close();
            FilePusher.TotMessage.Content = "Today's Total: " + FilePusher.TotalShows.ToString();
        }
示例#7
0
 private void BtnDelete_Click(object sender, RoutedEventArgs e)
 {
     FilePusher.RemoveTicket(CurrentShowDisplayed, (sender as Button).Tag as int?);
     LTotalTicks.Content = "Today's Total: " + FilePusher.TotalShows.ToString();
 }