Beispiel #1
0
 private void saveButton_Click(object sender, RoutedEventArgs e)
 {
     if (hourlyPayTextBlock.Text != "")
     {
         try
         {
             List <Work_Day> workDays = new List <Work_Day>();
             workDays.Add(new Work_Day(Day.Monday, double.Parse(mondayHoursWorkedTextBox.Text), double.Parse(mondayLunchTextBox.Text), double.Parse(mondayBreakTextBox.Text)));
             workDays.Add(new Work_Day(Day.Tuesday, double.Parse(tuesdayHoursWorkedTextBox.Text), double.Parse(tuesdayLunchTextBox.Text), double.Parse(tuesdayBreakTextBox.Text)));
             workDays.Add(new Work_Day(Day.Wednesday, double.Parse(wednesdayHoursWorkedTextBox.Text), double.Parse(wednesdayLunchTextBox.Text), double.Parse(wednesdayBreakTextBox.Text)));
             workDays.Add(new Work_Day(Day.Thursday, double.Parse(thursdayHoursWorkedTextBox.Text), double.Parse(thursdayLunchTextBox.Text), double.Parse(thursdayBreakTextBox.Text)));
             workDays.Add(new Work_Day(Day.Friday, double.Parse(fridayHoursWorkedTextBox.Text), double.Parse(fridayLunchTextBox.Text), double.Parse(fridayBreakTextBox.Text)));
             workDays.Add(new Work_Day(Day.Saturday, double.Parse(saturdayHoursWorkedTextBox.Text), double.Parse(saturdayLunchTextBox.Text), double.Parse(saturdayBreakTextBox.Text)));
             workDays.Add(new Work_Day(Day.Sunday, double.Parse(sundayHoursWorkedTextBox.Text), double.Parse(sundayLunchTextBox.Text), double.Parse(sundayBreakTextBox.Text)));
             workWeek = new Work_Week(new Job(double.Parse(payedBreakTextBlock.Text), double.Parse(hourlyPayTextBlock.Text)), workDays);
             payedHoursTextBlock.Text = workWeek.weeklyHours.ToString();
             overtimeTextBlock.Text   = workWeek.overtimeHours.ToString();
             totalPayTextBlock.Text   = workWeek.CalculatePay().ToString();
         }
         catch (Exception)
         {
             MessageBox.Show("Please fill out all the boxes");
         }
     }
     else
     {
         MessageBox.Show("Please select your job");
     }
 }
Beispiel #2
0
 public InvoiceMenu(Work_Week workWeek, Job job, Employee employee)
 {
     InitializeComponent();
     chargeables        = new List <Chargeable>();
     invoiceChargeables = new List <Chargeable>();
     this.employee      = employee;
     this.job           = job;
     this.workWeek      = workWeek;
 }
Beispiel #3
0
 public Invoice(int id, Work_Week workWeek, List <Chargeable> chargeables)
 {
     this.id          = id;
     this.workWeek    = workWeek;
     this.chargeables = chargeables;
 }