public void Inserir(ComEle ce) { AndromedaContext ctx = new AndromedaContext(); ctx.ComEle.Add(ce); ctx.SaveChanges(); }
public void Excluir(int id) { AndromedaContext ctx = new AndromedaContext(); ComEle ce = ctx.ComEle.Find(id); ctx.Entry(ce).State = System.Data.Entity.EntityState.Deleted; ctx.SaveChanges(); }
public ActionResult AdicionarItem(ResListViewModel model) { IEleDAL eDAL = new IEleDAL(); IEle ele = eDAL.BuscarPorNome(model.IEleAdd.NmEle); ComEleDAL ceDAL = new ComEleDAL(); ComEle ce = new ComEle(model.IEleAdd.IdCom, ele.IdIEle, 0); ceDAL.Inserir(ce); @TempData["msg"] = "Item EletrĂ´nico adicionado com sucesso"; return(RedirectToAction("Index", "ResList")); }