Exemple #1
0
        public async Task <IActionResult> Create([Bind("ComplaintId,ComplaintNumber,Picture,Description,Status")] Complaint complaint)
        {
            if (ModelState.IsValid)
            {
                _context.Add(complaint);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(complaint));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("UserId,Name,Email,Password,Ssn,PhoneNumber,Address")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }