Exemple #1
0
        public async Task <IActionResult> Create([Bind("Id,Name")] TeamsModel teamsModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(teamsModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(teamsModel));
        }
        public async Task <IActionResult> Create([Bind("Id,DateSent,UserId,FromDate,UntilDate,LeaveId,HalfDay,AttachmentUrl,Approved")] RequestsModel requestsModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(requestsModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(requestsModel));
        }
Exemple #3
0
        public async Task <IActionResult> Create([Bind("Id,Name,Description,TeamId")] ProjectsModel projectsModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(projectsModel);
                await _context.SaveChangesAsync();

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