public IHttpActionResult PostCVTechnology(CVTechnology cVTechnology)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.CVTechnologies.Add(cVTechnology);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (CVTechnologyExists(cVTechnology.CVID))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = cVTechnology.CVID }, cVTechnology));
        }
        public IHttpActionResult PutCVTechnology(int id, CVTechnology cVTechnology)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != cVTechnology.CVID)
            {
                return(BadRequest());
            }

            db.Entry(cVTechnology).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CVTechnologyExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            CVTechnology cVTechnology = db.CVTechnologies.Find(id);

            db.CVTechnologies.Remove(cVTechnology);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public IHttpActionResult GetCVTechnology(int id)
        {
            CVTechnology cVTechnology = db.CVTechnologies.Find(id);

            if (cVTechnology == null)
            {
                return(NotFound());
            }

            return(Ok(cVTechnology));
        }
Example #5
0
 public ActionResult Edit([Bind(Include = "CVID,CVTechnologiesName,CVTechnologiesExperience")] CVTechnology cVTechnology)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cVTechnology).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CVID = new SelectList(db.CVs, "CVID", "Objective", cVTechnology.CVID);
     return(View(cVTechnology));
 }
        public IHttpActionResult DeleteCVTechnology(int id)
        {
            CVTechnology cVTechnology = db.CVTechnologies.Find(id);

            if (cVTechnology == null)
            {
                return(NotFound());
            }

            db.CVTechnologies.Remove(cVTechnology);
            db.SaveChanges();

            return(Ok(cVTechnology));
        }
Example #7
0
        // GET: CVTechnologies/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CVTechnology cVTechnology = db.CVTechnologies.Find(id);

            if (cVTechnology == null)
            {
                return(HttpNotFound());
            }
            return(View(cVTechnology));
        }
Example #8
0
        // GET: CVTechnologies/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CVTechnology cVTechnology = db.CVTechnologies.Find(id);

            if (cVTechnology == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CVID = new SelectList(db.CVs, "CVID", "Objective", cVTechnology.CVID);
            return(View(cVTechnology));
        }