コード例 #1
0
        /// <summary>
        /// Add a patient report to the database
        /// </summary>
        /// <param name="report">The report to be added tp the database</param>
        public Models.PatientReport AddPatientReport(Models.PatientReport report)
        {
            var newPatientReport = new DataModel.PatientReport
            {
                PatientId   = report.PatientId,
                ReportTime  = report.Time,
                Information = report.Info
                              //add vitals id for datamodel??
            };

            _context.Add(newPatientReport);
            _context.SaveChanges();
            report.Id = newPatientReport.Id;
            return(report);
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("Id,Name,Price")] Checkup checkup)
        {
            if (ModelState.IsValid)
            {
                _context.Add(checkup);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(checkup));
        }
        public async Task <IActionResult> Create([Bind("Id,Title,Desc,Photo")] DiaqnosticServis diaqnosticServis)
        {
            if (ModelState.IsValid)
            {
                _context.Add(diaqnosticServis);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(diaqnosticServis));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("Id,Title,Icon,Desc")] Promo promo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(promo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(promo));
        }
        public async Task <IActionResult> Create([Bind("Id,Time,Date")] ClinicOpeningHours clinicOpeningHours)
        {
            if (ModelState.IsValid)
            {
                _context.Add(clinicOpeningHours);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(clinicOpeningHours));
        }
コード例 #6
0
        public async Task <IActionResult> Create([Bind("Id,Date,Time,DoctorId")] DoctorOpeningHours doctorOpeningHours)
        {
            if (ModelState.IsValid)
            {
                _context.Add(doctorOpeningHours);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DoctorId"] = new SelectList(_context.Doctors, "Id", "Id", doctorOpeningHours.DoctorId);
            return(View(doctorOpeningHours));
        }
コード例 #7
0
        public async Task <IActionResult> Create([Bind("Id,PasientName,Time,Email,Date,Message,DepartmentsId")] Randevu randevu)
        {
            if (ModelState.IsValid)
            {
                _context.Add(randevu);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DepartmentsId"] = new SelectList(_context.Departments, "Id", "Id", randevu.DepartmentsId);
            return(View(randevu));
        }
コード例 #8
0
ファイル: EfcClinicDbService.cs プロジェクト: s18277/cw11
        public int AddDoctor(NewDoctorRequest newNewDoctorRequest)
        {
            var newDoctor = new Doctor
            {
                FirstName = newNewDoctorRequest.FirstName,
                LastName  = newNewDoctorRequest.LastName,
                Email     = newNewDoctorRequest.Email
            };

            _context.Add(newDoctor);
            return(_context.SaveChanges());
        }
      public async Task <IActionResult> Create([Bind("Id,Name,CheckupId")] CheckupSetting checkupSetting)
      {
          if (ModelState.IsValid)
          {
              _context.Add(checkupSetting);
              await _context.SaveChangesAsync();

              return(RedirectToAction(nameof(Index)));
          }
          ViewData["CheckupId"] = new SelectList(_context.Checkups, "Id", "Id", checkupSetting.CheckupId);
          return(View(checkupSetting));
      }
        public async Task <IActionResult> Create([Bind("Id,Name,Icon,Url,DoctorId")] DoctorTeamLink doctorTeamLink)
        {
            if (ModelState.IsValid)
            {
                _context.Add(doctorTeamLink);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DoctorId"] = new SelectList(_context.Doctors, "Id", "Id", doctorTeamLink.DoctorId);
            return(View(doctorTeamLink));
        }
コード例 #11
0
        public string AddNewDoctor(AddNewDoctorRequest request)
        {
            var doctor = new Doctor
            {
                FirstName = request.FirstName,
                LastName  = request.LastName,
                Email     = request.Email,
            };

            _context.Attach(doctor);
            _context.Add(doctor);
            _context.SaveChangesAsync();

            return("Doctor added");
        }
コード例 #12
0
 public async Task<IActionResult> Create([Bind("Id,Upload,Adress,OpenDate,ClosedDate,Email,Phone")] Settings settings)
 {
     if (settings.Upload == null)
     {
         ModelState.AddModelError("Uploads", "The Photo field is required.");
     }
     if (ModelState.IsValid)
     {
         var fileName = _fileManager.Upload(settings.Upload, "wwwroot/uploads/gallery");
         settings.Logo = fileName;
         _context.Add(settings);
         await _context.SaveChangesAsync();
         return RedirectToAction(nameof(Index));
     }
     return View(settings);
 }
コード例 #13
0
        public async Task <IActionResult> Create([Bind("Id,Upload,Upload,Title,Desc,Date")] News news)
        {
            if (news.Upload == null)
            {
                ModelState.AddModelError("Uploads", "The Photo field is required.");
            }
            if (ModelState.IsValid)
            {
                var fileName = _fileManager.Upload(news.Upload, "wwwroot/uploads/gallery");
                news.Photo = fileName;
                _context.Add(news);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(news));
        }
コード例 #14
0
        public async Task <IActionResult> Create([Bind("Id,Name,About,ShortAbout,Upload")] Diseas diseas)
        {
            if (diseas.Upload == null)
            {
                ModelState.AddModelError("Uploads", "The Photo field is required.");
            }
            if (ModelState.IsValid)
            {
                var fileName = _fileManager.Upload(diseas.Upload, "wwwroot/uploads/gallery");
                diseas.Photo = fileName;
                _context.Add(diseas);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(diseas));
        }
        public async Task <IActionResult> Create([Bind("Id,Desc,Upload,FullName,Position")] PatientSay patientSay)
        {
            if (patientSay.Upload == null)
            {
                ModelState.AddModelError("Uploads", "The Photo field is required.");
            }
            if (ModelState.IsValid)
            {
                var fileName = _fileManager.Upload(patientSay.Upload, "wwwroot/uploads/gallery");
                patientSay.Photo = fileName;
                _context.Add(patientSay);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(patientSay));
        }
        public async Task <IActionResult> Create([Bind("Id,About,Upload,Title,Desc")] WelcomeClinic welcomeClinic)
        {
            if (welcomeClinic.Upload == null)
            {
                ModelState.AddModelError("Uploads", "The Photo field is required.");
            }
            if (ModelState.IsValid)
            {
                var fileName = _fileManager.Upload(welcomeClinic.Upload, "wwwroot/uploads/main-slider");
                welcomeClinic.Photo = fileName;
                _context.Add(welcomeClinic);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(welcomeClinic));
        }
コード例 #17
0
        public async Task <IActionResult> Create([Bind("Id,FullName,Education,Speciality,Experience,Address,Timing,Phone,Email,Website,About,Upload,Position,DepartmentsId,IsHome")] Doctor doctor)
        {
            if (doctor.Upload == null)
            {
                ModelState.AddModelError("Uploads", "The Photo field is required.");
            }
            if (ModelState.IsValid)
            {
                var fileName = _fileManager.Upload(doctor.Upload, "wwwroot/uploads/gallery");
                doctor.Photo = fileName;
                _context.Add(doctor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DepartmentsId"] = new SelectList(_context.Departments, "Id", "Id", doctor.DepartmentsId);
            return(View(doctor));
        }
コード例 #18
0
ファイル: DoctorController.cs プロジェクト: s18534/Cw11
 public IActionResult InsertDoctor(Doctor doctor)
 {
     context.Add(doctor);
     context.SaveChanges();
     return(Ok(context.Doctors.ToList()));
 }