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 button3_Click(object sender, RoutedEventArgs e) { try { mother.AddressMom = addressMomTextBox1.Text; mother.AddressForNanny = addressForNannyTextBox1.Text; bl.updateMother(mother); MessageBox.Show("פרטי האם עודכנו"); motherUpdateCombo.SelectedIndex = -1; mother = new BE.Mother(); updateMomTab.DataContext = mother; } catch (Exception Ex) { MessageBox.Show(Ex.Message); } }
private void button1_Click(object sender, RoutedEventArgs e) { try { if ((bool)(SunCheck.IsChecked == true)) { mom.DaysRequestMom[0] = true; var start = SunStart.Value; var end = SunEnd.Value; mom.startHour[0] = Convert.ToDateTime(start); mom.endHour[0] = Convert.ToDateTime(end); } if ((bool)(MonCheck.IsChecked == true)) { mom.DaysRequestMom[1] = true; var start = MonStart.Value; var end = MonEnd.Value; mom.startHour[1] = Convert.ToDateTime(start); mom.endHour[1] = Convert.ToDateTime(end); } if ((bool)(TueCheck.IsChecked == true)) { mom.DaysRequestMom[2] = true; var start = TueStart.Value; var end = TueEnd.Value; mom.startHour[2] = Convert.ToDateTime(start); mom.endHour[2] = Convert.ToDateTime(end); } if ((bool)(WedCheck.IsChecked == true)) { mom.DaysRequestMom[3] = true; var start = WedStart.Value; var end = WedEnd.Value; mom.startHour[3] = Convert.ToDateTime(start); mom.endHour[3] = Convert.ToDateTime(end); } if ((bool)(ThuCheck.IsChecked == true)) { mom.DaysRequestMom[4] = true; var start = ThuStart.Value; var end = ThuEnd.Value; mom.startHour[4] = Convert.ToDateTime(start); mom.endHour[4] = Convert.ToDateTime(end); } if ((bool)(FriCheck.IsChecked == true)) { mom.DaysRequestMom[5] = true; var start = FriStart.Value; var end = FriEnd.Value; mom.startHour[5] = Convert.ToDateTime(start); mom.endHour[5] = Convert.ToDateTime(end); } bl.updateMother(mom); MessageBox.Show("פרטי האם עודכנו"); this.Close(); } catch (Exception exception) { MessageBox.Show("check your input and try again"); } }