public ActionResult EditTel(TelefonoLotificadoraViewModels model) { if (ModelState.IsValid) { TelLoti = dbCtx.TelefonoLotificadora.FirstOrDefault(a => a.Id == model.Id); TelLoti.NumeroTelefono = model.NumeroTelefono; TelLoti.CompaniaTelefonoId = model.CompaniaTelefonoId; dbCtx.SaveChanges(); } return(RedirectToAction("Index")); }
//desde aka---------------------------------------------------------------- public ActionResult EditTel(int id) { ViewBag.Title = "Editar Numero"; TelefonoLotificadoraViewModels tellotificadora = new TelefonoLotificadoraViewModels(); TelLoti = dbCtx.TelefonoLotificadora.FirstOrDefault(a => a.LotificadoraId == id); tellotificadora.NumeroTelefono = TelLoti.NumeroTelefono; tellotificadora.CompaniaTelefonoId = TelLoti.CompaniaTelefonoId; tellotificadora.Companias = dbCtx.CompaniaTelefono.ToList(); return(View(tellotificadora)); }