public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Price")] Checkup checkup) { if (id != checkup.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(checkup); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CheckupExists(checkup.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(checkup)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Date,Time,DoctorId")] DoctorOpeningHours doctorOpeningHours) { if (id != doctorOpeningHours.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(doctorOpeningHours); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DoctorOpeningHoursExists(doctorOpeningHours.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["DoctorId"] = new SelectList(_context.Doctors, "Id", "Id", doctorOpeningHours.DoctorId); return(View(doctorOpeningHours)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Icon,Desc")] Promo promo) { if (id != promo.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(promo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PromoExists(promo.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(promo)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Time,Date")] ClinicOpeningHours clinicOpeningHours) { if (id != clinicOpeningHours.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(clinicOpeningHours); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClinicOpeningHoursExists(clinicOpeningHours.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(clinicOpeningHours)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,CheckupId")] CheckupSetting checkupSetting) { if (id != checkupSetting.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(checkupSetting); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CheckupSettingExists(checkupSetting.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CheckupId"] = new SelectList(_context.Checkups, "Id", "Id", checkupSetting.CheckupId); return(View(checkupSetting)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,PasientName,Time,Email,Date,Message,DepartmentsId")] Randevu randevu) { if (id != randevu.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(randevu); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RandevuExists(randevu.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["DepartmentsId"] = new SelectList(_context.Departments, "Id", "Id", randevu.DepartmentsId); return(View(randevu)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Desc,Photo")] DiaqnosticServis diaqnosticServis) { if (id != diaqnosticServis.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(diaqnosticServis); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DiaqnosticServisExists(diaqnosticServis.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(diaqnosticServis)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,FullName,Education,Speciality,Experience,Address,Timing,Phone,Email,Website,About,Photo,Upload,Position,DepartmentsId,IsHome")] Doctor doctor) { if (id != doctor.Id) { return(NotFound()); } if (ModelState.IsValid) { try { if (doctor.Upload != null) { var oldFile = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "uploads/gallery", doctor.Photo); _fileManager.Delete(oldFile); var fileName = _fileManager.Upload(doctor.Upload, "wwwroot/uploads/gallery"); doctor.Photo = fileName; } _context.Update(doctor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DoctorExists(doctor.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["DepartmentsId"] = new SelectList(_context.Departments, "Id", "Id", doctor.DepartmentsId); return(View(doctor)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Photo,Upload,,BigPhoto,Upload,Title,Desc,Date")] News news) { if (id != news.Id) { return(NotFound()); } if (ModelState.IsValid) { try { if (news.Upload != null) { var oldFile = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "uploads/gallery", news.Photo); _fileManager.Delete(oldFile); var fileName = _fileManager.Upload(news.Upload, "wwwroot/uploads/gallery"); news.Photo = fileName; } _context.Update(news); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NewsExists(news.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(news)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Desc,Photo,Upload,FullName,Position")] PatientSay patientSay) { if (id != patientSay.Id) { return(NotFound()); } if (ModelState.IsValid) { try { if (patientSay.Upload != null) { var oldFile = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "uploads/gallery", patientSay.Photo); _fileManager.Delete(oldFile); var fileName = _fileManager.Upload(patientSay.Upload, "wwwroot/uploads/gallery"); patientSay.Photo = fileName; } _context.Update(patientSay); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PatientSayExists(patientSay.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(patientSay)); }
public async Task<IActionResult> Edit(int id, [Bind("Id,Logo,Upload,Adress,OpenDate,ClosedDate,Email,Phone")] Settings settings) { if (id != settings.Id) { return NotFound(); } if (ModelState.IsValid) { try { if (settings.Upload != null) { var oldFile = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "uploads/gallery", settings.Logo); _fileManager.Delete(oldFile); var fileName = _fileManager.Upload(settings.Upload, "wwwroot/uploads/gallery"); settings.Logo = fileName; } _context.Update(settings); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SettingsExists(settings.Id)) { return NotFound(); } else { throw; } } return RedirectToAction(nameof(Index)); } return View(settings); }
public async Task <IActionResult> Edit(int id, [Bind("Id,About,Title,Desc,Photo,Upload")] WelcomeClinic welcomeClinic) { if (id != welcomeClinic.Id) { return(NotFound()); } if (ModelState.IsValid) { try { if (welcomeClinic.Upload != null) { var oldFile = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "uploads/main-slider", welcomeClinic.Photo); _fileManager.Delete(oldFile); var fileName = _fileManager.Upload(welcomeClinic.Upload, "wwwroot/uploads/main-slider"); welcomeClinic.Photo = fileName; } _context.Update(welcomeClinic); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WelcomeClinicExists(welcomeClinic.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(welcomeClinic)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Photo,Upload,Icon,About,ShortAbout")] Departments departments) { if (id != departments.Id) { return(NotFound()); } if (ModelState.IsValid) { try { if (departments.Upload != null) { var oldFile = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "uploads/resource", departments.Photo); _fileManager.Delete(oldFile); var fileName = _fileManager.Upload(departments.Upload, "wwwroot/uploads/resource"); departments.Photo = fileName; } _context.Update(departments); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DepartmentsExists(departments.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(departments)); }