public async Task <IActionResult> Create([Bind("UserId,UserName,Gender,DateRegistration,SelectedDay1,SelectedDay2,SelectedDay3,AdditionalRequest,IsActive")] User user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Create([Bind("Code,Name,Description,SemesterOffered,SemesterOffered2,PrereqCourseCode,Compulsory")] Courses courses) { if (ModelState.IsValid) { _context.Add(courses); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(courses)); }
public async Task <IActionResult> Create([Bind("RollNumber,FullName,Email,Avartar,Address,Phone,Birthday,Admission,UpdateAt,Status")] Student student) { if (ModelState.IsValid) { _context.Add(student); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(student)); }
public async Task <IActionResult> Create([Bind("Id,UserName,Password,Salt,CreatedAt,UpdatedAt,Status,Role")] Account account) { if (ModelState.IsValid) { account.GenerateSalt(); account.EncryptPassword(); _context.Add(account); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(account)); }