Ejemplo n.º 1
0
        public RedirectToRouteResult Delete(Technology technology, string returnUrl)
        {
            Technology tech = _efDbContext.Technologies.FirstOrDefault(t => t.TechnologyID == technology.TechnologyID);

            if (tech != null)
            {
                _efDbContext.Technologies.Remove(tech);
            }
            _efDbContext.SaveChanges();
            return RedirectToAction("Index", new { returnUrl });
        }
Ejemplo n.º 2
0
        public ActionResult Update(Technology technology, string returnUrl)
        {
            Technology tech = _efDbContext.Technologies.FirstOrDefault(t => t.TechnologyID == technology.TechnologyID);

            if (tech != null)
            {
                tech.TechnologyName = technology.TechnologyName;
                technology.TechnologyType = technology.TechnologyType;
            }
            _efDbContext.SaveChanges();
            return RedirectToAction("Index", new { returnUrl });
        }
Ejemplo n.º 3
0
        public ActionResult Create(Technology technology, string returnUrl)
        {
            Technology tech = new Technology
            {
                TechnologyName = technology.TechnologyName,
                TechnologyType = technology.TechnologyType
            };

            _efDbContext.Technologies.Add(tech);
            _efDbContext.SaveChanges();
            return RedirectToAction("Index", new { returnUrl });
        }