/// <summary> /// API to edit a particular employee /// </summary> /// <param name="employee"></param> /// <returns></returns> public IHttpActionResult PostEditEmployee(Employee employee) { _Logger.Info("PostEditEmployee API called."); try { _ExceptionCheck.ValidateEmployee(employee); bool Check = _BusinessOperations.UpdateEmployee(employee); if (Check == false) { _Logger.Error("Employee Not Updated"); return(base.NotFound()); } else { return(base.Ok(EmployeeAPIController._Employee)); } } catch (EmployeeManagementExceptions exception) { _Logger.Error(exception.ToString()); return(InternalServerError(exception)); } catch (MySqlException exception) { _Logger.Error(exception.ToString()); if (exception.Message.Contains("Duplicate")) { return(Content((HttpStatusCode)422, "Database Error")); } else { return(InternalServerError(exception)); } } catch (Exception ex) { _Logger.Fatal(ex.ToString()); return(InternalServerError(ex)); } }