protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { // intentamos seleccionar la compañia que el usuario selecciona en la lista ... if (!User.Identity.IsAuthenticated) { FormsAuthentication.SignOut(); return; } string usuario = User.Identity.Name; int? pk = Convert.ToInt32(GridView1.SelectedDataKey.Value.ToString()); if (pk != null) { dbContabUsersEntities context = new dbContabUsersEntities(); var query = context.tCiaSeleccionadas.Where(s => s.UsuarioLS == usuario); foreach (tCiaSeleccionada s in query) { context.tCiaSeleccionadas.DeleteObject(s); } Compania compania = context.Companias.Where(c => c.Numero == pk.Value).FirstOrDefault(); if (compania == null) { string errorMessage = "Error inesperado: no hemos podido encontrar la compañía en la tabla Compañías."; CustomValidator1.IsValid = false; CustomValidator1.ErrorMessage = errorMessage; return; } tCiaSeleccionada ciaSeleccionada = new tCiaSeleccionada() { CiaSeleccionada = compania.Numero, Nombre = compania.Nombre, NombreCorto = compania.NombreCorto, UsuarioLS = usuario, Usuario = 0 }; context.tCiaSeleccionadas.AddObject(ciaSeleccionada); try { context.SaveChanges(); this.nombreCompaniaSeleccionada_literal.Text = compania.Nombre; } catch (Exception ex) { string errorMessage = ex.Message; if (ex.InnerException != null) { errorMessage += "<br /><br />" + ex.InnerException.Message; } CustomValidator1.IsValid = false; CustomValidator1.ErrorMessage = errorMessage; return; } finally { context = null; } } }
public void EliminarCompania(Compania C) { Persistencia.FabricaPersistencia.getPersistenciaCompanias().EliminarCompania(C); }
public void ModificarCompania(Compania C) { Persistencia.FabricaPersistencia.getPersistenciaCompanias().ModificarCompania(C); }
public BO_Ticket GetDetalles(ref string Linea, int iLinea, List <Compania> lstCompanias) { BO_Ticket oBO_Detalle = null; try { Compania oCompaniaActual = null; string[] Columnas = Linea.Split(new char[] { ',', ';' }); oBO_Detalle = new BO_Ticket(); oBO_Detalle.IATA = Convert.ToInt64(GetColumn(Columnas, 0, true)); oBO_Detalle.Billete = Convert.ToInt64(GetColumn(Columnas, 1, true)); DateTime dtFecha; string strFecha = GetColumn(Columnas, 2, false); /*if (!DateTime.TryParse(strFecha, out dtFecha)) * dtFecha = new DateTime(DateTime.Today.Year, strFecha.Substring(strFecha.IndexOf("-") + 1) * oBO_Detalle.Fecha = dtFecha;*/ if (DateTime.TryParse(strFecha, out dtFecha)) { oBO_Detalle.Fecha = dtFecha; } oBO_Detalle.Void = GetColumn(Columnas, 3, false) == "1"; string CompaniaCod = GetColumn(Columnas, 4, false); oCompaniaActual = lstCompanias.Find(x => x.Codigo == CompaniaCod); if (oCompaniaActual != null) { oBO_Detalle.Compania = oCompaniaActual; } else { oBO_Detalle.Compania = new Compania { Codigo = CompaniaCod } }; oBO_Detalle.Tarifa = Convert.ToDecimal(GetColumn(Columnas, 5, true), culture); oBO_Detalle.TarContado = Convert.ToDecimal(GetColumn(Columnas, 6, true), culture); oBO_Detalle.TarCredito = Convert.ToDecimal(GetColumn(Columnas, 7, true), culture); oBO_Detalle.Impuestos = Convert.ToDecimal(GetColumn(Columnas, 8, true), culture); //oBO_Detalle.IVA21 = Convert.ToDecimal(GetColumn(Columnas, 9), culture); oBO_Detalle.Comision = Convert.ToDecimal(GetColumn(Columnas, 10, true), culture); oBO_Detalle.Total = Convert.ToDecimal(GetColumn(Columnas, 11, true), culture); //oBO_Detalle.Final = Convert.ToDecimal(GetColumn(Columnas, 12), culture); oBO_Detalle.ComOver = Convert.ToDecimal(GetColumn(Columnas, 13, true), culture); oBO_Detalle.Expediente = GetColumn(Columnas, 14, true); oBO_Detalle.IVA105 = Convert.ToDecimal(GetColumn(Columnas, 15, true), culture); oBO_Detalle.IVAComision = Convert.ToDecimal(GetColumn(Columnas, 16, true), culture); oBO_Detalle.ComValor = Convert.ToDecimal(GetColumn(Columnas, 17, true), culture); oBO_Detalle.Factura = GetColumn(Columnas, 18, true); oBO_Detalle.Pasajero = GetColumn(Columnas, 19, false); oBO_Detalle.Vendedor = GetColumn(Columnas, 20, false); oBO_Detalle.Moneda = Moneda.Peso; } catch (Exception ex) { TextToFile.Errores(TextToFile.Error(ex)); } return(oBO_Detalle); }
public void ModificarCompania(Compania unaCompania) { FabricaPersistencia.getPersistenciaCompania().ModificarCompania(unaCompania); }
//validaciones private void txtNombreC_Validating(object sender, CancelEventArgs e) { try { _ErrorProvider.Clear(); if (string.IsNullOrEmpty(txtNombreC.Text.Trim())) { throw new Exception("El campo Nombre esta vacio."); } if (txtNombreC.Text.Any(char.IsNumber)) { throw new Exception("La Compania no puede contener numeros."); } if (txtNombreC.Text.Trim().Length > 50) { throw new Exception("El nombre no debe exceder los 50 caracteres."); } Compania _compa = new ServicioTerminal().BuscarCompaniaActiva(txtNombreC.Text.Trim()); if (_compa != null) { unaComp = _compa; txtDireccion.Text = _compa.Direccion; txtTelefono.Text = _compa.Telefono.ToString(); lblError.Text = "Compania " + _compa.Nombre.Trim() + " fue encontrada."; EstadoBM(); } else { lblError.Text = "No se ha encontrado la compania " + txtNombreC.Text + ", si lo desea puede agregarla."; EstadoAgregar(); } } catch (System.Web.Services.Protocols.SoapException ex) { if (ex.Detail.InnerText == "") { if (ex.Message.Length > 263) { lblError.Text = ex.Message.Substring(183, 80); } else if (ex.Message.Length > 80) { lblError.Text = ex.Message.Substring(ex.Message.Length - 80, 80); } else { lblError.Text = ex.Message; } } else { if (ex.Detail.InnerText.Length > 80) { lblError.Text = ex.Detail.InnerText.Substring(0, 80); } else { lblError.Text = ex.Detail.InnerText; } } } catch (Exception ex) { _ErrorProvider.SetError(txtNombreC, ex.Message); if (ex.Message.Length > 80) { lblError.Text = ex.Message.Substring(0, 80); } else { lblError.Text = ex.Message; } } }
public void SaveCompania(Compania compania) { dao.SaveCompania(compania); }
public void InsertarCompania(Compania compania) { _db.Insert(compania); }
public bool ObtenerNumeroAsientoContab(DateTime fechaAsiento, int ciaContab, string tipoAsiento, out short numeroAsientoContab, out string errorMessage) { // esta función determina y regresa un número de asiento Contab. Nótese que el número determinado // depende de si se genera por grupos de tipo o no. Esto lo determina un flag en ParametrosContab: // NumeracionAsientosSeparadaFlag. // nótese como, lamentablemente, tenemos que crear aquí un nuevo context, pues vamos a actualizar AsientosID // cada vez que ejecutemos la función; esto evitará que se generen números duplicados si otros usuarios // graban asientos contables en forma simultanea a la ejecución de esta función ... dbContab_Contab_Entities context = new dbContab_Contab_Entities(); errorMessage = ""; numeroAsientoContab = 0; short nMesCalendario = (short)fechaAsiento.Month; short nAnoCalendario = (short)fechaAsiento.Year; Compania companiaContab = context.Companias.Where(c => c.Numero == ciaContab).FirstOrDefault(); if (companiaContab == null) { errorMessage = " ... error inesperado: no pudimos leer la compañía Contab asociada al " + "asiento contable."; return(false); } if (companiaContab.ParametrosContab == null) { errorMessage = " ... error inesperado: no pudimos leer los parámetros de la compañía Contab " + "en la tabla Parametros Contab."; return(false); } // lo primero que hacemos es determinar si el número se genera de acuerdo al tipo bool?bNumeracionSeparadaPorTipo = companiaContab.ParametrosContab.NumeracionAsientosSeparadaFlag; if (bNumeracionSeparadaPorTipo == null) { errorMessage = "Error: aparentemente, no se ha definido si la numeración de los asientos es o " + "no separada de acuerdo a su tipo.<br /><br />" + "Por favor abra la tabla 'Parámetros' en Contab y defina un valor para este item."; return(false); } if (!bNumeracionSeparadaPorTipo.Value) { // la númeración NO ES separada de acuerdo al tipo del asiento. La determinación del número // es más simple // leemos el número del asiento de la tabla AsientosId AsientosId MyAsientosId = context.AsientosIds.Where(a => a.Mes == nMesCalendario && a.Ano == nAnoCalendario && a.Cia == ciaContab).FirstOrDefault(); if (MyAsientosId == null) { // no existe un registro en la tabla para el mes, año y cia. Lo creamos y asumimos 1 // como número numeroAsientoContab = 1; AsientosId MyAsientosId_Nuevo = new AsientosId(); MyAsientosId_Nuevo.Mes = Convert.ToInt16(nMesCalendario); MyAsientosId_Nuevo.Ano = Convert.ToInt16(nAnoCalendario); MyAsientosId_Nuevo.Cia = ciaContab; MyAsientosId_Nuevo.Numero = 2; context.AsientosIds.AddObject(MyAsientosId_Nuevo); } else { numeroAsientoContab = (short)MyAsientosId.Numero; MyAsientosId.Numero += 1; } } else { // leemos el grupo de la tabla TiposDeAsiento // leemos el número del asiento de la tabla AsientosIdPorGrupo TiposDeAsiento tipoAsientoContable = (from t in context.TiposDeAsientoes where t.Tipo == tipoAsiento select t).FirstOrDefault(); if (tipoAsientoContable.tGruposDeTiposDeAsiento == null) { errorMessage = "Error: aparentemente, no se ha definido el Grupo que corresponde al tipo " + "de asientos que Ud. ha indicado para el asiento contable.<br /><br />" + "Como la numeración de los asientos contables es separada de acuerdo a su tipo " + "(según está ahora definido en el sistema Contab), cada tipo debe corresponder " + "a un grupo.<br /><br />" + "Por favor abra la tabla Tipos de Asiento en Contab y " + "defina un valor para este item."; return(false); } AsientosIdPorGrupo MyAsientosIdPorGrupo = (from aidg in context.AsientosIdPorGrupoes where aidg.Mes == nMesCalendario && aidg.Ano == nAnoCalendario && aidg.Grupo == tipoAsientoContable.tGruposDeTiposDeAsiento.Grupo && aidg.Cia == ciaContab select aidg).SingleOrDefault(); if (MyAsientosIdPorGrupo == null) { // no existe un registro en la tabla para el mes, año y cia. Buscamos el número INICIAL // en la tabla tGruposDeTiposDeAsiento var MyGrupoTipoAsiento = (from g in context.tGruposDeTiposDeAsientoes where g.Grupo == tipoAsientoContable.tGruposDeTiposDeAsiento.Grupo select g).FirstOrDefault(); if (MyGrupoTipoAsiento == null || MyGrupoTipoAsiento.NumeroInicial == null) { errorMessage = "Error: aparentemente, no se ha definido el Grupo que corresponde al " + "tipo de asientos que Ud. ha indicado para el asiento contable.<br /><br />" + "Como la numeración de los asientos contables es separada de acuerdo a su tipo " + "(según está ahora definido en el sistema Contab), cada tipo debe " + "corresponder a un grupo.<br /><br />" + "Por favor abra la tabla Tipos de Asiento en Contab y " + "defina un valor para este item;<br /><br />" + "o, abra la tabla Grupos de Tipos de Asiento y defina un grupo y un " + "número de inicio para este grupo."; return(false); } numeroAsientoContab = (short)MyGrupoTipoAsiento.NumeroInicial; // nótese como usamos un nuevo context, para no interferir con la operación que llama este // método (ie: Inserting) AsientosIdPorGrupo MyAsientosIdPorGrupo_Nuevo = new AsientosIdPorGrupo(); MyAsientosIdPorGrupo_Nuevo.Mes = Convert.ToInt16(nMesCalendario); MyAsientosIdPorGrupo_Nuevo.Ano = Convert.ToInt16(nAnoCalendario); MyAsientosIdPorGrupo_Nuevo.Grupo = tipoAsientoContable.tGruposDeTiposDeAsiento.Grupo; MyAsientosIdPorGrupo_Nuevo.Cia = ciaContab; MyAsientosIdPorGrupo_Nuevo.Numero = MyGrupoTipoAsiento.NumeroInicial + 1; context.AsientosIdPorGrupoes.AddObject(MyAsientosIdPorGrupo); } else { numeroAsientoContab = (short)MyAsientosIdPorGrupo.Numero.Value; MyAsientosIdPorGrupo.Numero += 1; } } try { context.SaveChanges(); } catch (Exception ex) { errorMessage = "Error: hemos obtenido un error al intentar efectuar una operación en la " + "base de datos.<br /><br />" + "El mensaje específico de error es: <br /><br />" + ex.Message; if (ex.InnerException != null) { errorMessage += ex.InnerException.Message; } context = null; return(false); } context = null; return(true); }
public void Eliminar(Compania pComp) { FabricaPersistencia.GetPersistenciaCompania().Eliminar(pComp); }
public void ActualizarCompania(Compania compania) { _db.Update(compania); }
public void Modificar(Compania pComp) { FabricaPersistencia.GetPersistenciaCompania().Modificar(pComp); }
public void Agregar(Compania pComp) { FabricaPersistencia.GetPersistenciaCompania().Agregar(pComp); }
public void EliminarCompania(Compania unaCompania) { FabricaPersistencia.getPersistenciaCompania().EliminarCompania(unaCompania); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { ddlDestinos.DataTextField = "Ciudad"; ddlDestinos.DataValueField = "Cod"; ddlCompania.DataTextField = "Nombre"; ddlCompania.DataValueField = "Nombre"; List <Destino> destinos = new List <Destino>(); List <Facilidades> f = new List <Facilidades>(); Destino d = new Destino(); d.Cod = "Nin"; d.Ciudad = "Ninguno"; d.Pais = "Uruguay"; d.LasFacilidades = f.ToArray(); destinos.Add(d); destinos.AddRange(new ServicioTerminal().ListarDestinos()); ddlDestinos.DataSource = destinos; ddlDestinos.DataBind(); List <Compania> companias = new List <Compania>(); Compania c = new Compania(); c.Nombre = "Ninguna"; c.Direccion = "Ninguna"; c.Telefono = 1; companias.Add(c); companias.AddRange(new ServicioTerminal().ListarCompanias()); ddlCompania.DataSource = companias; ddlCompania.DataBind(); if (Session["IndiceComp"] != null && Session["IndiceDes"] != null && Session["ListadoViajes"] != null && Session["FechaDesde"] != null && Session["FechaHasta"] != null && Session["UltimoFiltro"] != null) { if ((int)Session["IndiceComp"] != 0 || (int)Session["IndiceDes"] != 0) { ddlCompania.SelectedIndex = (int)Session["IndiceComp"]; ddlDestinos.SelectedIndex = (int)Session["IndiceDes"]; calDesde.Activo(true); calHasta.Activo(true); calDesde.Fecha = (DateTime)Session["FechaDesde"]; calHasta.Fecha = (DateTime)Session["FechaHasta"]; RTViajes.DataSource = (List <Viaje>)Session["UltimoFiltro"]; RTViajes.DataBind(); } } else { List <Viaje> viajes = ViajesSinPartir(); RTViajes.DataSource = viajes; RTViajes.DataBind(); } } } catch (System.Web.Services.Protocols.SoapException ex) { if (ex.Detail.InnerText == "") { if (ex.Message.Length > 263) { lblError.Text = ex.Message.Substring(183, 80); } else if (ex.Message.Length > 80) { lblError.Text = ex.Message.Substring(ex.Message.Length - 80, 80); } else { lblError.Text = ex.Message; } } else { if (ex.Detail.InnerText.Length > 80) { lblError.Text = ex.Detail.InnerText.Substring(0, 80); } else { lblError.Text = ex.Detail.InnerText; } } } catch (Exception ex) { lblError.Text = ex.Message; } }
public void UpdateCompania(Guid companiaId, Compania compania) { }
public async Task Actualizar(Compania Compania) { _context.Entry(Compania).State = EntityState.Modified; await _context.SaveChangesAsync(); }
public static CompaniaVo objectToVo(Compania obj) { return(new CompaniaVo { }); }
public void DeleteCompania(Compania compania) { dao.DeleteCompania(compania); }
public static void Initialize(ApplicationDbContext context) { context.Database.EnsureCreated(); if (context.Year.Any() || context.Programa.Any() || context.Componente.Any() || context.Instancia_Ejecutora.Any() || context.Delegacion.Any() || context.Nacionalidad.Any() || context.Tipo_Documento.Any() || context.Genero.Any() || context.Estado_Civil.Any() || context.Tipo_Identidad.Any() || context.Municipio.Any() || context.Tipo_Persona.Any() || context.Etnia.Any() || context.Discapacidad.Any() || context.Tipo_Ambito.Any() || context.Tipo_Asentamiento.Any() || context.Tipo_Vialidad.Any() || context.Tipo_Proyecto.Any() || context.Concepto_Apoyo.Any() || context.Subconcepto_Apoyo.Any() ) { return; } //Concepto_Apoyo var concepto_apoyo = new Concepto_Apoyo[] { new Concepto_Apoyo { nombre = "Concepto 1" }, new Concepto_Apoyo { nombre = "Concepto 2" }, }; foreach (Concepto_Apoyo g in concepto_apoyo) { context.Concepto_Apoyo.Add(g); } //Subconceptopoyo var subconcepto_apoyo = new Subconcepto_Apoyo[] { new Subconcepto_Apoyo { nombre = "SubConcepto 1" }, new Subconcepto_Apoyo { nombre = "SubConcepto 2" }, }; foreach (Subconcepto_Apoyo g in subconcepto_apoyo) { context.Subconcepto_Apoyo.Add(g); } //YEAR var tipo_proyecto = new Tipo_Proyecto[] { new Tipo_Proyecto { Nombre = "Social" }, new Tipo_Proyecto { Nombre = "Privado" }, }; foreach (Tipo_Proyecto g in tipo_proyecto) { context.Tipo_Proyecto.Add(g); } //YEAR var year = new Year[] { new Year { year = 2020 }, }; foreach (Year g in year) { context.Year.Add(g); } //PROGRAMA var programa = new Programa[] { new Programa { nombre = "prestamos para tractor" }, new Programa { nombre = "prestamos para terreno" }, new Programa { nombre = "prestamos para comida" }, new Programa { nombre = "prestamos para carros" }, new Programa { nombre = "prestamos para huertas" }, new Programa { nombre = "prestamos para casas" }, }; foreach (Programa g in programa) { context.Programa.Add(g); } //COMPONENTE var componente = new Componente[] { new Componente { nombre = "Componente 1" }, new Componente { nombre = "Componente 2" }, new Componente { nombre = "Componente 3" }, new Componente { nombre = "Componente 4" }, new Componente { nombre = "Componente 5" }, new Componente { nombre = "Componente 6" }, }; foreach (Componente g in componente) { context.Componente.Add(g); } //INSTANCIA EJECUTORA var instancia = new Instancia_Ejecutora[] { new Instancia_Ejecutora { nombre = "Instancia 1" }, new Instancia_Ejecutora { nombre = "Instancia 2" }, new Instancia_Ejecutora { nombre = "Instancia 3" }, }; foreach (Instancia_Ejecutora g in instancia) { context.Instancia_Ejecutora.Add(g); } //DELEGACION var delegacion = new Delegacion[] { new Delegacion { nombre = "Delegacion 1" }, new Delegacion { nombre = "Delegacion 2" }, new Delegacion { nombre = "Delegacion 3" }, }; foreach (Delegacion g in delegacion) { context.Delegacion.Add(g); } //COMPANIA var compania = new Compania[] { new Compania { nombre_compania = "TELCEL" }, new Compania { nombre_compania = "IUSACELL" }, new Compania { nombre_compania = "MOVISTAR" }, new Compania { nombre_compania = "NEXTEL" }, new Compania { nombre_compania = "UNEFON" }, new Compania { nombre_compania = "AT&T" }, new Compania { nombre_compania = "ALO SIEMPRE CERCA" }, new Compania { nombre_compania = "MAZ TIEMPO" }, new Compania { nombre_compania = "QBOCEL" }, new Compania { nombre_compania = "VIRGIN MOBILE" }, new Compania { nombre_compania = "ALESTRA" }, new Compania { nombre_compania = "AXTEL" }, new Compania { nombre_compania = "MAXCOM" }, new Compania { nombre_compania = "MEGACABLE" }, new Compania { nombre_compania = "IZZI" }, new Compania { nombre_compania = "TELMEX" }, new Compania { nombre_compania = "TELNOR" } }; foreach (Compania g in compania) { context.Compania.Add(g); } //TUIPO_TELEFONO var tipo_telefono = new Tipo_Telefono[] { new Tipo_Telefono { nombre_tipo = "FIJO" }, new Tipo_Telefono { nombre_tipo = "MOVIL" } }; foreach (Tipo_Telefono g in tipo_telefono) { context.Tipo_Telefono.Add(g); } //GENEROS var generos = new Genero[] { new Genero { Nombre_Genero = "MASCULINO" }, new Genero { Nombre_Genero = "FEMENINO" }, new Genero { Nombre_Genero = "MORAL" }, }; foreach (Genero g in generos) { context.Genero.Add(g); } //ESTADO CIVIL var civil = new Estado_Civil[] { new Estado_Civil { Nombre_Edo_Civil = "SOLTERO" }, new Estado_Civil { Nombre_Edo_Civil = "CASADO" }, new Estado_Civil { Nombre_Edo_Civil = "DIVORCIADO" }, new Estado_Civil { Nombre_Edo_Civil = "VIUDO/A" }, new Estado_Civil { Nombre_Edo_Civil = "UNION LIBRE" }, new Estado_Civil { Nombre_Edo_Civil = "CONCUBINATO" }, new Estado_Civil { Nombre_Edo_Civil = "MORAL" }, }; foreach (Estado_Civil g in civil) { context.Estado_Civil.Add(g); } //TIPO DE IDENTIDAD var tipo_identidad = new Tipo_Identidad[] { new Tipo_Identidad { Nombre = "CARTILLA DEL SERVICIO MILITAR" }, new Tipo_Identidad { Nombre = "LICENCIA DE MANEJO" }, new Tipo_Identidad { Nombre = "PASAPORTE" }, new Tipo_Identidad { Nombre = "CREDENCIAL PARA VOTAR CON FOTOGRAFIA" }, new Tipo_Identidad { Nombre = "CREDENCIAL DEL IMSS O DEL ISSSTE" }, new Tipo_Identidad { Nombre = "CONSTANCIA EXP. POR AUTORIDAD LEGAL CON FOTOGRAFIA" }, new Tipo_Identidad { Nombre = "CEDULA PROFESIONAL" }, new Tipo_Identidad { Nombre = "CREDENCIAL DEL INSTITUTO NACIONAL DE LA SENECTUD" }, new Tipo_Identidad { Nombre = "ACTA DE NACIMIENTO" }, new Tipo_Identidad { Nombre = "CREDENCIAL O ACTA DE NATURALIZACION EXP. POR SEC. DE REL. EXTERIORES" }, new Tipo_Identidad { Nombre = "TARJETA PROCAMPO" }, new Tipo_Identidad { Nombre = "TARJETA SAGARPA/CURP" }, new Tipo_Identidad { Nombre = "LIBRETA DE MAR O NAVEGACION CON FOTOGRAFIA EXP. POR LA SCT" }, new Tipo_Identidad { Nombre = "CREDENCIAL DE PESCA" }, new Tipo_Identidad { Nombre = "CURP" }, new Tipo_Identidad { Nombre = "INE ESTATAL" }, new Tipo_Identidad { Nombre = "INSTITUTO NACIONAL DE LAS PERSONAS ADULTAS Y MAYORES (INAPAM)" }, new Tipo_Identidad { Nombre = "CREDENCIAL DEL SERVICIO POSTAL MEXICANO" }, new Tipo_Identidad { Nombre = "MATRICULA CONSULAR" }, new Tipo_Identidad { Nombre = "MORAL" } }; foreach (Tipo_Identidad g in tipo_identidad) { context.Tipo_Identidad.Add(g); } //MUNICIPIO /* * var municipio = new Municipio[] * { * new Municipio {Nombre = "Armería"}, * new Municipio {Nombre = "Tecomán"}, * new Municipio {Nombre = "Manzanillo"}, * new Municipio {Nombre = "Coquimatlán"}, * new Municipio {Nombre = "Colima"}, * new Municipio {Nombre = "Cuahutémoc"}, * new Municipio {Nombre = "Comala"}, * new Municipio {Nombre = "Ixtlahuacán"}, * new Municipio {Nombre = "Minatitlán"}, * new Municipio {Nombre = "Villa de Álvarez"}, * }; * * foreach (Municipio g in municipio) * { * context.Municipio.Add(g); * } */ //Tipo de persona var tipo_persona = new Tipo_Persona[] { new Tipo_Persona { Nombre_Tipo = "FISICA" }, new Tipo_Persona { Nombre_Tipo = "MORAL" } }; foreach (Tipo_Persona g in tipo_persona) { context.Tipo_Persona.Add(g); } //Tipo de Etnia var tipo_etnia = new Etnia[] { new Etnia { Pertenece_Etnia = "Si" }, new Etnia { Pertenece_Etnia = "No" }, new Etnia { Pertenece_Etnia = "MORAL" }, }; foreach (Etnia g in tipo_etnia) { context.Etnia.Add(g); } //Discapacidad var discapacidad = new Discapacidad[] { new Discapacidad { Tiene_Discapacidad = "Si" }, new Discapacidad { Tiene_Discapacidad = "No" }, new Discapacidad { Tiene_Discapacidad = "MORAL" }, }; foreach (Discapacidad g in discapacidad) { context.Discapacidad.Add(g); } //tipo ambito var tipo_ambito = new Tipo_Ambito[] { new Tipo_Ambito { Nombre = "AMBITO URBANO" }, new Tipo_Ambito { Nombre = "AMBITO RURAL" }, new Tipo_Ambito { Nombre = "SOBRE VIA DE COMUNICACION" }, new Tipo_Ambito { Nombre = "NO DEFINIDO" }, }; foreach (Tipo_Ambito g in tipo_ambito) { context.Tipo_Ambito.Add(g); } //tipo asentamiento var tipo_asentamiento = new Tipo_Asentamiento[] { new Tipo_Asentamiento { Nombre = "AEROPUERTO" }, new Tipo_Asentamiento { Nombre = "AMPLIACION" }, new Tipo_Asentamiento { Nombre = "BARRIO" }, new Tipo_Asentamiento { Nombre = "CAMPAMENTO" }, new Tipo_Asentamiento { Nombre = "CANTON" }, new Tipo_Asentamiento { Nombre = "CIUDAD" }, new Tipo_Asentamiento { Nombre = "CIUDAD INDUSTRIAL" }, new Tipo_Asentamiento { Nombre = "CLUB DE GOLF" }, new Tipo_Asentamiento { Nombre = "COLONIA" }, new Tipo_Asentamiento { Nombre = "CONDOMINIO" }, new Tipo_Asentamiento { Nombre = "CONGREGACION" }, new Tipo_Asentamiento { Nombre = "CONJUNTO HABITACIONAL" }, new Tipo_Asentamiento { Nombre = "CORREDOR INDUSTRIAL" }, new Tipo_Asentamiento { Nombre = "COTO" }, new Tipo_Asentamiento { Nombre = "CUARTEL" }, new Tipo_Asentamiento { Nombre = "EJIDO" }, new Tipo_Asentamiento { Nombre = "EQUIPAMIENTO" }, new Tipo_Asentamiento { Nombre = "ESTACION" }, new Tipo_Asentamiento { Nombre = "EXHACIENDA" }, new Tipo_Asentamiento { Nombre = "FINCA" }, new Tipo_Asentamiento { Nombre = "FRACCION" }, new Tipo_Asentamiento { Nombre = "FRACCIONAMIENTO" }, new Tipo_Asentamiento { Nombre = "GRAN USUARIO" }, new Tipo_Asentamiento { Nombre = "GRANJA" }, new Tipo_Asentamiento { Nombre = "HACIENDA" }, new Tipo_Asentamiento { Nombre = "INGENIO" }, new Tipo_Asentamiento { Nombre = "MANZANA" }, new Tipo_Asentamiento { Nombre = "PARAJE" }, new Tipo_Asentamiento { Nombre = "PARQUE INDUSTRIAL" }, new Tipo_Asentamiento { Nombre = "POBLADO COMUNAL" }, new Tipo_Asentamiento { Nombre = "PRIVADA" }, new Tipo_Asentamiento { Nombre = "PROLONGACION" }, new Tipo_Asentamiento { Nombre = "PUEBLO" }, new Tipo_Asentamiento { Nombre = "PUERTO" }, new Tipo_Asentamiento { Nombre = "RANCHERIA" }, new Tipo_Asentamiento { Nombre = "RANCHO" }, new Tipo_Asentamiento { Nombre = "REGION" }, new Tipo_Asentamiento { Nombre = "RESIDENCIAL" }, new Tipo_Asentamiento { Nombre = "RINCONADA" }, new Tipo_Asentamiento { Nombre = "SECCION" }, new Tipo_Asentamiento { Nombre = "SECTOR" }, new Tipo_Asentamiento { Nombre = "SUPERMANZANA" }, new Tipo_Asentamiento { Nombre = "UNIDAD" }, new Tipo_Asentamiento { Nombre = "UNIDAD HABITACIONAL" }, new Tipo_Asentamiento { Nombre = "VILLA" }, new Tipo_Asentamiento { Nombre = "ZONA COMERCIAL" }, new Tipo_Asentamiento { Nombre = "ZONA FEDERAL" }, new Tipo_Asentamiento { Nombre = "ZONA INDUSTRIAL" }, new Tipo_Asentamiento { Nombre = "ZONA MILITAR" }, new Tipo_Asentamiento { Nombre = "ZONA NAVAL" }, }; foreach (Tipo_Asentamiento g in tipo_asentamiento) { context.Tipo_Asentamiento.Add(g); } //tipo vialid var tipo_vialidad = new Tipo_Vialidad[] { new Tipo_Vialidad { Nombre = "AMPLIACION" }, new Tipo_Vialidad { Nombre = "ANDADOR" }, new Tipo_Vialidad { Nombre = "AVENIDA" }, new Tipo_Vialidad { Nombre = "BOULEVARD" }, new Tipo_Vialidad { Nombre = "CALLE" }, new Tipo_Vialidad { Nombre = "CALLEJON" }, new Tipo_Vialidad { Nombre = "CALZADA" }, new Tipo_Vialidad { Nombre = "CERRADA" }, new Tipo_Vialidad { Nombre = "CIRCUITO" }, new Tipo_Vialidad { Nombre = "CIRCUNVALACION" }, new Tipo_Vialidad { Nombre = "CONTINUACION" }, new Tipo_Vialidad { Nombre = "CORREDOR" }, new Tipo_Vialidad { Nombre = "DIAGONAL" }, new Tipo_Vialidad { Nombre = "EJE VIAL" }, new Tipo_Vialidad { Nombre = "PASAJE" }, new Tipo_Vialidad { Nombre = "PEATONAL" }, new Tipo_Vialidad { Nombre = "PERIFERICO" }, new Tipo_Vialidad { Nombre = "PRIVADA" }, new Tipo_Vialidad { Nombre = "PROLONGACION" }, new Tipo_Vialidad { Nombre = "RETORNO" }, new Tipo_Vialidad { Nombre = "VIADUCTO" }, new Tipo_Vialidad { Nombre = "CARRETERA" }, new Tipo_Vialidad { Nombre = "CAMINO" } }; foreach (Tipo_Vialidad g in tipo_vialidad) { context.Tipo_Vialidad.Add(g); } //Nacionalidad var nacionalidad = new Nacionalidad[] { new Nacionalidad { Nombre = "MEXICANO" }, new Nacionalidad { Nombre = "EXTRANJERA" }, new Nacionalidad { Nombre = "MORAL" } }; foreach (Nacionalidad g in nacionalidad) { context.Nacionalidad.Add(g); } //Tipo de documento var tipoDocumento = new Tipo_Documento[] { new Tipo_Documento { nombre = "ACTA CONSTITUTIVA" }, new Tipo_Documento { nombre = "ANEXO MODIFICATORIO DE ACTA CONSTITUTIVA" }, new Tipo_Documento { nombre = "OTRO" }, new Tipo_Documento { nombre = "PODER NOTARIAL" }, new Tipo_Documento { nombre = "CARTA PODER SIMPLE" }, new Tipo_Documento { nombre = "CARTA PODER ANTE NOTARIO" }, new Tipo_Documento { nombre = "ACTA DE ASAMBLEA" } }; foreach (Tipo_Documento g in tipoDocumento) { context.Tipo_Documento.Add(g); } context.SaveChanges(); }
public void UpdateCompania(Compania compania) { dao.UpdateCompania(compania); }
//************************************************ //Operaciones public void AgregarCompania(Compania C) { Persistencia.FabricaPersistencia.getPersistenciaCompanias().AgregarCompania(C); }
public Task <bool> DeleteCompaniaAsync(Compania compania) { return(Task.Run(() => { return DeleteCompania(compania); })); }
public void AgregarCompania(Compania unaCompania) { FabricaPersistencia.getPersistenciaCompania().AgregarCompania(unaCompania); }