Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ServiceId,Description,Duration,Price")] Service service)
        {
            if (ModelState.IsValid)
            {
                _context.Add(service);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(service));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("EmployeeId,FirstName,LastName,Specialty")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("ApointId,ServiceId,EmployeeId,Time,Location,PetName")] Appointments appointments)
        {
            if (ModelState.IsValid)
            {
                _context.Add(appointments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeId"] = new SelectList(_context.Employee, "EmployeeId", "LastName", appointments.EmployeeId);
            ViewData["ServiceId"]  = new SelectList(_context.Service, "ServiceId", "Description", appointments.ServiceId);
            return(View(appointments));
        }