public async Task <IActionResult> Create([Bind("Id,Name,Project,TeamLead")] Team team)
        {
            if (ModelState.IsValid)
            {
                _context.Add(team);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(team));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Title,Description,Teams")] Project project)
        {
            if (ModelState.IsValid)
            {
                _context.Add(project);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(project));
        }
        public async Task <IActionResult> Create([Bind("Id,User,StartVac,EndVac,RequestDate,Accepted")] Vacation vacation)
        {
            vacation.RequestDate = DateTime.Now;
            vacation.User        = User.Identity.Name;
            if (ModelState.IsValid)
            {
                _context.Add(vacation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(vacation));
        }
        public async Task <IActionResult> Create([Bind("Id,User,FromDate,ToDate,DateCreation,IsIll,IsConf")] Vacation vacation)
        {
            vacation.DateCreation = DateTime.Now;
            vacation.User         = User.Identity.Name;
            if (ModelState.IsValid)
            {
                _context.Add(vacation);
                await _context.SaveChangesAsync();

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