コード例 #1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Specialist_IN,Contact")] Specialist specialist)
        {
            if (ModelState.IsValid)
            {
                _context.Add(specialist);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(specialist));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("Id,Staff_Name,Department,Staff_Contact")] Staff staff)
        {
            if (ModelState.IsValid)
            {
                _context.Add(staff);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(staff));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("Id,Name_of_clinic,Address,Contact")] Location location)
        {
            if (ModelState.IsValid)
            {
                _context.Add(location);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(location));
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("Id,Patient_Name,Address,Patient_Age,Joining_Date")] Patient patient)
        {
            if (ModelState.IsValid)
            {
                _context.Add(patient);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(patient));
        }
コード例 #5
0
        public async Task <IActionResult> Create([Bind("Id,PatientId,StaffId,LocationId,SpecialistId")] Appointment appointment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(appointment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LocationId"]   = new SelectList(_context.Location, "Id", "Id", appointment.LocationId);
            ViewData["PatientId"]    = new SelectList(_context.Patient, "Id", "Id", appointment.PatientId);
            ViewData["SpecialistId"] = new SelectList(_context.Specialist, "Id", "Id", appointment.SpecialistId);
            ViewData["StaffId"]      = new SelectList(_context.Staff, "Id", "Id", appointment.StaffId);
            return(View(appointment));
        }