public ActionResult DeleteConfirmed(int id) { JobOffers jobOffers = db.JobOffers.Find(id); db.JobOffers.Remove(jobOffers); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "JobOffersID,Title,AboutTheWork,EndDate,PhoneNumber,Email,Visable,Author")] JobOffers jobOffers) { if (ModelState.IsValid) { db.Entry(jobOffers).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(jobOffers)); }
// GET: JobOffers/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } JobOffers jobOffers = db.JobOffers.Find(id); if (jobOffers == null) { return(HttpNotFound()); } return(View(jobOffers)); }
// GET: Experience public ActionResult Index() { List <Experience> xExperience; List <JobOffers> xJobOffer; if (db.Experiences == null) { Experience x = new Experience(); x.ExperienceID = 1; x.Value = "Wooo"; xExperience = new List <Experience>(); xExperience.Add(x); } else { xExperience = db.Experiences.ToList(); } if (db.JobOffers == null) { JobOffers x = new JobOffers(); x.Title = "Title"; x.Author = "ME"; xJobOffer = new List <JobOffers>(); xJobOffer.Add(x); } else { xJobOffer = db.JobOffers.ToList(); } var view = new JobbViewModel() { Experience = xExperience, JobOffersViewModle = xJobOffer }; return(View(view)); }
public ActionResult CreateTest() { Qualification xQualification = new Qualification(); JobOffers xJobOffers = new JobOffers(); xJobOffers.Title = Request["Title"]; xJobOffers.EndDate = Request["EndDate"].AsDateTime(); xJobOffers.PhoneNumber = Request["PhoneNumber"]; xJobOffers.AboutTheWork = Request["AboutTheWork"]; xJobOffers.Author = Request["Author"]; xJobOffers.Visable = Request["Visable"].AsBool(); Post xPost = new Post(); xQualification.JobOffersID = db.JobOffers.Add(xJobOffers).JobOffersID; //string xList = Request["mySelect"]; //string[] sSplit = xList.Split(','); //for (int i = 0; i < sSplit.Length; i++) //{ // xPost.Title = sSplit[i]; // db.Posts.Add(xPost); //} //foreach (var item in xList) //{ // xPost.Title = item.ToString(); //} //var x = new List<string>(); //foreach (string item in Request.Form.AllKeys) //{ // if (item.StartsWith("mySelect")) // { // x.Add(Request.Form[item]); // for (int i = 0; i < y.Count; i++) // { // } // xPost.Title = Request.Form[item]; // db.Posts.Add(xPost); // } //} //foreach (var item in sName) //{ // xPost.Title = item; // db.Posts.Add(xPost); //} List <string> x = ViewData["ListOfThings"] as List <string>; for (int i = 0; i < x.Count; i++) { xPost.Title = x[i]; db.Posts.Add(xPost); } //xPost.Title = sName; //db.Posts.Add(xPost); xQualification.ExperienceID = 1; db.Qualifications.Add(xQualification); db.SaveChanges(); return(RedirectToAction("Index")); }