Beispiel #1
0
        public async Task <IActionResult> Create([Bind("ofID,ofName,ofEmail,ofPassword")] Officer officer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(officer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(officer));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("SchoolID,SchoolCode,SchoolName,orgID")] school school)
        {
            if (ModelState.IsValid)
            {
                _context.Add(school);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(school));
        }
Beispiel #3
0
        public async Task <IActionResult> Create([Bind("orgID,orgName,orgPhone,orgEmail,orgPassword")] Organizer organizer)
        {
            if (ModelState.IsValid)
            {
                if (organizer.orgID == 0)
                {
                    _context.Add(organizer);
                }

                else
                {
                    _context.Update(organizer);
                }

                await _context.SaveChangesAsync();

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