예제 #1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Premium,EmployeeId")] Project project)
        {
            if (ModelState.IsValid)
            {
                _context.Add(project);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(project));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,DateCreated,ExamDate,ResultsDate,Description,Hemoglobin,Hematocrit,WhiteBloodCellCount,RedBloodCellCount")] Blood blood)
        {
            if (ModelState.IsValid)
            {
                _context.Add(blood);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(blood));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("WorkId,Company,WorkTitle,WorkLength,Description")] Works works)
        {
            if (ModelState.IsValid)
            {
                _context.Add(works);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(works));
        }
예제 #4
0
        public async Task <IActionResult> Create([Bind("ID,EQPID")] Work work)
        {
            if (ModelState.IsValid)
            {
                _context.Add(work);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(work));
        }
        public async Task <IActionResult> Create([Bind("EmployeeId,FullName,Position")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
예제 #6
0
        public IActionResult PostWork(string name, int id)
        {
            var work = new Work()
            {
                work_Name = name,
                comp_Id   = id
            };

            _context.Add(work);
            _context.SaveChanges();
            return(Ok("Created"));
        }