Exemple #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));
        }
Exemple #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));
        }
Exemple #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));
        }