Example #1
0
        public async Task <IActionResult> Create([Bind("Id,Name,OfficeNumber,Budget")] Offices offices)
        {
            if (ModelState.IsValid)
            {
                _context.Add(offices);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(offices));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("Id,SocialSecurityNumber,FirstName,LastName,BirthDate,Gender,HealthCareProvider")] Patients patients)
        {
            if (ModelState.IsValid)
            {
                _context.Add(patients);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(patients));
        }
Example #3
0
        public async Task <IActionResult> Create([Bind("Id,Code,MedicalTerm")] Diagnosis diagnosis)
        {
            if (ModelState.IsValid)
            {
                _context.Add(diagnosis);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(diagnosis));
        }
Example #4
0
        public async Task <IActionResult> Create([Bind("Id,Name,PatientId,CreatorId,CreationDate,Note")] Files files)
        {
            if (ModelState.IsValid)
            {
                _context.Add(files);
                await _context.SaveChangesAsync();

                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));
        }
Example #5
0
        public async Task <IActionResult> Create([Bind("Id,RecipientId,PatientId,AcceptedTime,SampledTime,Glucose,Urea,Creatine,Cholesterol,Helicobacter")] Labreports labreports)
        {
            if (ModelState.IsValid)
            {
                _context.Add(labreports);
                await _context.SaveChangesAsync();

                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));
        }
Example #6
0
        public async Task <IActionResult> Create([Bind("Id,OfficeId,SocialSecurityNumber,FirstName,LastName,BirthDate,Gender,IsMedicalWorker,MedicalTitle,IsDean,DeanOfficeId")] Employees employees)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employees);
                await _context.SaveChangesAsync();

                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));
        }
Example #7
0
        public async Task <IActionResult> Create([Bind("Id,PatientFirstName,PatientLastName,PatientId,DoctorId,StartingTime")] Appointments appointments)
        {
            if (ModelState.IsValid)
            {
                _context.Add(appointments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            ViewData["DoctorId"]  = new SelectList(_context.Employees, "Id", "Name", appointments.DoctorId);
            ViewData["PatientId"] = new SelectList(_context.Patients, "Id", "Name", appointments.PatientId);
            return(View(appointments));
        }
Example #8
0
        public async Task <IActionResult> Create([Bind("Id,PatientId,DoctorId,StartingTime,FileId,DiagnosisId,Therapy,IsEmergency,LabReportId")] Examinations examinations)
        {
            if (ModelState.IsValid)
            {
                _context.Add(examinations);
                await _context.SaveChangesAsync();

                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));
        }