Пример #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));
        }
Пример #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));
        }
Пример #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());
            }
        }