public MotherCard(Mother MotherToShow, DataGrid dataGridInput) { InitializeComponent(); try { bl = FactoryBL.GetBL(); dataGridToRefresh = dataGridInput; motherOfCard = MotherToShow.GetCopy(); ID_TextBlock.Text = MotherToShow.MomID.ToString(); FirstName_TextBlock.Text = MotherToShow.MomFirstName; LastName_TextBlock.Text = MotherToShow.MomFamilyName; PhoneNumber_TextBlock.Text = "0" + MotherToShow.MomPhoneNum.ToString(); Adress_TextBlock.Text = MotherToShow.MomAdress; NannyAdress_TextBlock.Text = MotherToShow.MomSearchAdress; Comments_TextBlock.Text = MotherToShow.MomComment; for (int i = 0; i < 6; i++) { if (MotherToShow.MomDaysNannyNeeds[i]) { switch (i) { case 0: Sunday_Day_TextBlock.Visibility = Visibility.Visible; Sunday_Time_TextBlock.Visibility = Visibility.Visible; Sunday_Day_TextBlock.Text = UiTools.NumToDay(i); Sunday_Time_TextBlock.Text = MotherToShow.MomHoursNannyNeeds[i].ToString(); break; case 1: Monday_Day_TextBlock.Visibility = Visibility.Visible; Monday_Time_TextBlock.Visibility = Visibility.Visible; Monday_Day_TextBlock.Text = UiTools.NumToDay(i); Monday_Time_TextBlock.Text = MotherToShow.MomHoursNannyNeeds[i].ToString(); break; case 2: Tuesday_Day_TextBlock.Visibility = Visibility.Visible; Tuesday_Time_TextBlock.Visibility = Visibility.Visible; Tuesday_Day_TextBlock.Text = UiTools.NumToDay(i); Tuesday_Time_TextBlock.Text = MotherToShow.MomHoursNannyNeeds[i].ToString(); break; case 3: Wednesday_Day_TextBlock.Visibility = Visibility.Visible; Wednesday_Time_TextBlock.Visibility = Visibility.Visible; Wednesday_Day_TextBlock.Text = UiTools.NumToDay(i); Wednesday_Time_TextBlock.Text = MotherToShow.MomHoursNannyNeeds[i].ToString(); break; case 4: Thursday_Day_TextBlock.Visibility = Visibility.Visible; Thursday_Time_TextBlock.Visibility = Visibility.Visible; Thursday_Day_TextBlock.Text = UiTools.NumToDay(i); Thursday_Time_TextBlock.Text = MotherToShow.MomHoursNannyNeeds[i].ToString(); break; case 5: Friday_Day_TextBlock.Visibility = Visibility.Visible; Friday_Time_TextBlock.Visibility = Visibility.Visible; Friday_Day_TextBlock.Text = UiTools.NumToDay(i); Friday_Time_TextBlock.Text = MotherToShow.MomHoursNannyNeeds[i].ToString(); break; default: break; } } } MotherToShow = new Mother(); } catch (Exception c) { MessageBox.Show(c.Message); } }
public NannyCard(Nanny NannyToShow, DataGrid dataGridInput) { InitializeComponent(); dataGridToRefresh = dataGridInput; bl = FactoryBL.GetBL(); nannyOfCard = NannyToShow.GetCopy(); ID_TextBox.Text = NannyToShow.NannyId.ToString(); FirstName_TextBox.Text = NannyToShow.NannyPrivateName; LastName_TextBox.Text = NannyToShow.NannyFamilyName; PhoneNumber_TextBox.Text = "0" + NannyToShow.NannyPhoneNum.ToString(); birth_TextBox.Text = NannyToShow.NannyDateOfBirth.Day + "/" + NannyToShow.NannyDateOfBirth.Month + "/" + NannyToShow.NannyDateOfBirth.Year; Adress_TextBox.Text = NannyToShow.NannyAdress; Floor_TextBox.Text = NannyToShow.NannyFloor.ToString(); Elevator_CheckBox.IsChecked = NannyToShow.NannyIsElevator; Experience_TextBox.Text = NannyToShow.NannyYearsOfExperience.ToString(); Maxchildrens_TextBox.Text = NannyToShow.NannyMaxInfants.ToString(); AgeRange_TextBox.Text = NannyToShow.NannyMinInfantAge.ToString() + "-" + NannyToShow.NannyMaxInfantAge.ToString(); Vacation_TextBox.Text = NannyToShow.NannyIsElevator ? "Ministry of Education" : "Ministry of Industry and Trade"; MonthlySalary_TextBox.Text = NannyToShow.NannyMonthlySalary.ToString() + " NIS"; HourlySalary_TextBox.Text = NannyToShow.NannyIsHourlySalary ? NannyToShow.NannyHourlySalary.ToString() + " NIS" : "Does not allow hourly salary"; Recommendations_TextBox.Text = NannyToShow.NannyRecommendations; for (int i = 0; i < 6; i++) { if (NannyToShow.NannyWorkingDays[i]) { switch (i) { case 0: Sunday_Day_TextBlock.Visibility = Visibility.Visible; Sunday_Time_TextBlock.Visibility = Visibility.Visible; Sunday_Day_TextBlock.Text = UiTools.NumToDay(i); Sunday_Time_TextBlock.Text = NannyToShow.NannyWorkingHours[i].ToString(); break; case 1: Monday_Day_TextBlock.Visibility = Visibility.Visible; Monday_Time_TextBlock.Visibility = Visibility.Visible; Monday_Day_TextBlock.Text = UiTools.NumToDay(i); Monday_Time_TextBlock.Text = NannyToShow.NannyWorkingHours[i].ToString(); break; case 2: Tuesday_Day_TextBlock.Visibility = Visibility.Visible; Tuesday_Time_TextBlock.Visibility = Visibility.Visible; Tuesday_Day_TextBlock.Text = UiTools.NumToDay(i); Tuesday_Time_TextBlock.Text = NannyToShow.NannyWorkingHours[i].ToString(); break; case 3: Wednesday_Day_TextBlock.Visibility = Visibility.Visible; Wednesday_Time_TextBlock.Visibility = Visibility.Visible; Wednesday_Day_TextBlock.Text = UiTools.NumToDay(i); Wednesday_Time_TextBlock.Text = NannyToShow.NannyWorkingHours[i].ToString(); break; case 4: Thursday_Day_TextBlock.Visibility = Visibility.Visible; Thursday_Time_TextBlock.Visibility = Visibility.Visible; Thursday_Day_TextBlock.Text = UiTools.NumToDay(i); Thursday_Time_TextBlock.Text = NannyToShow.NannyWorkingHours[i].ToString(); break; case 5: Friday_Day_TextBlock.Visibility = Visibility.Visible; Friday_Time_TextBlock.Visibility = Visibility.Visible; Friday_Day_TextBlock.Text = UiTools.NumToDay(i); Friday_Time_TextBlock.Text = NannyToShow.NannyWorkingHours[i].ToString(); break; default: break; } } } NannyToShow = new Nanny(); }