public void InsertOrUpdate(CompetencyHeader competencyHeader)
 {
     if (competencyHeader.CompetencyHeaderId == 0) //new
     {
         context.CompetencyHeaders.Add(competencyHeader);
     }
     else //edit
     {
         context.Entry(competencyHeader).State = EntityState.Modified;
     }
 }
Exemplo n.º 2
0
        // GET: CompetencyHeaders/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CompetencyHeader competencyHeader = competencyHeadersRepository.Find(id.Value);

            if (competencyHeader == null)
            {
                return(HttpNotFound());
            }
            return(View(competencyHeader));
        }
Exemplo n.º 3
0
 public ActionResult Delete(CompetencyHeader competencyHeader)
 {
     //save to db.
     if (ModelState.IsValid)
     {
         int id = competencyHeader.CompetencyHeaderId;
         competenciesHeadersRepository.Delete(id);
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View(competencyHeader));
     }
 }
Exemplo n.º 4
0
        public void Delete(int id)
        {
            CompetencyHeader s = Find(id);

            context.CompetencyHeaders.Remove(s);
        }
        public CompetencyHeader Find(int id)
        {
            CompetencyHeader competencyHeader = dbContext.CompetencyHeaders.Find(id);

            return(competencyHeader);
        }
 public void Delete(CompetencyHeader header)
 {
     context.CompetencyHeaders.Remove(header);
     this.Save();
 }
 public ActionResult DeleteConfirmed(CompetencyHeader header)
 {
     db.Delete(header);
     return(RedirectToAction("Index"));
 }