Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Subject,Topic,SchoolType,Experience,StudyDate,AddressLine1,AddressLine2,City,State,Country,ZipCode")] Request request)
        {
            if (ModelState.IsValid)
            {
                _context.Add(request);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(request));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Username,Password,FirstName,LastName,Gender,Dob,Email,StreetAddress,City,Country,ZipCode,Phone")] Users users)
        {
            if (ModelState.IsValid)
            {
                _context.Add(users);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(users));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Index(ContactUs contactUs)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contactUs);
                await _context.SaveChangesAsync();

                return(View("ContactUsForm", contactUs));
            }
            else
            {
                return(View());
            }
        }