Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Name")] 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,Date,DayOfWeek,Description,CreatedById")] Hollyday hollyday)
        {
            if (ModelState.IsValid)
            {
                _context.Add(hollyday);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CreatedById"] = new SelectList(_context.Employees, "Id", "Id", hollyday.CreatedById);
            return(View(hollyday));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("Id,StartDate,EndDate,MonthId,YearId,TeamId")] BusinessDay businessDay)
        {
            if (ModelState.IsValid)
            {
                _context.Add(businessDay);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TeamId"] = new SelectList(_context.Teams, "Id", "Id", businessDay.TeamId);
            return(View(businessDay));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("Role,Id,UserId,FirstName,LastName,WebPageAddress,Address,MobilePhoneNo,OfficePhoneNo,HomePhoneNo,FaxNo,TeamId,SeniorId")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SeniorId"] = new SelectList(_context.Employees, "Id", "Id", employee.SeniorId);
            ViewData["TeamId"]   = new SelectList(_context.Teams, "Id", "Id", employee.TeamId);
            return(View(employee));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("Id,TeamId,HollydayId")] HollydayTeam hollydayTeam)
        {
            if (ModelState.IsValid)
            {
                _context.Add(hollydayTeam);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["HollydayId"] = new SelectList(_context.HollyDays, "Id", "Id", hollydayTeam.HollydayId);
            ViewData["TeamId"]     = new SelectList(_context.Teams, "Id", "Id", hollydayTeam.TeamId);
            return(View(hollydayTeam));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Create([Bind("Id,TimeStamp,Status,PercentageOfWorkCompleted,AssignedToId,AssignedById,TaskId")] TaskSnapShot taskSnapShot)
        {
            if (ModelState.IsValid)
            {
                _context.Add(taskSnapShot);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AssignedById"] = new SelectList(_context.Employees, "Id", "Id", taskSnapShot.AssignedById);
            ViewData["AssignedToId"] = new SelectList(_context.Employees, "Id", "Id", taskSnapShot.AssignedToId);
            ViewData["TaskId"]       = new SelectList(_context.Tasks, "Id", "Id", taskSnapShot.TaskId);
            return(View(taskSnapShot));
        }
Ejemplo n.º 7
0
        public async Task <IActionResult> Create(
            [Bind("Id,CreatedOn,Priority,BusinessDT,Title,Description,IsCommissioned,PrimaryOwnerId,SecondaryOwnerId,ReviewerId,TeamId")]
            Server.Models.Task task)
        {
            if (ModelState.IsValid)
            {
                _context.Add(task);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PrimaryOwnerId"]   = new SelectList(_context.Employees, "Id", "Id", task.PrimaryOwnerId);
            ViewData["ReviewerId"]       = new SelectList(_context.Employees, "Id", "Id", task.ReviewerId);
            ViewData["SecondaryOwnerId"] = new SelectList(_context.Employees, "Id", "Id", task.SecondaryOwnerId);
            ViewData["TeamId"]           = new SelectList(_context.Teams, "Id", "Id", task.TeamId);
            return(View(task));
        }