public IHttpActionResult PutPersonalInfo(string id, List <Education> education) { try { var empid = DatabaseAction.GetEmployeeID(id); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } foreach (var vp in education) { db.Entry(vp).State = EntityState.Modified; } db.SaveChanges(); return(Ok("Education Details Updated Successfully")); } catch (Exception ex) { LogFile.WriteLog(ex); return(BadRequest()); } }
public IHttpActionResult PutEmployee(int id, Employee employee) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != employee.Employee_id) { return(BadRequest()); } db.Entry(employee).State = EntityState.Modified; try { db.SaveChanges(); return(Ok("Employee Details Updated Successfully")); } catch (Exception ex) { LogFile.WriteLog(ex); return(BadRequest()); } }
public IHttpActionResult PutEmployee(string id, Education education) { try { education.Employee_id = DatabaseAction.GetEmployeeID(id); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Entry(education).State = EntityState.Modified; db.SaveChanges(); return(Ok("Education Details Updated Successfully")); } catch (Exception ex) { LogFile.WriteLog(ex); return(BadRequest()); } }
public IHttpActionResult PutPreviousEmployment(string id, PreviousEmployment previousemployment) { try { previousemployment.Employee_id = DatabaseAction.GetEmployeeID(id); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Entry(previousemployment).State = EntityState.Modified; db.SaveChanges(); return(Ok("Previous Employment Details Updated Successfully")); } catch (Exception ex) { LogFile.WriteLog(ex); return(BadRequest()); } }