public bool DeleteAlumno(int id) { try { using (var db = new AlumnosContext()) { Models.ALUMNO a = db.ALUMNO.Find(id); db.ALUMNO.Remove(a); db.SaveChanges(); return(true); } } catch (Exception) { return(false); } }
public JsonResult <AlumnoResponse> Insertar(Alumno alumno) { Alumno Consulta = bd.CARACTERISTICAS .Where(m => m.Matricula == alumno.Matricula) .Where(m => m.Etapa.ToLower() == alumno.Etapa.ToLower()).FirstOrDefault(); if (Consulta != null) { Consulta.Revisado = true; bd.SaveChanges(); return(Json(new AlumnoResponse { Resultado = true })); } return(Json(new AlumnoResponse { Resultado = false })); }
public ActionResult Editar(Materias m) { try { using (var db = new AlumnosContext()) { Materias ma = db.Materias.Find(m.Id); ma.Nombre = m.Nombre; ma.Id_docente = m.Id_docente; db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { throw; } }
protected void btnGuardarEdicion_Click(object sender, EventArgs e) { if (!(tbEditarAlumno_Nombre.Text == "" || tbEditarAlumno_Apellido.Text == "" || tbEditarAlumno_Edad.Text == "")) { using (var db = new AlumnosContext()) { int id = Convert.ToInt32(lblAlumnoResultado_ID.Text); ALUMNO alumnoEditado = db.ALUMNO.Find(id); //PARSEO A MANO alumnoEditado.NOMBRE = tbEditarAlumno_Nombre.Text; alumnoEditado.APELLIDO = tbEditarAlumno_Apellido.Text; alumnoEditado.EDAD = Convert.ToInt16(tbEditarAlumno_Edad.Text); alumnoEditado.SEXO = ddlEditarAlumno_Sexo.SelectedValue; alumnoEditado.CIUDAD_ID = Convert.ToInt32(ddlEditarAlumno_Ciudad.SelectedValue); if (db.SaveChanges() > 0) { // Muestro los Labels lblAlumnoResultado_Nombre.Visible = true; lblAlumnoResultado_Apellido.Visible = true; lblAlumnoResultado_Edad.Visible = true; lblAlumnoResultado_Sexo.Visible = true; lblAlumnoResultado_Ciudad.Visible = true; // Escondo los TextBox tbEditarAlumno_Nombre.Visible = false; tbEditarAlumno_Apellido.Visible = false; tbEditarAlumno_Edad.Visible = false; ddlEditarAlumno_Sexo.Visible = false; ddlEditarAlumno_Ciudad.Visible = false; // Igualo de lado cliente ya que esta validado. lblAlumnoResultado_Nombre.Text = tbEditarAlumno_Nombre.Text; lblAlumnoResultado_Apellido.Text = tbEditarAlumno_Apellido.Text; lblAlumnoResultado_Edad.Text = tbEditarAlumno_Edad.Text; lblAlumnoResultado_Sexo.Text = ddlEditarAlumno_Sexo.SelectedValue; lblAlumnoResultado_Ciudad.Text = ddlEditarAlumno_Ciudad.SelectedValue; poblarGV(); } } } }
public ActionResult Editar(Alumno a) { try { using (var db = new AlumnosContext()) { Alumno al = db.Alumno.Find(a.Id); al.Nombres = a.Nombres; al.Apellidos = a.Apellidos; al.Edad = a.Edad; al.Sexo = a.Sexo; db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { throw; } }
public ActionResult Agregarcalificacion(Calificacion c) { if (!ModelState.IsValid) { return(View()); } try { using (var db = new AlumnosContext()) { db.Calificacion.Add(c); db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { ModelState.AddModelError("", "Error - " + ex.Message); return(View()); } }
public ActionResult Agregar(Alumno a) { if (!ModelState.IsValid) { return(View()); } try { using (var db = new AlumnosContext()) { db.Alumno.Add(a); db.SaveChanges(); return(RedirectToAction("Listado")); } } catch (Exception ex) { ModelState.AddModelError("Error al crear el registro", ex); return(View()); } }
public ActionResult Editar(Alumno a) { try { using (var context = new AlumnosContext()) { Alumno alumno = context.Alumno.Where(w => w.AlumnoId == a.AlumnoId).FirstOrDefault(); alumno.Nombres = a.Nombres; alumno.Apellidos = a.Apellidos; alumno.Edad = a.Edad; alumno.Sexo = a.Sexo; context.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception) { throw; } }
public ActionResult Agregardocente(Docente d) { if (!ModelState.IsValid) { return(View()); } try { using (var db = new AlumnosContext()) { db.Docente.Add(d); db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception e) { ModelState.AddModelError("", "Error al agregar el alumno - " + e.Message); return(View()); } }
public ActionResult Agregar(ALUMNO al) { if (!ModelState.IsValid) { return(View()); } try { using (var db = new AlumnosContext()) { al.MOMENTO = System.DateTime.Now; db.ALUMNO.Add(al); db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { ModelState.AddModelError("", "Error al registrar alumno - " + ex.Message); return(View()); } }
public ActionResult Agregar(Docente d) { if (!ModelState.IsValid) { return(View()); } try { using (AlumnosContext db = new AlumnosContext()) { db.Docente.Add(d); db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { ModelState.AddModelError("", "Error al registrar el docente - " + ex); return(View()); } }
public ActionResult Editar(Docente d) { if (!ModelState.IsValid) { return(View()); } try { using (var db = new AlumnosContext()) { Docente doc = db.Docente.Find(d.Id); doc.Nombres = d.Nombres; doc.Apellidos = d.Apellidos; db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { throw; } }
public ActionResult Editarcalificacion(Calificacion c) { try { using (var db = new AlumnosContext()) { Calificacion cal = db.Calificacion.Find(c.Id_Calificacion); cal.id_alumno = c.id_alumno; cal.id_materia = c.id_materia; cal.Nota1 = c.Nota1; cal.Nota2 = c.Nota2; cal.Nota3 = c.Nota3; cal.Nota4 = c.Nota4; db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { ModelState.AddModelError("", "Error - " + ex.Message); return(View()); } }
public ActionResult Editar(Materia m) { if (!ModelState.IsValid) { return(View()); } try { using (var db = new AlumnosContext()) { Materia mat = db.Materia.Find(m.Id); mat.Nombre = m.Nombre; db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { return(View()); throw; } }
public ActionResult Agregar(Alumno a) { if (!ModelState.IsValid) { return(View()); } try { using (var db = new AlumnosContext()) { a.FechaRegistro = DateTime.Now; db.Alumno.Add(a); db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { ModelState.AddModelError("", "ERROR AL CREAR ALUMNO " + ex.Message); return(View()); } }
public ActionResult Editarmateria(Materia m) { if (!ModelState.IsValid) { return(View()); } try { using (var db = new AlumnosContext()) { Materia mat = db.Materia.Find(m.Id_Materia); mat.Nombre = m.Nombre; mat.id_docente = m.id_docente; db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { ModelState.AddModelError("", "Error - " + ex.Message); return(View()); } }
public bool EditAlumno(int id, Alumno alumno) { try { using (var db = new AlumnosContext()) { ALUMNO a = db.ALUMNO.Find(id); a.NOMBRE = alumno.NOMBRE; a.APELLIDO = alumno.APELLIDO; a.SEXO = alumno.SEXO; a.EDAD = alumno.EDAD; db.SaveChanges(); return(true); } } catch (Exception) { return(false); } }
public ActionResult Editar(Alumno a) { try { using (var db = new AlumnosContext()) { Alumno alum = db.Alumno.Find(a.Id); alum.Nombres = a.Nombres; alum.Apellido = a.Apellido; alum.Edad = a.Edad; alum.Sexo = a.Sexo; alum.CodCiudad = a.CodCiudad; db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { ModelState.AddModelError("", "Error al agregar al alumno" + ex.Message); return(View()); } }
public ActionResult Agregar(Notas n) { if (!ModelState.IsValid) { return(View()); } try { //To open and close conection using (var db = new AlumnosContext()) { db.Notas.Add(n); db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { ModelState.AddModelError("", "Error al registrar docente " + ex.Message); return(View()); } }
public ActionResult Agregar(Alumno a) { if (!ModelState.IsValid) { return(View()); } try { using (var context = new AlumnosContext()) { a.FechaAlta = DateTime.Now; context.Alumno.Add(a); context.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { ModelState.AddModelError("", "Error al agregar el alumno -" + ex.Message); return(View()); } }
public ActionResult Editar(Notas n) { try { using (var db = new AlumnosContext()) { Notas no = db.Notas.Find(n.Id); no.Id_alumno = n.Id_alumno; no.Id_materia = n.Id_materia; no.Lab1 = n.Lab1; no.Parcial1 = n.Parcial1; no.Lab2 = n.Lab2; no.Parcial2 = n.Parcial2; no.Lab3 = n.Lab3; no.Parcial3 = n.Parcial3; db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { throw; } }
public ActionResult Agregar(Alumnos a) { if (!ModelState.IsValid) { return(View()); } try { using (var db = new AlumnosContext()) { a.FechaRegistro = DateTime.Now; db.Alumnos.Add(a); db.SaveChanges(); return(RedirectToAction("Index")); } } catch (Exception ex) { ModelState.AddModelError("", "Error al registrar alumno " + ex.Message); Console.WriteLine(ex.ToString()); return(View()); } }
public void Carga() { using (var context = new AlumnosContext()) { var lista = new List <Ciudad>(); lista.Add(new Ciudad { Nombre = "" }); lista.Add(new Ciudad { Nombre = " Nueva York " }); lista.Add(new Ciudad { Nombre = " Los Ángeles " }); lista.Add(new Ciudad { Nombre = " Londres " }); lista.Add(new Ciudad { Nombre = " París " }); lista.Add(new Ciudad { Nombre = " Seúl " }); lista.Add(new Ciudad { Nombre = " Osaka " }); lista.Add(new Ciudad { Nombre = " Shanghái " }); lista.Add(new Ciudad { Nombre = " Chicago " }); lista.Add(new Ciudad { Nombre = " Moscú " }); lista.Add(new Ciudad { Nombre = " Pekín " }); lista.Add(new Ciudad { Nombre = " Colonia " }); lista.Add(new Ciudad { Nombre = " Houston " }); lista.Add(new Ciudad { Nombre = " Washington D.C. " }); lista.Add(new Ciudad { Nombre = " São Paulo " }); lista.Add(new Ciudad { Nombre = " Hong Kong " }); lista.Add(new Ciudad { Nombre = " Dallas " }); lista.Add(new Ciudad { Nombre = " Ciudad de México" }); lista.Add(new Ciudad { Nombre = " Cantón " }); lista.Add(new Ciudad { Nombre = " Tianjin " }); lista.Add(new Ciudad { Nombre = " Singapur " }); lista.Add(new Ciudad { Nombre = " Nagoya " }); lista.Add(new Ciudad { Nombre = " Shenzhen " }); lista.Add(new Ciudad { Nombre = " Boston " }); lista.Add(new Ciudad { Nombre = " Estambul " }); lista.Add(new Ciudad { Nombre = " Filadelfia " }); lista.Add(new Ciudad { Nombre = " El Cairo " }); lista.Add(new Ciudad { Nombre = " San Francisco " }); lista.Add(new Ciudad { Nombre = " Taipéi " }); lista.Add(new Ciudad { Nombre = " Yakarta " }); lista.Add(new Ciudad { Nombre = " Ámsterdam " }); lista.Add(new Ciudad { Nombre = " Buenos Aires " }); lista.Add(new Ciudad { Nombre = " Chongqing " }); lista.Add(new Ciudad { Nombre = " Milán " }); lista.Add(new Ciudad { Nombre = " Bangkok " }); lista.Add(new Ciudad { Nombre = " Busan " }); lista.Add(new Ciudad { Nombre = " Atlanta " }); lista.Add(new Ciudad { Nombre = " Delhi " }); lista.Add(new Ciudad { Nombre = " Toronto " }); lista.Add(new Ciudad { Nombre = " Seattle " }); lista.Add(new Ciudad { Nombre = " Miami " }); lista.Add(new Ciudad { Nombre = " Madrid " }); lista.Add(new Ciudad { Nombre = " Bruselas " }); lista.Add(new Ciudad { Nombre = " Chengdu " }); lista.Add(new Ciudad { Nombre = " Wuhan " }); lista.Add(new Ciudad { Nombre = " Fráncfort del Me" }); lista.Add(new Ciudad { Nombre = " Sídney " }); lista.Add(new Ciudad { Nombre = " Múnich " }); lista.Add(new Ciudad { Nombre = " Hangzhou " }); lista.Add(new Ciudad { Nombre = " Wuxi " }); lista.Add(new Ciudad { Nombre = " Mineápolis " }); lista.Add(new Ciudad { Nombre = " Qingdao " }); lista.Add(new Ciudad { Nombre = " Río de Janeiro " }); lista.Add(new Ciudad { Nombre = " Phoenix " }); lista.Add(new Ciudad { Nombre = " Nankín " }); lista.Add(new Ciudad { Nombre = " San Diego " }); lista.Add(new Ciudad { Nombre = " Dalian " }); lista.Add(new Ciudad { Nombre = " Fukuoka " }); lista.Add(new Ciudad { Nombre = " Shenyang " }); lista.Add(new Ciudad { Nombre = " Changsha " }); lista.Add(new Ciudad { Nombre = " Foshan " }); lista.Add(new Ciudad { Nombre = " Viena " }); lista.Add(new Ciudad { Nombre = " Manila " }); lista.Add(new Ciudad { Nombre = " Lima " }); lista.Add(new Ciudad { Nombre = " Melbourne " }); lista.Add(new Ciudad { Nombre = " Abu Dabi " }); lista.Add(new Ciudad { Nombre = " Detroit " }); lista.Add(new Ciudad { Nombre = " Ningbo " }); lista.Add(new Ciudad { Nombre = " Baltimore " }); lista.Add(new Ciudad { Nombre = " Kuala Lumpur " }); lista.Add(new Ciudad { Nombre = " Santiago " }); lista.Add(new Ciudad { Nombre = " Barcelona " }); lista.Add(new Ciudad { Nombre = " Denver " }); lista.Add(new Ciudad { Nombre = " Kuwait " }); lista.Add(new Ciudad { Nombre = " Riad " }); lista.Add(new Ciudad { Nombre = " Roma " }); lista.Add(new Ciudad { Nombre = " Lille " }); lista.Add(new Ciudad { Nombre = " Hamburgo " }); lista.Add(new Ciudad { Nombre = " Yeda " }); lista.Add(new Ciudad { Nombre = " San José " }); lista.Add(new Ciudad { Nombre = " Bogotá " }); lista.Add(new Ciudad { Nombre = " Portland " }); lista.Add(new Ciudad { Nombre = " Stuttgart " }); lista.Add(new Ciudad { Nombre = " Berlín " }); lista.Add(new Ciudad { Nombre = " Zhengzhou " }); lista.Add(new Ciudad { Nombre = " Montreal " }); lista.Add(new Ciudad { Nombre = " Riverside " }); lista.Add(new Ciudad { Nombre = " Tel Aviv " }); lista.Add(new Ciudad { Nombre = " Bombay " }); lista.Add(new Ciudad { Nombre = " Yantái " }); lista.Add(new Ciudad { Nombre = " Estocolmo " }); lista.Add(new Ciudad { Nombre = " Brasilia " }); lista.Add(new Ciudad { Nombre = " Caracas " }); lista.Add(new Ciudad { Nombre = " Dongguan " }); lista.Add(new Ciudad { Nombre = " Varsovia " }); lista.Add(new Ciudad { Nombre = " San Luis " }); lista.Add(new Ciudad { Nombre = " Pittsburgh " }); lista.Add(new Ciudad { Nombre = " Karlsruhe " }); lista.Add(new Ciudad { Nombre = " Jinan " }); lista.Add(new Ciudad { Nombre = " Perth " }); lista.Add(new Ciudad { Nombre = " Shijiazhuang " }); lista.Add(new Ciudad { Nombre = " Tampa " }); lista.Add(new Ciudad { Nombre = " Atenas " }); lista.Add(new Ciudad { Nombre = " Nantong " }); lista.Add(new Ciudad { Nombre = " Harbin " }); lista.Add(new Ciudad { Nombre = " Sacramento " }); lista.Add(new Ciudad { Nombre = " Copenhague " }); lista.Add(new Ciudad { Nombre = " Charlotte " }); lista.Add(new Ciudad { Nombre = " Lyon " }); lista.Add(new Ciudad { Nombre = " Xi'an " }); lista.Add(new Ciudad { Nombre = " Monterrey " }); lista.Add(new Ciudad { Nombre = " Katowice " }); lista.Add(new Ciudad { Nombre = " Birmingham " }); lista.Add(new Ciudad { Nombre = " Hefei " }); lista.Add(new Ciudad { Nombre = " San Petersburgo " }); lista.Add(new Ciudad { Nombre = " Fuzhou " }); lista.Add(new Ciudad { Nombre = " Orlando " }); lista.Add(new Ciudad { Nombre = " Cleveland " }); lista.Add(new Ciudad { Nombre = " Taichung " }); lista.Add(new Ciudad { Nombre = " Kaohsiung " }); lista.Add(new Ciudad { Nombre = " Indianápolis " }); lista.Add(new Ciudad { Nombre = " Xuzhou " }); lista.Add(new Ciudad { Nombre = " Cincinnati " }); lista.Add(new Ciudad { Nombre = " Changzhou " }); lista.Add(new Ciudad { Nombre = " Vancouver " }); lista.Add(new Ciudad { Nombre = " Zúrich " }); lista.Add(new Ciudad { Nombre = " Columbus " }); lista.Add(new Ciudad { Nombre = " Austin " }); lista.Add(new Ciudad { Nombre = " Kansas City " }); lista.Add(new Ciudad { Nombre = " Ankara " }); lista.Add(new Ciudad { Nombre = " San Antonio " }); lista.Add(new Ciudad { Nombre = " Lagos " }); lista.Add(new Ciudad { Nombre = " Wenzhou " }); lista.Add(new Ciudad { Nombre = " Hartford " }); lista.Add(new Ciudad { Nombre = " Zibo " }); lista.Add(new Ciudad { Nombre = " Aachen " }); lista.Add(new Ciudad { Nombre = " Marsella " }); lista.Add(new Ciudad { Nombre = " Daqing " }); lista.Add(new Ciudad { Nombre = " Budapest " }); lista.Add(new Ciudad { Nombre = " Calgary " }); lista.Add(new Ciudad { Nombre = " Niza " }); lista.Add(new Ciudad { Nombre = " Brisbane " }); lista.Add(new Ciudad { Nombre = " Lisboa " }); lista.Add(new Ciudad { Nombre = " Abiyán " }); lista.Add(new Ciudad { Nombre = " Nashville " }); lista.Add(new Ciudad { Nombre = " Baotou " }); lista.Add(new Ciudad { Nombre = " Las Vegas " }); lista.Add(new Ciudad { Nombre = " Mánchester " }); lista.Add(new Ciudad { Nombre = " Virginia Beach " }); lista.Add(new Ciudad { Nombre = " Eindhoven " }); lista.Add(new Ciudad { Nombre = " Dublín " }); lista.Add(new Ciudad { Nombre = " Praga " }); lista.Add(new Ciudad { Nombre = " Kunming " }); lista.Add(new Ciudad { Nombre = " Taoyuan " }); lista.Add(new Ciudad { Nombre = " Milwaukee " }); lista.Add(new Ciudad { Nombre = " Nápoles " }); lista.Add(new Ciudad { Nombre = " Belo Horizonte " }); lista.Add(new Ciudad { Nombre = " Dongying " }); lista.Add(new Ciudad { Nombre = " Edmonton " }); lista.Add(new Ciudad { Nombre = " Johannesburgo " }); lista.Add(new Ciudad { Nombre = " Dubái " }); lista.Add(new Ciudad { Nombre = " Guadalajara " }); lista.Add(new Ciudad { Nombre = " Sapporo " }); lista.Add(new Ciudad { Nombre = " Bursa " }); lista.Add(new Ciudad { Nombre = " Esmirna " }); lista.Add(new Ciudad { Nombre = " Turín " }); lista.Add(new Ciudad { Nombre = " Providence " }); lista.Add(new Ciudad { Nombre = " Helsinki " }); lista.Add(new Ciudad { Nombre = " Tainan " }); lista.Add(new Ciudad { Nombre = " Xiamen " }); lista.Add(new Ciudad { Nombre = " Sendai " }); lista.Add(new Ciudad { Nombre = " Hiroshima " }); lista.Add(new Ciudad { Nombre = " Leeds " }); lista.Add(new Ciudad { Nombre = " Núremberg " }); lista.Add(new Ciudad { Nombre = " Oslo " }); lista.Add(new Ciudad { Nombre = " Nueva Orleans " }); lista.Add(new Ciudad { Nombre = " Salt Lake City " }); lista.Add(new Ciudad { Nombre = " Búfalo " }); lista.Add(new Ciudad { Nombre = " Bucarest " }); lista.Add(new Ciudad { Nombre = " Richmond " }); lista.Add(new Ciudad { Nombre = " Ciudad Ho Chi Mi" }); lista.Add(new Ciudad { Nombre = " Nanning " }); lista.Add(new Ciudad { Nombre = " Hohhot " }); lista.Add(new Ciudad { Nombre = " Oklahoma City " }); lista.Add(new Ciudad { Nombre = " Bridgeport " }); lista.Add(new Ciudad { Nombre = " Zhongshan " }); lista.Add(new Ciudad { Nombre = " Rochester " }); lista.Add(new Ciudad { Nombre = " Anshan " }); lista.Add(new Ciudad { Nombre = " Liverpool " }); lista.Add(new Ciudad { Nombre = " Dakar " }); lista.Add(new Ciudad { Nombre = " Raleigh " }); lista.Add(new Ciudad { Nombre = " Jacksonville " }); lista.Add(new Ciudad { Nombre = " Taiyuan " }); lista.Add(new Ciudad { Nombre = " Luxemburgo " }); lista.Add(new Ciudad { Nombre = " Louisville " }); lista.Add(new Ciudad { Nombre = " Porto Alegre " }); lista.Add(new Ciudad { Nombre = " Calcuta " }); lista.Add(new Ciudad { Nombre = " Amiens " }); lista.Add(new Ciudad { Nombre = " Hannover " }); lista.Add(new Ciudad { Nombre = " Urumchi " }); lista.Add(new Ciudad { Nombre = " Campinas " }); lista.Add(new Ciudad { Nombre = " Ciudad del Cabo " }); lista.Add(new Ciudad { Nombre = " Honolulu " }); lista.Add(new Ciudad { Nombre = " Madrás " }); lista.Add(new Ciudad { Nombre = " Shizuoka " }); lista.Add(new Ciudad { Nombre = " Albany " }); lista.Add(new Ciudad { Nombre = " Ottawa " }); lista.Add(new Ciudad { Nombre = " Curitiba " }); lista.Add(new Ciudad { Nombre = " Venecia " }); lista.Add(new Ciudad { Nombre = " Okayama " }); lista.Add(new Ciudad { Nombre = " Glasgow " }); lista.Add(new Ciudad { Nombre = " Basilea " }); lista.Add(new Ciudad { Nombre = " East Rand " }); lista.Add(new Ciudad { Nombre = " Daegu " }); lista.Add(new Ciudad { Nombre = " Birmingham " }); lista.Add(new Ciudad { Nombre = " Macao " }); lista.Add(new Ciudad { Nombre = " Baton Rouge " }); lista.Add(new Ciudad { Nombre = " New Haven " }); lista.Add(new Ciudad { Nombre = " Almaty " }); lista.Add(new Ciudad { Nombre = " Valencia " }); lista.Add(new Ciudad { Nombre = " Florencia " }); lista.Add(new Ciudad { Nombre = " Hamamatsu " }); lista.Add(new Ciudad { Nombre = " Portsmouth " }); lista.Add(new Ciudad { Nombre = " Grand Rapids " }); lista.Add(new Ciudad { Nombre = " Omaha " }); lista.Add(new Ciudad { Nombre = " Nottingham " }); lista.Add(new Ciudad { Nombre = " Bielefeld " }); lista.Add(new Ciudad { Nombre = " Niigata " }); lista.Add(new Ciudad { Nombre = " Pretoria " }); lista.Add(new Ciudad { Nombre = " Auckland " }); lista.Add(new Ciudad { Nombre = " Durban " }); lista.Add(new Ciudad { Nombre = " Tulsa " }); lista.Add(new Ciudad { Nombre = " Bremen " }); lista.Add(new Ciudad { Nombre = " Bakersfield " }); lista.Add(new Ciudad { Nombre = " Brístol " }); lista.Add(new Ciudad { Nombre = " Adelaida " }); lista.Add(new Ciudad { Nombre = " Toulouse " }); lista.Add(new Ciudad { Nombre = " Oxnard " }); lista.Add(new Ciudad { Nombre = " Brest " }); lista.Add(new Ciudad { Nombre = " Braunschweig " }); lista.Add(new Ciudad { Nombre = " Fresno " }); lista.Add(new Ciudad { Nombre = " Bangalore " }); lista.Add(new Ciudad { Nombre = " Worcester " }); lista.Add(new Ciudad { Nombre = " Newcastle " }); lista.Add(new Ciudad { Nombre = " Linz " }); lista.Add(new Ciudad { Nombre = " Arnhem " }); lista.Add(new Ciudad { Nombre = " Ginebra " }); lista.Add(new Ciudad { Nombre = " Sofía " }); lista.Add(new Ciudad { Nombre = " Medellín " }); lista.Add(new Ciudad { Nombre = " Oporto " }); lista.Add(new Ciudad { Nombre = " San Juan " }); lista.Add(new Ciudad { Nombre = " Kumamoto " }); lista.Add(new Ciudad { Nombre = " Madison " }); lista.Add(new Ciudad { Nombre = " Saarbrucken " }); lista.Add(new Ciudad { Nombre = " Zhuhai " }); lista.Add(new Ciudad { Nombre = " Daejeon " }); lista.Add(new Ciudad { Nombre = " Greensboro " }); lista.Add(new Ciudad { Nombre = " Little Rock " }); lista.Add(new Ciudad { Nombre = " Syracuse " }); lista.Add(new Ciudad { Nombre = " Recife " }); lista.Add(new Ciudad { Nombre = " Haifa " }); lista.Add(new Ciudad { Nombre = " Burdeos " }); lista.Add(new Ciudad { Nombre = " Hyderabad " }); lista.Add(new Ciudad { Nombre = " Gotemburgo " }); lista.Add(new Ciudad { Nombre = " Albuquerque " }); lista.Add(new Ciudad { Nombre = " Sheffield " }); lista.Add(new Ciudad { Nombre = " Daejeon " }); lista.Add(new Ciudad { Nombre = " Leipzig " }); lista.Add(new Ciudad { Nombre = " Des Moines " }); lista.Add(new Ciudad { Nombre = " Shantou " }); lista.Add(new Ciudad { Nombre = " Bilbao " }); lista.Add(new Ciudad { Nombre = " Salvador " }); lista.Add(new Ciudad { Nombre = " Hsinchu " }); lista.Add(new Ciudad { Nombre = " Knoxville " }); lista.Add(new Ciudad { Nombre = " Puebla de Zarago" }); lista.Add(new Ciudad { Nombre = " George Town " }); lista.Add(new Ciudad { Nombre = " Casablanca " }); lista.Add(new Ciudad { Nombre = " Dayton " }); lista.Add(new Ciudad { Nombre = " Allentown " }); lista.Add(new Ciudad { Nombre = " Estrasburgo " }); lista.Add(new Ciudad { Nombre = " Izmir " }); lista.Add(new Ciudad { Nombre = " Durham " }); lista.Add(new Ciudad { Nombre = " Gwangju " }); lista.Add(new Ciudad { Nombre = " Bolonia " }); lista.Add(new Ciudad { Nombre = " Cardiff " }); lista.Add(new Ciudad { Nombre = " Sevilla " }); lista.Add(new Ciudad { Nombre = " Vitória " }); lista.Add(new Ciudad { Nombre = " Greenville " }); lista.Add(new Ciudad { Nombre = " Fortaleza " }); lista.Add(new Ciudad { Nombre = " Harrisburg " }); lista.Add(new Ciudad { Nombre = " Kagoshima " }); lista.Add(new Ciudad { Nombre = " Quebec " }); lista.Add(new Ciudad { Nombre = " Cracovia " }); lista.Add(new Ciudad { Nombre = " Akron " }); lista.Add(new Ciudad { Nombre = " Springfield " }); lista.Add(new Ciudad { Nombre = " El Paso " }); lista.Add(new Ciudad { Nombre = " Edimburgo " }); lista.Add(new Ciudad { Nombre = " Winnipeg " }); lista.Add(new Ciudad { Nombre = " Alejandría " }); lista.Add(new Ciudad { Nombre = " Nantes " }); foreach (var item in lista) { item.FechaAlta = DateTime.Now; context.Ciudad.Add(item); } context.SaveChanges(); } }