public async Task <IActionResult> Edit(int id, [Bind("Id,Count")] ReportCount reportCount) { if (id != reportCount.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(reportCount); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReportCountExists(reportCount.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(reportCount)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ReportId, nicNo,patientName,DoctorName,LabStatus,LabType,DoctorStatus,LabReport,date,labNo,SpecialistName,description")] LabReportRequest labReportRequest) { // make the report ready labReportRequest.LabStatus = "Ready"; if (id != labReportRequest.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(labReportRequest); await _context.SaveChangesAsync(); await Recived_Report_Count_Update(); } catch (DbUpdateConcurrencyException) { //if (!LabReportRequestExists(labReportRequest.Id)) //{ // return NotFound(); //} //else //{ // throw; //} } return(RedirectToAction(nameof(Index))); } return(View(labReportRequest)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,nicNo,patientName,DoctorName,LabStatus,LabType,DoctorStatus,LabReport,date,labNo,SpecialistName,description")] LabReportRequest labReportRequest) { if (id != labReportRequest.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(labReportRequest); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LabReportRequestExists(labReportRequest.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(labReportRequest)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,wardNo,empno,dateDutyOn,timeDutyOn")] Ward ward) { if (id != ward.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ward); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WardExists(ward.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ward)); }
public async Task <IActionResult> Edit(int id, [Bind("Cpf,Crm,Coren,DataConsulta,CodTriagem,CodConsultas")] Consultas consultas) { if (id != consultas.CodConsultas) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(consultas); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConsultasExists(consultas.CodConsultas)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CodTriagem"] = new SelectList(_context.Triagem, "CodTriagem", "Coren", consultas.CodTriagem); ViewData["Coren"] = new SelectList(_context.Enfermeiros, "Coren", "Coren", consultas.Coren); ViewData["Cpf"] = new SelectList(_context.Pacientes, "Cpf", "Cpf", consultas.Cpf); ViewData["Crm"] = new SelectList(_context.Medicos, "Crm", "Crm", consultas.Crm); return(View(consultas)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,wardno,date,description,status,NoOfBed")] Warddatas warddatas) { if (id != warddatas.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(warddatas); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WarddatasExists(warddatas.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(warddatas)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Email,PhoneNo,Gender,NRC,DoctorNRC,MedicalLicence,SpecialistId")] Doctor doctor) { if (id != doctor.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(doctor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DoctorExists(doctor.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["SpecialistId"] = new SelectList(_context.Specialist, "Id", "Name", doctor.SpecialistId); return(View(doctor)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,userName,password")] DoctorsLoginModel doctorsLoginModel) { if (id != doctorsLoginModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(doctorsLoginModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DoctorsLoginModelExists(doctorsLoginModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(doctorsLoginModel)); }
public async Task <IActionResult> Edit(int id, PatientReservation patientReservation) { if (id != patientReservation.Id) { return(NotFound()); } try { _context.Update(patientReservation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PatientReservationExists(patientReservation.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); var patientTypes = _context.PatientTypes.ToList(); ViewBag.PatientType = patientTypes; return(View(patientReservation)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,UserName,Password,Position")] LogInDetails logInDetails) { if (id != logInDetails.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(logInDetails); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LogInDetailsExists(logInDetails.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(logInDetails)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,UserName,Password")] EditProfile editProfile) { if (id != editProfile.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(editProfile); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EditProfileExists(editProfile.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(editProfile)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Staffid,Name,Date,Attendance")] Staffdatas staffdatas) { if (id != staffdatas.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(staffdatas); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StaffdatasExists(staffdatas.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(staffdatas)); }
public async Task <IActionResult> Edit(int id, [Bind("EmployeeId,PatientTypeId")] EmployeeRole employeeRole) { if (id != employeeRole.EmployeeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(employeeRole); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployeeRoleExists(employeeRole.EmployeeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EmployeeId"] = new SelectList(_context.Employees, "EmployeeId", "EmployeeId", employeeRole.EmployeeId); ViewData["PatientTypeId"] = new SelectList(_context.PatientTypes, "PatientTypeId", "PatientTypeId", employeeRole.PatientTypeId); return(View(employeeRole)); }
public async Task <IActionResult> Edit(string id, [Bind("Crm,Nome,CodEspecialidade")] Medicos medicos) { if (id != medicos.Crm) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(medicos); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MedicosExists(medicos.Crm)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CodEspecialidade"] = new SelectList(_context.Especialidades, "CodEspecialidade", "Descricao", medicos.CodEspecialidade); return(View(medicos)); }
public async Task <IActionResult> Edit(int id, [Bind("NIC,Name,ID,WorkingHrs,Rating")] SalaryDetail salaryDetail) { if (id != salaryDetail.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(salaryDetail); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SalaryDetailExists(salaryDetail.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(salaryDetail)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,PatientId,InvoiceTotal,PaymentTotal,DueTotal,Date")] Invoice invoice) { if (id != invoice.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(invoice); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InvoiceExists(invoice.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["PatientId"] = new SelectList(_context.Patients, "Id", "Id", invoice.PatientId); return(View(invoice)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] MedicineCategory medicineCategory) { if (id != medicineCategory.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(medicineCategory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MedicineCategoryExists(medicineCategory.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(medicineCategory)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Address,Phones")] HospitalModel hospitalModel) { if (id != hospitalModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hospitalModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HospitalModelExists(hospitalModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(hospitalModel)); }
public async Task <IActionResult> Edit(string id, [Bind("Coren,Nome")] Enfermeiros enfermeiros) { if (id != enfermeiros.Coren) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(enfermeiros); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EnfermeirosExists(enfermeiros.Coren)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(enfermeiros)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,AppointDate,TreateDate,StartDate,EndDate,VokingNo,PatientId,DoctorId,RoomId")] Appointment appointment) { if (id != appointment.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(appointment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AppointmentExists(appointment.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["DoctorId"] = new SelectList(_context.Doctor, "Id", "Name", appointment.DoctorId); ViewData["PatientId"] = new SelectList(_context.Patient, "Id", "Name", appointment.PatientId); ViewData["RoomId"] = new SelectList(_context.Room, "Id", "Name", appointment.RoomId); return(View(appointment)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,patientName,NicNo,Email,Wardno,Date_Cin,telephone,Address,avalablity")] PatientDetails patientDetails) { if (id != patientDetails.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(patientDetails); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PatientDetailsExists(patientDetails.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(patientDetails)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Drug_ID,Name,Description,Qty,Price,State")] Drug drug) { if (id != drug.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(drug); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DrugExists(drug.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(drug)); }
public async Task <IActionResult> Edit(int id, [Bind("EmployeeId,Name")] Employee employee) { if (id != employee.EmployeeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(employee); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployeeExists(employee.EmployeeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(employee)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,DepartmentName,Patients")] Department department) { if (id != department.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(department); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DepartmentExists(department.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(department)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Day,StartTime,EndTime,DoctorId")] Schdeule schdeule) { if (id != schdeule.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(schdeule); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SchdeuleExists(schdeule.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["DoctorId"] = new SelectList(_context.Doctor, "Id", "Name", schdeule.DoctorId); return(View(schdeule)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Details,Cost")] Services services) { if (id != services.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(services); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ServicesExists(services.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(services)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,PID,Treatment,Case_history,Note,medication,When_to_take")] BindMedicationPrescription bindMedicationPrescription) { if (id != bindMedicationPrescription.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bindMedicationPrescription); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BindMedicationPrescriptionExists(bindMedicationPrescription.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(bindMedicationPrescription)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Email,PhoneNo,Gender,Status,Age,Address,Weight,Height,Disease_History,SymptomsId")] Patient patient) { if (id != patient.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(patient); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PatientExists(patient.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["SymptomsId"] = new SelectList(_context.Symptoms, "Id", "Name", patient.SymptomsId); return(View(patient)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,PurchasePrice,SalePrice,CategoryId")] Medicine medicine) { if (id != medicine.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(medicine); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MedicineExists(medicine.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CategoryId"] = new SelectList(_context.MedicineCategory, "Id", "Name", medicine.CategoryId); return(View(medicine)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,userName,password,DepartmentID")] Users users) { if (id != users.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(users); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsersExists(users.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(users)); }