public async Task <IActionResult> Create([Bind("ID,Name,Classification,Fee")] Services services)
        {
            if (ModelState.IsValid)
            {
                _context.Add(services);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(services));
        }
        public async Task <IActionResult> Create([Bind("ID,FirstName,LastName,Address,City,State,PostalCode,Country,Phone,Email,Username,Password,ConfirmPassword")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("ID,ClientID,ServicesID,Date")] ClientService clientService)
        {
            if (ModelState.IsValid)
            {
                _context.Add(clientService);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientID"] = new SelectList(_context.Client, "ID", "Email", clientService.ClientID);
            return(View(clientService));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("ID,Name,ServicesID,ContactEmail")] Contact contact)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contact);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ServicesID"] = new SelectList(_context.Services, "ID", "ID", contact.ServicesID);
            return(View(contact));
        }