private void buttonUpdateMomhour_Click(object sender, RoutedEventArgs e) { try { bl.updateMother(mom); if (!bl.checkSchedule(bl.getNanny(contract.idNanny), mom)) { throw new Exception("המטפלת לא עובדת בשעות הנדרשות"); } if (contract.isHour == true) { contract.salaryPerHour = bl.getSalary(contract.idChild, contract.idNanny, true, true); } else { contract.salaryPerHour = 0; } contract.salaryPerMonth = bl.getSalary(contract.idChild, contract.idNanny, false, true); } catch (Exception Ex) { MessageBox.Show(Ex.Message); } }
private void button1_Click(object sender, RoutedEventArgs e) { try { nannyToUpdate = bl.getNanny(Convert.ToInt64(nannyIdTextBox.Text)); this.DataContext = nannyToUpdate; //if (nannyToUpdate.daysWorkNanny[0] == true) //{ // SunCheck.IsChecked = true; // SunStart.Value = nannyToUpdate.startHour[0]; // SunEnd.Value = nannyToUpdate.endHour[0]; //} //if (nannyToUpdate.daysWorkNanny[1] == true) //{ // MonCheck.IsChecked = true; // MonStart.Value = nannyToUpdate.startHour[1]; // MonEnd.Value = nannyToUpdate.endHour[1]; //} //if (nannyToUpdate.daysWorkNanny[2] == true) //{ // TueCheck.IsChecked = true; // TueStart.Value = nannyToUpdate.startHour[2]; // TueEnd.Value = nannyToUpdate.endHour[2]; //} //if (nannyToUpdate.daysWorkNanny[3] == true) //{ // WedCheck.IsChecked = true; // WedStart.Value = nannyToUpdate.startHour[3]; // WedEnd.Value = nannyToUpdate.endHour[3]; //} //if (nannyToUpdate.daysWorkNanny[4] == true) //{ // ThuCheck.IsChecked = true; // ThuStart.Value = nannyToUpdate.startHour[4]; // ThuEnd.Value = nannyToUpdate.endHour[4]; //} //if (nannyToUpdate.daysWorkNanny[5] == true) //{ // FriCheck.IsChecked = true; // FriStart.Value = nannyToUpdate.startHour[5]; // FriEnd.Value = nannyToUpdate.endHour[5]; //} } catch (Exception Ex) { MessageBox.Show(Ex.Message); } }