Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("AppointmentID,AppointmentDate,EmpName,Rating")] AppointmentMgmt appointmentMgmt)
        {
            if (id != appointmentMgmt.AppointmentID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(appointmentMgmt);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AppointmentMgmtExists(appointmentMgmt.AppointmentID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(appointmentMgmt));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("AppointmentID,AppointmentDate,EmpName,Rating")] AppointmentMgmt appointmentMgmt)
        {
            if (ModelState.IsValid)
            {
                _context.Add(appointmentMgmt);
                await _context.SaveChangesAsync();

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