Beispiel #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 });
        }
Beispiel #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 });
        }
Beispiel #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 });
        }