// PUT api/Recruiment/5 public IHttpActionResult PutTTUT(int id, TTUT ttut) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != ttut.ID) { return(BadRequest()); } db.Entry(ttut).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TTUTExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetTTUT(string id) { int ID = int.Parse(id); TTUT ttut = db.TTUTs.Find(ID); if (ttut == null) { return(NotFound()); } return(Ok(ttut)); }
public IHttpActionResult DeleteTTUT(int id) { TTUT ttut = db.TTUTs.Find(id); if (ttut == null) { return(NotFound()); } db.TTUTs.Remove(ttut); db.SaveChanges(); return(Ok(ttut)); }
public IHttpActionResult PostTTUT(string fullname, string phonenumber, DateTime dob, string email, string applyposition, string file, DateTime doa) { var list = new TTUT { FullName = fullname, DayofBirth = dob, PhoneNumber = phonenumber, Email = email, ApplyPosition = applyposition, DateofApplication = doa, FileAttach = file }; db.TTUTs.Add(list); db.SaveChanges(); return(Json(new { msg = "Đăng ký ứng tuyển thành công", accept = true })); }
public ActionResult AddResume(string username, string email, string phone, string birthday, string position, string FileAttach) { //DateTime myDate = DateTime.ParseExact(birthday, "yyyy-MM-dd", CultureInfo.InvariantCulture); //Parse string => DateTime var list = new TTUT { FullName = username, PhoneNumber = phone, DayofBirth = DateTime.Now, Email = email, ApplyPosition = position, DateofApplication = DateTime.Now, FileAttach = FileAttach }; db.TTUTs.Add(list); db.SaveChanges(); return(Json(new { msg = "Đăng ký ứng tuyển thành công", accept = true })); }