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)); }
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)); }
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)); }