public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(BookAppointment).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookAppointmentExists(BookAppointment.BookAppointmentID)) { return(NotFound()); } else { throw; } } //return RedirectToPage("./Index"); return(RedirectToPage("/MedicalInstitutions/Details", new { id = BookAppointment.MedicalInstitutionID })); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(Appointment).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AppointmentExists(Appointment.AppointmentID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } if (Appointment.BookAppointment.Patient.HadVirus == true || Appointment.BookAppointment.EligibilityToVaccine == false) { if (Appointment.BookAppointment.Patient.HadVirus == true) { ModelState.AddModelError("Appointment.BookAppointment.Patient.HadVirus", "Not eligible to vaccination, because of the previous infection"); return(Page()); } else if (Appointment.BookAppointment.EligibilityToVaccine == false) { ModelState.AddModelError("Appointment.BookAppointment.EligibilityToVaccine", "Not eligible to vaccination, based on the link provided"); return(Page()); } } if (Appointment.EligibilityToVaccine == false) { ModelState.AddModelError("Appointment.EligibilityToVaccine", "Not eligible to vaccination by medical staff decision"); return(Page()); } _context.Appointments.Add(Appointment); await _context.SaveChangesAsync(); return(RedirectToPage("/MedicalInstitutions/Details", new { id = Appointment.MedicalInstitutionID })); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.VisitorsCheckOut.Add(VisitorCheckOut); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.MedicalInstitutions.Add(MedicalInstitution); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Businesses.Add(Business); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.VisitorsCheckIn.Add(VisitorCheckIn); await _context.SaveChangesAsync(); return(RedirectToPage("/BusinessActivities/Details", new { id = VisitorCheckIn.BusinessActivityID })); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.BookAppointments.Add(BookAppointment); await _context.SaveChangesAsync(); return(RedirectToPage("/MedicalInstitutions/Details", new { id = BookAppointment.MedicalInstitutionID })); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Addresses.Add(Address); await _context.SaveChangesAsync(); //return RedirectToPage("./Index"); return(RedirectToPage("/DangerousCases/Details", new { id = Address.DangerousCaseID })); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } BusinessActivity = await _context.BusinessActivities.FindAsync(id); if (BusinessActivity != null) { _context.BusinessActivities.Remove(BusinessActivity); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Address = await _context.Addresses.FindAsync(id); if (Address != null) { _context.Addresses.Remove(Address); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } DangerousCase = await _context.DangerousCases.FindAsync(id); if (DangerousCase != null) { _context.DangerousCases.Remove(DangerousCase); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Patient = await _context.Patients.FindAsync(id); if (Patient != null) { _context.Patients.Remove(Patient); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } MedicalInstitution = await _context.MedicalInstitutions.FindAsync(id); if (MedicalInstitution != null) { _context.MedicalInstitutions.Remove(MedicalInstitution); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } VisitorCheckIn = await _context.VisitorsCheckIn.FindAsync(id); if (VisitorCheckIn != null) { _context.VisitorsCheckIn.Remove(VisitorCheckIn); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } var courseToUpdate = await _context.BusinessActivities.FindAsync(BusinessActivity.BusinessID); if (courseToUpdate != null && courseToUpdate.WorkingDate == BusinessActivity.WorkingDate) { ModelState.AddModelError("BusinessActivity", "Cannot be the same date to the same bussiness"); return(Page()); } _context.BusinessActivities.Add(BusinessActivity); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }