private void Zakazi_click(object sender, RoutedEventArgs e) { String b = bingPathToAppDir(@"JsonFiles\appointments.json"); String c = bingPathToAppDir(@"JsonFiles\refferal.json"); String d = bingPathToAppDir(@"JsonFiles\patients.json"); String m = bingPathToAppDir(@"JsonFiles\doctors.json"); PatientsRepository patientRepo = new PatientsRepository(d); List <PatientUser> patientLista = patientRepo.GetAll(); PatientUser ovajPacijent = new PatientUser(); foreach (PatientUser r1 in patientLista) { if (r1.medicalIdNumber.Equals(KnjizicaBox.Text.ToString())) { ovajPacijent = r1; KnjizicaBox.Text = r1.medicalIdNumber; } } DoctorRepository docRepo = new DoctorRepository(m); List <DoctorUser> doktori = docRepo.GetAll(); DoctorUser drOvaj = new DoctorUser(); foreach (DoctorUser d1 in doktori) { if (d1.email.Equals(emailLekarBox.Text.ToString())) { drOvaj = d1; } } String konacnoVreme = ""; String vreme = TimeText; Console.WriteLine(vreme); String[] deliciVreme = vreme.Split(' '); String[] satIminut = deliciVreme[0].Split(':'); String sat = satIminut[0]; String minut = satIminut[1]; String kada = deliciVreme[1]; StringBuilder sb = new StringBuilder(); if (kada.Equals("AM")) { sb.Append(deliciVreme[0]); sb.Append(":00"); } else { if (sat.Equals("1")) { sb.Append("13:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("2")) { sb.Append("14:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("3")) { sb.Append("15:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("4")) { sb.Append("16:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("5")) { sb.Append("17:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("6")) { sb.Append("18:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("7")) { sb.Append("19:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("8")) { sb.Append("20:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("9")) { sb.Append("21:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("10")) { sb.Append("22:"); sb.Append(minut); sb.Append(":00"); } else if (sat.Equals("11")) { sb.Append("23:"); sb.Append(minut); sb.Append(":00"); } else { sb.Append("00:"); sb.Append(minut); sb.Append(":00"); } } konacnoVreme = sb.ToString(); Console.WriteLine(konacnoVreme); String[] zaTs = konacnoVreme.Split(':'); int minutiVreme = int.Parse(zaTs[1]); TimeSpan ts = new TimeSpan(int.Parse(zaTs[0]), minutiVreme, int.Parse(zaTs[2])); String konacnoVreme1 = ""; String vreme1 = TimeText1; Console.WriteLine(vreme); String[] deliciVreme1 = vreme1.Split(' '); String[] satIminut1 = deliciVreme1[0].Split(':'); String sat1 = satIminut1[0]; String minut1 = satIminut1[1]; String kada1 = deliciVreme1[1]; StringBuilder sb1 = new StringBuilder(); if (kada1.Equals("AM")) { sb1.Append(deliciVreme1[0]); sb1.Append(":00"); } else { if (sat1.Equals("1")) { sb1.Append("13:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("2")) { sb1.Append("14:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("3")) { sb1.Append("15:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("4")) { sb1.Append("16:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("5")) { sb1.Append("17:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("6")) { sb1.Append("18:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("7")) { sb1.Append("19:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("8")) { sb1.Append("20:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("9")) { sb1.Append("21:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("10")) { sb1.Append("22:"); sb1.Append(minut1); sb1.Append(":00"); } else if (sat1.Equals("11")) { sb1.Append("23:"); sb1.Append(minut1); sb1.Append(":00"); } else { sb1.Append("00:"); sb1.Append(minut1); sb1.Append(":00"); } } konacnoVreme1 = sb1.ToString(); Console.WriteLine(konacnoVreme); Console.WriteLine(konacnoVreme1); String[] zaTs1 = konacnoVreme1.Split(':'); int minutiVreme1 = int.Parse(zaTs1[1]); TimeSpan ts1 = new TimeSpan(int.Parse(zaTs1[0]), minutiVreme1, int.Parse(zaTs1[2])); String[] deloviVreme = vreme.Split(':'); //String[] deloviVreme2 = vreme2.Split(':'); // TimeSpan vremee = new TimeSpan(int.Parse(deloviVreme[0]), int.Parse(deloviVreme[1]), 0); // TimeSpan vremee2 = new TimeSpan(int.Parse(deloviVreme2[0]), int.Parse(deloviVreme2[1]), 0); int broj = getNextid(); DoctorAppointment drap = new DoctorAppointment(0, ts, DatumBox.Text.ToString(), ovajPacijent, drOvaj, null, ordinacijaBox.Text); AppointmentRepository arepo = new AppointmentRepository(b); List <DoctorAppointment> lista2 = new List <DoctorAppointment>(); PatientController regPat = new PatientController(); List <PatientUser> pac = new List <PatientUser>(); pac = regPat.GetAll(); if (arepo.GetAll() != null) { lista2 = arepo.GetAll(); } String o = bingPathToAppDir(@"JsonFiles\operations.json"); int broj1 = getNextid1(); Operation op = new Operation(0, ovajPacijent, DatumBox.Text.ToString(), ts, ts1, drOvaj, ordinacijaBox.Text, null); OperationRepository opRep = new OperationRepository(o); List <Operation> lista3 = new List <Operation>(); if (opRep.GetAll() != null) { lista3 = opRep.GetAll(); } if (pregled == true) { String datum = DatumBox.Text; String[] delovi2 = datum.Split('/'); int mesec = int.Parse(delovi2[1]); int dan = int.Parse(delovi2[0]); int godina = int.Parse(delovi2[2]); DateTime dt1 = new DateTime(godina, mesec, dan, 0, 0, 0); DateTime dt2 = DateTime.Now; if (dt1 < dt2) { MessageBox.Show("Molimo vas da unesete datum koji tek predstoji", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } String x = bingPathToAppDir(@"JsonFiles\appointments.json"); AppointmentRepository apc = new AppointmentRepository(x); List <DoctorAppointment> listaPregleda = apc.GetAll(); /* foreach (DoctorAppointment dd in listaPregleda) * { * DoctorUser dr = dd.doctor; * if (dr.id == drOvaj.id) * { * if (dd.Date.Equals(DatumBox.Text)) * { * TimeSpan krajPr = dd.Time + new TimeSpan(0, 15, 0); * int result = TimeSpan.Compare(vremee, dd.Time); * int result1 = TimeSpan.Compare(vremee, krajPr); * if ((result == 1 && result1 == -1) || result == 0) * { * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * } * * * * * } * }*/ /* String pre = bingPathToAppDir(@"JsonFiles\operations.json"); * OperationRepository apc1 = new OperationRepository(pre); * List<Operation> listaPregleda1 = apc1.GetAll(); * foreach (Operation dd in listaPregleda1) * { * DoctorUser dr = dd.isResponiable; * if (dr.id == drOvaj.id) * { * if (dd.Date.Equals(DatumBox.Text)) * { * int result = TimeSpan.Compare(vremee, dd.Start); * int result1 = TimeSpan.Compare(vremee, dd.End); * if ((result == 1 && result1 == -1)||result==0 ||result1==0) * { * * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * * } * * * * * } * }*/ EmployeesScheduleController schCon = new EmployeesScheduleController(); List <Schedule> listaRasporeda = schCon.GetAll(); Shift smena = schCon.getShiftForDoctorForSpecificDay(DatumBox.Text, drOvaj); if (smena == null || smena.startTime == null || smena.endTime == null) { MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi tog dana.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } AppointmentController appointmentController = new AppointmentController(); Boolean notAvaible = appointmentController.isTermNotAvailable(drOvaj, ts, DatumBox.Text, ovajPacijent); if (notAvaible == true) { MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } /* foreach (Schedule s in listaRasporeda) * { * * if (s.employeeid.Equals(drOvaj.id.ToString())) * { * if (s.Date.Equals(DatumBox.Text)) * { * smena = s.shift; * } * } * } * if(smena.StartTime==null || smena.EndTime == null) * { * * }*/ bool slobodan = schCon.isDoctorWorkingAtSpecifiedTime(DatumBox.Text, drOvaj, ts); if (slobodan == false) { MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } /* String pocetak = smena.StartTime; * String kraj = smena.EndTime; * String[] deloviPocetak = pocetak.Split(':'); * String[] deloviKraj = kraj.Split(':'); * * TimeSpan pocetakTime = new TimeSpan(int.Parse(deloviPocetak[0]), int.Parse(deloviPocetak[1]), 0); * TimeSpan krajTime = new TimeSpan(int.Parse(deloviKraj[0]), int.Parse(deloviKraj[1]), 0); * int result3 = TimeSpan.Compare(vremee, pocetakTime); * int result4 = TimeSpan.Compare(krajTime, vremee); * * if (result3 != 1 || result4 != 1) * { * MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * * return; * * }*/ AppointmentController apCon = new AppointmentController(); apCon.New(drap, null); int id1 = 0; String ime = ""; String prezime = ""; String jmbg = ""; String datumRodj = ""; String brojTel = ""; String brKnj = ""; List <Question> pitanja = new List <Question>(); String alergije = ""; String grad = ""; Boolean guest = false; String email = ""; String password = ""; Boolean sekr = false; // foreach (PatientUser pat in lista) // { // if (pat.id.Equals(d.patient.id)) // { id1 = drap.patient.id; ime = drap.patient.firstName; prezime = drap.patient.secondName; jmbg = drap.patient.uniqueCitizensidentityNumber; datumRodj = drap.patient.dateOfBirth; brKnj = drap.patient.medicalIdNumber; brojTel = drap.patient.phoneNumber; alergije = drap.patient.allergie; grad = drap.patient.city; email = drap.patient.email; guest = drap.patient.guest; password = drap.patient.password; sekr = drap.patient.isRegisteredBySecretary; if (drap.patient.notifications == null) { drap.patient.notifications = new List <ModelNotification>(); } List <ModelNotification> notifications = drap.patient.notifications; // } notifications.Add(new ModelNotification("Postovani, zakazana vam je novi pregled datuma : " + drap.date + " u " + drap.time + " h kod lekara " + drap.doctor.firstName + " " + drap.doctor.secondName + ". Ordinacija: " + drap.roomid)); drap.patient.notifications = notifications; // PatientUser rp = new PatientUser(id1, ime, prezime, jmbg, datumRodj, brojTel, brKnj, pitanja, alergije, grad, guest, email, password, sekr, notifications); PatientController pCon = new PatientController(); pCon.Update(drap.patient); Panel.Children.Clear(); UserControl usc = new PopunjeniTermini(); Panel.Children.Add(usc); } else if (operacija == true) { String datum = DatumBox.Text; String[] delovi2 = datum.Split('/'); int mesec = int.Parse(delovi2[1]); int dan = int.Parse(delovi2[0]); int godina = int.Parse(delovi2[2]); DateTime dt1 = new DateTime(godina, mesec, dan, 0, 0, 0); DateTime dt2 = DateTime.Now; if (dt2 > dt1) { MessageBox.Show("Molimo vas da unesete termin koji tek predstoji", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } String x = bingPathToAppDir(@"JsonFiles\appointments.json"); AppointmentRepository apc = new AppointmentRepository(x); /* List<DoctorAppointment> listaPregleda = apc.GetAll(); * foreach (DoctorAppointment dd in listaPregleda) * { * DoctorUser dr = dd.doctor; * if (dr.id == drOvaj.id) * { * if (dd.Date.Equals(DatumBox.Text)) * { * TimeSpan krajPr = dd.Time + new TimeSpan(0, 15, 0); * int result = TimeSpan.Compare(vremee, dd.Time); * int result1 = TimeSpan.Compare(vremee, krajPr); * if ((result == 1 && result1 == -1) || result == 0) * { * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * int rezultat = TimeSpan.Compare(vremee2, dd.Time); * int rezultat1 = TimeSpan.Compare(vremee2, krajPr); * if ((rezultat == 1 && rezultat1 == -1) || rezultat == 0) * { * * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * } * * * * * } * }*/ /*String pre = bingPathToAppDir(@"JsonFiles\operations.json"); * OperationRepository apc1 = new OperationRepository(pre); * List<Operation> listaPregleda1 = apc1.GetAll(); * foreach (Operation dd in listaPregleda1) * { * DoctorUser dr = dd.isResponiable; * if (dr.id == drOvaj.id) * { * if (dd.Date.Equals(DatumBox.Text)) * { * int result = TimeSpan.Compare(vremee, dd.Start); * int result1 = TimeSpan.Compare(vremee, dd.End); * if ((result == 1 && result1 == -1) || result == 0) * { * * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * int rezultat = TimeSpan.Compare(vremee2, dd.Start); * int rezultat1 = TimeSpan.Compare(vremee2, dd.End); * if ((rezultat == 1 && rezultat1 == -1) || rezultat == 0) * { * * MessageBox.Show("Izvinjavamo se! Trazeni termin je vec zauzet!", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * return; * } * } * * * * * } * }*/ OperationController opCon = new OperationController(); bool zauzetTermin = opCon.isTermNotAvailable(drOvaj, ts, ts1, DatumBox.Text, ovajPacijent); if (zauzetTermin == true) { MessageBox.Show("Trazeni termin nije dostupan.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } EmployeesScheduleController schCon = new EmployeesScheduleController(); List <Schedule> listaRasporeda = schCon.GetAll(); Shift smena = schCon.getShiftForDoctorForSpecificDay(DatumBox.Text, drOvaj); if (smena == null || smena.startTime == null || smena.endTime == null) { MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi tog dana.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } bool slobodan = schCon.isDoctorWorkingAtSpecifiedTime(DatumBox.Text, drOvaj, ts); if (slobodan == false) { MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); return; } int ispravno = TimeSpan.Compare(ts1, ts); if (ispravno == -1 || ispravno == 0) { MessageBox.Show("Operacija mora imati trajanje!", "Greska", MessageBoxButton.OK); return; } /* String pocetak = smena.StartTime; * String kraj = smena.EndTime; * String[] deloviPocetak = pocetak.Split(':'); * String[] deloviKraj = kraj.Split(':'); * * TimeSpan pocetakTime = new TimeSpan(int.Parse(deloviPocetak[0]), int.Parse(deloviPocetak[1]), int.Parse("00")); * TimeSpan krajTime = new TimeSpan(int.Parse(deloviKraj[0]), int.Parse(deloviKraj[1]), int.Parse("00")); * int result3 = TimeSpan.Compare(vremee2, pocetakTime); * int result4 = TimeSpan.Compare(krajTime, vremee2); * * if (result3 != 1 || result4 != 1) * { * MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * * return; * * }*/ /* EmployeesScheduleController schCon = new EmployeesScheduleController(); * List<Schedule> listaRasporeda = schCon.GetAll(); * Shift smena = new Shift(); * foreach (Schedule s in listaRasporeda) * { * * if (s.employeeid.Equals(drOvaj.id.ToString())) * { * if (s.Date.Equals(DatumBox.Text)) * { * smena = s.shift; * } * } * } * if (smena.StartTime == null || smena.EndTime == null) * { * MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi tog dana.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * * return; * }*/ /* String pocetak = smena.StartTime; * String kraj = smena.EndTime; * String[] deloviPocetak = pocetak.Split(':'); * String[] deloviKraj = kraj.Split(':'); * * TimeSpan pocetakTime = new TimeSpan(int.Parse(deloviPocetak[0]), int.Parse(deloviPocetak[1]), int.Parse("00")); * TimeSpan krajTime = new TimeSpan(int.Parse(deloviKraj[0]), int.Parse(deloviKraj[1]), int.Parse("00")); * int result3 = TimeSpan.Compare(vremee, pocetakTime); * int result4 = TimeSpan.Compare(krajTime, vremee); * * if (result3 != 1 || result4 != 1) * { * MessageBox.Show("Trazeni termin nije dostupan.Lekar ne radi u to vreme.", "Greska", MessageBoxButton.OK, MessageBoxImage.Error); * * return; * * }*/ opCon.New(null, op); PatientController pCon = new PatientController(); List <PatientUser> pacijenti = pCon.GetAll(); int id1 = 0; String ime = ""; String prezime = ""; String jmbg = ""; String datumRodj = ""; String brojTel = ""; String brKnj = ""; List <Question> pitanja = new List <Question>(); String alergije = ""; String grad = ""; Boolean guest = false; String email = ""; String password = ""; Boolean sekr = false; // List<String> notifications = new List<String>(); // foreach (PatientUser pat in lista) // { // if (pat.id.Equals(d.patient.id)) // { id1 = op.patient.id; ime = op.patient.firstName; prezime = op.patient.secondName; jmbg = op.patient.uniqueCitizensidentityNumber; datumRodj = op.patient.dateOfBirth; brojTel = op.patient.phoneNumber; alergije = op.patient.allergie; grad = op.patient.city; email = op.patient.email; guest = op.patient.guest; password = op.patient.password; sekr = op.patient.isRegisteredBySecretary; // } // PatientUser rp = new PatientUser(id1, ime, prezime, jmbg, datumRodj, brojTel, brKnj, pitanja, alergije, grad, guest, email, password, sekr, notifications); if (op.patient.notifications == null) { op.patient.notifications = new List <ModelNotification>(); } List <ModelNotification> notifications = drap.patient.notifications; // } notifications.Add(new ModelNotification("Postovani, zakazana Vam je nova operacija datuma : " + op.date + " u " + op.start + " h, kod lekara " + op.isResponiable.firstName + " " + op.isResponiable.secondName + " Sala " + op.idRoom)); op.patient.notifications = notifications; pCon.Update(op.patient); Panel.Children.Clear(); UserControl usc = new PopunjeniTermini(); Panel.Children.Add(usc); } }
private void Button_Click(object sender, RoutedEventArgs e) { Lista ss = (Lista)dataGridTermini.Items.GetItemAt(dataGridTermini.SelectedIndex); string name1 = sender.ToString(); string[] words = name1.Split(':'); string[] words1 = name1.Split(' '); string id = words1[2]; string sMessageBoxText = "Da li ste sigurni da zelite da otkazete ovaj termin?" + id; string sCaption = "Otkazivanje termina."; MessageBoxButton btnMessageBox = MessageBoxButton.YesNoCancel; MessageBoxImage icnMessageBox = MessageBoxImage.Warning; MessageBoxResult rsltMessageBox = MessageBox.Show(sMessageBoxText, sCaption, btnMessageBox, icnMessageBox); switch (rsltMessageBox) { case MessageBoxResult.Yes: PatientUser ovajPacijent = new PatientUser(); String o = bingPathToAppDir(@"JsonFiles\operations.json"); String b = bingPathToAppDir(@"JsonFiles\appointments.json"); AppointmentList = new List <DoctorAppointment>(); operationList = new List <Operation>(); OperationRepository oprep = new OperationRepository(o); AppointmentRepository epr = new AppointmentRepository(b); operationList = oprep.GetAll(); AppointmentList = epr.GetAll(); foreach (DoctorAppointment d in AppointmentList) { if (d.id.ToString().Equals(id) && ss.Pregled == true) { Console.WriteLine(id); AppointmentList.Remove(d); //patientController.update(ovajPacijent); epr.Delete(d.id); PatientController patContr = new PatientController(); if (d.patient.notifications == null) { d.patient.notifications = new List <ModelNotification>(); } List <ModelNotification> notifications1 = d.patient.notifications; // } notifications1.Add(new ModelNotification("Postovani, pregled zakazan za datum: " + d.date + " i vreme " + d.time + " je otkazan.")); d.patient.notifications = notifications1; PatientController pCon = new PatientController(); pCon.Update(d.patient); if (d.doctor.specialNotifications == null) { d.doctor.specialNotifications = new List <DoctorNotification>(); } List <DoctorNotification> obavestenja = d.doctor.specialNotifications; obavestenja.Add(new DoctorNotification("Postovani, pregled zakazan za datum: " + d.date + " i vreme " + d.time + " je otkazan.")); d.doctor.specialNotifications = obavestenja; DoctorController docContr1 = new DoctorController(); docContr1.Update(d.doctor); var s = new PopunjeniTermini(); Panel.Children.Clear(); Panel.Children.Add(s); break; } } foreach (Operation d in operationList) { if (d.id.ToString().Equals(id) && ss.Operacija == true) { operationList.Remove(d); oprep.Delete(d.id); if (d.patient.notifications == null) { d.patient.notifications = new List <ModelNotification>(); } List <ModelNotification> notifications1 = d.patient.notifications; notifications1.Add(new ModelNotification("Postovani, operacija zakazana za datum: " + d.date + " i vreme " + d.start + " je otkazana.")); d.patient.notifications = notifications1; PatientController pCon = new PatientController(); pCon.Update(d.patient); if (d.isResponiable.specialNotifications == null) { d.isResponiable.specialNotifications = new List <DoctorNotification>(); } List <DoctorNotification> obavestenja = d.isResponiable.specialNotifications; obavestenja.Add(new DoctorNotification("Postovani,operacija zakazana za datum: " + d.date + " i vreme " + d.start + " je otkazana.")); d.isResponiable.specialNotifications = obavestenja; DoctorController docContr1 = new DoctorController(); docContr1.Update(d.isResponiable); var s = new PopunjeniTermini(); Panel.Children.Clear(); Panel.Children.Add(s); break; } } break; case MessageBoxResult.No: break; case MessageBoxResult.Cancel: break; } }