コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("AppointmentId,PatientId,PatientFullName,DoctorId,DiagnosisId,DiagnosName,TotalSum,AppointmentPlaced")] AppointmentDone appointmentDone)
        {
            if (id != appointmentDone.AppointmentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(appointmentDone);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AppointmentDoneExists(appointmentDone.AppointmentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(appointmentDone));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("AppointmentId,PatientId,PatientFullName,DoctorId,DiagnosisId,DiagnosName,TotalSum,AppointmentPlaced")] AppointmentDone appointmentDone)
        {
            if (ModelState.IsValid)
            {
                _context.Add(appointmentDone);
                await _context.SaveChangesAsync();

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