public IHttpActionResult PutTenantAdmin(int id, TenantAdmin tenantAdmin) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tenantAdmin.TenantAdminID) { return(BadRequest()); } db.Entry(tenantAdmin).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TenantAdminExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutRefferingEmployee(int id, RefferingEmployee refferingEmployee) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != refferingEmployee.Id) { return(BadRequest()); } service.Updatereffering(refferingEmployee); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!RefferingEmployeeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutJobOffer(int id, JobOffer jobOffer) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != jobOffer.JobOfferID) { return(BadRequest()); } db.Entry(jobOffer).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!JobOfferExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,Email,Password,organisationName,organisationAddress,organisationPhone,Role")] Recruter recruter) { if (ModelState.IsValid) { db.Entry(recruter).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(recruter)); }
public ActionResult Edit([Bind(Include = "TenantAdminID,FirstName,LastName,Email,Password,organisationName,organisationAddress,organisationPhone")] TenantAdmin tenantAdmin) { if (ModelState.IsValid) { db.Entry(tenantAdmin).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tenantAdmin)); }
public ActionResult Create([Bind(Include = "Id,FirstName,LastName,Email,Password,organisationName,organisationAddress,organisationPhone,Role,RewardCredit")] RefferingEmployee refferingEmployee) { if (ModelState.IsValid) { db.Refferings.Add(refferingEmployee); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(refferingEmployee)); }
public ActionResult Edit([Bind(Include = "JobOfferID,NameJobOffer,Description,StartDate,ExpirationDate,PointGet,RecuterID")] JobOffer jobOffer) { if (ModelState.IsValid) { db.Entry(jobOffer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RecuterID = new SelectList(db.Recruters, "Id", "FirstName", jobOffer.RecuterID); return(View(jobOffer)); }
public ActionResult DeleteConfirmed(int id) { HrSmartContext db = new HrSmartContext(); RefferingEmployee refferingEmployee = db.Refferings.Find(id); db.Refferings.Remove(refferingEmployee); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,Email,Password,organisationName,organisationAddress,organisationPhone,Role,RewardCredit")] RefferingEmployee refferingEmployee) { if (ModelState.IsValid) { HrSmartContext db = new HrSmartContext(); db.Entry(refferingEmployee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(refferingEmployee)); }