예제 #1
0
        public async Task <IActionResult> Edit(uint id, [Bind("Id,Name,OfficeNumber,Budget")] Offices offices)
        {
            if (id != offices.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(offices);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OfficesExists(offices.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(offices));
        }
예제 #2
0
        public async Task <IActionResult> Edit(uint id, [Bind("Id,RecipientId,PatientId,AcceptedTime,SampledTime,Glucose,Urea,Creatine,Cholesterol,Helicobacter")] Labreports labreports)
        {
            if (id != labreports.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(labreports);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LabreportsExists(labreports.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PatientId"]   = new SelectList(_context.Patients, "Id", "FirstName", labreports.PatientId);
            ViewData["RecipientId"] = new SelectList(_context.Employees, "Id", "FirstName", labreports.RecipientId);
            return(View(labreports));
        }
예제 #3
0
        public async Task <IActionResult> Edit(uint id, [Bind("Id,Name,PatientId,CreatorId,CreationDate,Note")] Files files)
        {
            if (id != files.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(files);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FilesExists(files.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CreatorId"] = new SelectList(_context.Employees, "Id", "FirstName", files.CreatorId);
            ViewData["PatientId"] = new SelectList(_context.Patients, "Id", "FirstName", files.PatientId);
            return(View(files));
        }
예제 #4
0
        public async Task <IActionResult> Edit(uint id, [Bind("Id,PatientId,DoctorId,StartingTime,FileId,DiagnosisId,Therapy,IsEmergency,LabReportId")] Examinations examinations)
        {
            if (id != examinations.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(examinations);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ExaminationsExists(examinations.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DiagnosisId"] = new SelectList(_context.Diagnosis, "Id", "Code", examinations.DiagnosisId);
            ViewData["DoctorId"]    = new SelectList(_context.Employees, "Id", "FirstName", examinations.DoctorId);
            ViewData["FileId"]      = new SelectList(_context.Files, "Id", "Name", examinations.FileId);
            ViewData["LabReportId"] = new SelectList(_context.Labreports, "Id", "Id", examinations.LabReportId);
            ViewData["PatientId"]   = new SelectList(_context.Patients, "Id", "FirstName", examinations.PatientId);
            return(View(examinations));
        }
예제 #5
0
        public async Task <IActionResult> Edit(uint id, [Bind("Id,SocialSecurityNumber,FirstName,LastName,BirthDate,Gender,HealthCareProvider")] Patients patients)
        {
            if (id != patients.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(patients);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PatientsExists(patients.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(patients));
        }
예제 #6
0
        public async Task <IActionResult> Edit(uint id, [Bind("Id,OfficeId,SocialSecurityNumber,FirstName,LastName,BirthDate,Gender,IsMedicalWorker,MedicalTitle,IsDean,DeanOfficeId")] Employees employees)
        {
            if (id != employees.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employees);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployeesExists(employees.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DeanOfficeId"] = new SelectList(_context.Offices, "Id", "Name", employees.DeanOfficeId);
            ViewData["OfficeId"]     = new SelectList(_context.Offices, "Id", "Name", employees.OfficeId);
            return(View(employees));
        }
예제 #7
0
        public async Task <IActionResult> Edit(uint id, [Bind("Id,Code,MedicalTerm")] Diagnosis diagnosis)
        {
            if (id != diagnosis.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(diagnosis);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DiagnosisExists(diagnosis.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(diagnosis));
        }
예제 #8
0
        public async Task <IActionResult> Edit(uint id, [Bind("Id,PatientFirstName,PatientLastName,PatientId,DoctorId,StartingTime")] Appointments appointments)
        {
            if (id != appointments.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                if (appointments.PatientId != null)
                {
                    appointments.PatientFirstName = _context.Patients.Where(p => p.Id == appointments.PatientId).FirstOrDefault().FirstName;
                    appointments.PatientLastName  = _context.Patients.Where(p => p.Id == appointments.PatientId).FirstOrDefault().LastName;
                }
                try
                {
                    _context.Update(appointments);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AppointmentsExists(appointments.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DoctorId"]  = new SelectList(_context.Employees, "Id", "FirstName", appointments.DoctorId);
            ViewData["PatientId"] = new SelectList(_context.Patients, "Id", "FirstName", appointments.PatientId);
            return(View(appointments));
        }