public async Task <IActionResult> Edit(int id, [Bind("Id,PrimaryOrNot,ActiveOrInactive,FirstName,LastName,TypeOfSpecialty,StreetAddress,City,State,ZipCode,Country,Phone,Fax,Email")] MedicalProvider medicalProvider) { if (id != medicalProvider.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(medicalProvider); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MedicalProviderExists(medicalProvider.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(medicalProvider)); }
public async Task <IActionResult> Edit(int id, [Bind("MedProviderId,MedProviderSpecialty,ActiveOrInactive,MedProviderFirstName,MedProviderLastName,MedProviderLocationId,PhoneNumber,Fax,Email")] MedicalProvider medicalProvider) { if (id != medicalProvider.MedProviderId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(medicalProvider); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MedicalProviderExists(medicalProvider.MedProviderId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MedProviderLocationId"] = new SelectList(_context.MedCareLocation, "LocationId", "LocationCity", medicalProvider.MedProviderLocationId); return(View(medicalProvider)); }
public async Task <IActionResult> Create([Bind("Id,PrimaryOrNot,ActiveOrInactive,FirstName,LastName,TypeOfSpecialty,StreetAddress,City,State,ZipCode,Country,Phone,Fax,Email")] MedicalProvider medicalProvider) { if (ModelState.IsValid) { _context.Add(medicalProvider); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(medicalProvider)); }
public async Task <IActionResult> Create([Bind("MedProviderId,MedProviderSpecialty,ActiveOrInactive,MedProviderFirstName,MedProviderLastName,MedProviderLocationId,PhoneNumber,Fax,Email")] MedicalProvider medicalProvider) { if (ModelState.IsValid) { _context.Add(medicalProvider); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["MedProviderLocationId"] = new SelectList(_context.MedCareLocation, "LocationId", "LocationCity", medicalProvider.MedProviderLocationId); return(View(medicalProvider)); }