public void UpdateEmployee(EmployeesLogs checkedstatus)
 {
     if (checkedstatus == null)
     {
         throw new ArgumentNullException(nameof(checkedstatus));
     }
     _ctx.EmployeesLogs.Update(checkedstatus);
 }
Exemple #2
0
 public IActionResult LogsCreate([FromBody] EmployeesLogs emplogs)
 {
     try
     {
         if (emplogs == null || !ModelState.IsValid)
         {
             return(BadRequest(ErrorCode.enterrecorddetails.ToString()));
         }
         bool EmpLogExist = _toDoRepository.isLogExist(emplogs.EmpId);
         if (EmpLogExist)
         {
             return(StatusCode(StatusCodes.Status409Conflict, ErrorCode.logExist.ToString()));
         }
         _toDoRepository.Insert(emplogs);
         _toDoRepository.SaveAll();
     }
     catch (Exception)
     {
         return(BadRequest(ErrorCode.CouldNotCreateItem.ToString()));
     }
     return(Ok(emplogs));
 }
Exemple #3
0
        public IActionResult EditLOT(int id, [FromBody] EmployeesLogs employeesLogs)
        {
            try
            {
                if (employeesLogs == null || !ModelState.IsValid)
                {
                    return(BadRequest(ErrorCode.enterrecorddetails.ToString()));
                }
                var RecordToBeUpdated = _toDoRepository.find(id);
                RecordToBeUpdated.Lot = DateTime.Now;

                if (RecordToBeUpdated == null)
                {
                    return(NotFound(ErrorCode.RecordNotFound.ToString()));
                }
                _toDoRepository.UpdateEmployee(RecordToBeUpdated);
                _toDoRepository.SaveAll();
            }
            catch (Exception)
            {
                return(BadRequest(ErrorCode.CouldNotUpdateItem.ToString()));
            }
            return(NoContent());
        }
 public void Insert(EmployeesLogs Emplogs)
 {
     _ctx.EmployeesLogs.Add(Emplogs);
 }