public ActionResult DeleteConfirmed(int id) { regiones regiones = db.regiones.Find(id); db.regiones.Remove(regiones); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,region,id_pais")] regiones regiones) { if (ModelState.IsValid) { db.Entry(regiones).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_pais = new SelectList(db.paises, "id", "pais", regiones.id_pais); return(View(regiones)); }
public ActionResult Create([Bind(Include = "id,region,id_pais")] regiones regiones) { if (ModelState.IsValid) { db.regiones.Add(regiones); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_pais = new SelectList(db.paises, "id", "pais", regiones.id_pais); return(View(regiones)); }
// GET: Region/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } regiones regiones = db.regiones.Find(id); if (regiones == null) { return(HttpNotFound()); } return(View(regiones)); }
// GET: Region/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } regiones regiones = db.regiones.Find(id); if (regiones == null) { return(HttpNotFound()); } ViewBag.id_pais = new SelectList(db.paises, "id", "pais", regiones.id_pais); return(View(regiones)); }
private void CbRegiones_SelectionChanged(object sender, SelectionChangedEventArgs e) { var cb = (ComboBox)sender; regiones reg = cb.SelectedItem as regiones; wrapValores.Children.OfType <ItemValor>().Where(x => x.Procedencia == "region").ToList().ForEach(item => wrapValores.Children.Remove(item)); wrapValores.Children.Add(new ItemValor() { Nombre = $"Costo viaje", ValorInt = reg.costo_viaje, Procedencia = "region" }); wrapValores.Children.Add(new ItemValor() { Nombre = $"Taza imprevisto", ValorInt = reg.taza_imprevisto, Procedencia = "region" }); TasaImprevisto = reg.taza_imprevisto; }