Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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));
        }
Exemple #4
0
        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));
        }