Example #1
0
        public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,Email")] Employees employees)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employees);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employees));
        }
        public async Task <IActionResult> Create([Bind("JobCode,JobTtile,StartDate")] Jobs jobs)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobs);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(jobs));
        }
        public async Task <IActionResult> Create([Bind("Id,Password,Type")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
        public async Task <IActionResult> Create([Bind("JobAssignmentsId,JobCode,Id,AssignemtDate")] JobAssignments jobAssignments)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobAssignments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Id"]      = new SelectList(_context.Employees, "Id", "Email", jobAssignments.Id);
            ViewData["JobCode"] = new SelectList(_context.Jobs, "JobCode", "JobCode", jobAssignments.JobCode);
            return(View(jobAssignments));
        }