示例#1
0
        public async Task <IActionResult> PutEmployeeSkill(int id, update ESkill)
        {
            //if (id != employeeSkill.pkAuto)
            //{
            //    return BadRequest();
            //}
            bool Con = true;

            while (Con)
            {
                empskillsmodel1 empSkill = await _context.empskillsmodel1.Where(d => d.id == Convert.ToInt32(ESkill.id) && d.approval_status != Convert.ToInt32(ESkill.status))
                                           .Select(d => d).FirstOrDefaultAsync();


                if (empSkill == null)
                {
                    Con = false;
                    break;
                }
                empSkill.approval_status       = Convert.ToInt32(ESkill.status);
                _context.Entry(empSkill).State = EntityState.Modified;
                try
                {
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    return(NoContent());
                }
            }
            return(NoContent());
        }
示例#2
0
        public async Task <ActionResult <empskillsmodel1> > Postempskillsmodel1(empskillsmodel1 empskillsmodel1)
        {
            _context.empskillsmodel1.Add(empskillsmodel1);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getempskillsmodel1", new { id = empskillsmodel1.id }, empskillsmodel1));
        }