public async Task <IActionResult> Create([Bind("Id,Name,Specialist_IN,Contact")] Specialist specialist) { if (ModelState.IsValid) { _context.Add(specialist); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(specialist)); }
public async Task <IActionResult> Create([Bind("Id,Staff_Name,Department,Staff_Contact")] Staff staff) { if (ModelState.IsValid) { _context.Add(staff); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(staff)); }
public async Task <IActionResult> Create([Bind("Id,Name_of_clinic,Address,Contact")] Location location) { if (ModelState.IsValid) { _context.Add(location); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(location)); }
public async Task <IActionResult> Create([Bind("Id,Patient_Name,Address,Patient_Age,Joining_Date")] Patient patient) { if (ModelState.IsValid) { _context.Add(patient); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(patient)); }
public async Task <IActionResult> Create([Bind("Id,PatientId,StaffId,LocationId,SpecialistId")] Appointment appointment) { if (ModelState.IsValid) { _context.Add(appointment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["LocationId"] = new SelectList(_context.Location, "Id", "Id", appointment.LocationId); ViewData["PatientId"] = new SelectList(_context.Patient, "Id", "Id", appointment.PatientId); ViewData["SpecialistId"] = new SelectList(_context.Specialist, "Id", "Id", appointment.SpecialistId); ViewData["StaffId"] = new SelectList(_context.Staff, "Id", "Id", appointment.StaffId); return(View(appointment)); }