// PUT api/<controller>/5 public IHttpActionResult Put([FromUri] int sId, [FromUri] int appId, [FromBody] ApplictionsToUniversity application) { application.id = appId; appRepo.Update(application); linkGen(application, sId); return(Ok(application)); }
// PUT api/<controller>/5 public IHttpActionResult Put([FromBody] ApplictionsToUniversity appliction, [FromUri] int id, [FromUri] int oId, [FromUri] int uId) { appliction.id = id; apRep.Update(appliction); linkGen(appliction, uId); return(Ok(appliction)); }
// GET api/<controller> public IHttpActionResult Post(int sId, [FromUri] int oId, [FromBody] ApplictionsToUniversity application) { application.UniversityOfferID = oId; application.StudentId = sId; appRepo.Insert(application); linkGen(application, sId); return(Created("", application)); }
public ActionResult ApplyToUniversity(ApplictionsToUniversity applyToUni) { IApplictionsToUniversityRepository appToUniRepo = new ApplictionsToUniversityRepository(); appToUniRepo.Insert(applyToUni); return(RedirectToAction("UniversityOffer", "Student")); }
public void linkGen(ApplictionsToUniversity app, int sId) { app.links.Add(new Links() { HRef = "http://localhost:44348/api/student/" + sId + "/university/applications/", Method = "GET", Rel = "Get all the application to university by specific student" }); app.links.Add(new Links() { HRef = "http://localhost:44348/api/student/" + sId + "/university/application/" + app.id, Method = "GET", Rel = "Get specific application" }); app.links.Add(new Links() { HRef = "http://localhost:44348/api/student/" + sId + "/university/application/" + app.id, Method = "PUT", Rel = "update specific application" }); app.links.Add(new Links() { HRef = "http://localhost:44348/api/student/" + sId + "/university/application/" + app.id, Method = "delete", Rel = "delete specific application" }); }
public void linkGen(ApplictionsToUniversity appliction, int uniId) { appliction.links.Add(new Links() { HRef = "http://localhost:44348/api/universities/" + uniId + "/applications", Method = "GET", Rel = "Get all the applications list to an university" }); appliction.links.Add(new Links() { HRef = "http://localhost:44348/api/universities/" + uniId + "/offers/" + appliction.UniversityOfferID + "/applications", Method = "GET", Rel = "Get all the applications list to an scholarship offer of an university" }); appliction.links.Add(new Links() { HRef = "http://localhost:44348/api/universities/" + uniId + "/offers/" + appliction.UniversityOfferID + "/applications/" + appliction.id, Method = "GET", Rel = "Get an specified application to an university offer by ID" }); appliction.links.Add(new Links() { HRef = "http://localhost:44348/api/universities/" + uniId + "/offers/" + appliction.UniversityOfferID + "/applications" + appliction.id, Method = "PUT", Rel = "Modify an existing application resource" }); appliction.links.Add(new Links() { HRef = "http://localhost:44348/api/universities/" + uniId + "/offers/" + appliction.UniversityOfferID + "/applications", Method = "DELETE", Rel = "Delete an existing application resource" }); }