public async Task <IActionResult> Create([Bind("ID,LastName,FirstName,StartingDate")] Supervisor supervisor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(supervisor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(supervisor));
        }
        public async Task <IActionResult> Create([Bind("DepartmentID,Title,Budget")] Department department)
        {
            if (ModelState.IsValid)
            {
                _context.Add(department);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(department));
        }
        public async Task <IActionResult> Create([Bind("EId,EName,EDesig,EDOJ")] Emp emp)
        {
            if (ModelState.IsValid)
            {
                _context.Add(emp);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(emp));
        }
Example #4
0
        public async Task <IActionResult> Create([Bind("ContractID,DepartmentID,StandardID,SupervisorID")] Contract contract)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contract);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DepartmentID"] = new SelectList(_context.Departments, "DepartmentID", "Title", contract.DepartmentID);
            ViewData["StandardID"]   = new SelectList(_context.Standards, "ID", "FirstName", contract.StandardID);
            ViewData["SupervisorID"] = new SelectList(_context.Supervisors, "ID", "FirstName", contract.SupervisorID);
            return(View(contract));
        }