public static void insertarC(Componente componente) { try { Conexion.abrirConexion(); List <OdbcParameter> lista = new List <OdbcParameter>(); OdbcParameter p1, p2, p3, p4, p5, p6, p7; p1 = new OdbcParameter(); p2 = new OdbcParameter(); p3 = new OdbcParameter(); p4 = new OdbcParameter(); p5 = new OdbcParameter(); p6 = new OdbcParameter(); p7 = new OdbcParameter(); p1.ParameterName = "@codigo"; p1.OdbcType = OdbcType.VarChar; p1.Size = 10; p1.Value = componente.Codigo; lista.Add(p1); p2.ParameterName = "@nombre"; p2.OdbcType = OdbcType.VarChar; p2.Size = 60; p2.Value = componente.Nombre; lista.Add(p2); p3.ParameterName = "@desc"; p3.OdbcType = OdbcType.VarChar; p3.Size = 200; p3.Value = componente.Descripcion; lista.Add(p3); p4.ParameterName = "@codproy"; p4.OdbcType = OdbcType.VarChar; p4.Size = 10; p4.Value = componente.CodProyecto.Codigo; lista.Add(p4); /* * p5.ParameterName = "@codcomp"; * p5.OdbcType = OdbcType.VarChar; * p5.Size = 10; * componente.CodComponente = new Componente(); * p5.Value = default(string);//componente.CodComponente.Codigo; * lista.Add(p5); */ p6.ParameterName = "@idcrono"; p6.OdbcType = OdbcType.Int; p6.Value = componente.IDCronograma.Id; lista.Add(p6); p7.ParameterName = "@idtipomodif"; p7.OdbcType = OdbcType.Int; if (componente.IDTipo_Modif.ID == int.MaxValue) // valor null { p7.Value = DBNull.Value; } else // valor existente { p7.Value = componente.IDTipo_Modif.ID; } lista.Add(p7); Conexion.EjecutarProcedimientoAlmacenado("insertComponente", lista, "Escritura"); } catch (Exception) { return; } finally { Conexion.cerrarConexion(); } }
public static void insertarSC(Componente componente) { try { Conexion.abrirConexion(); List <OdbcParameter> lista = new List <OdbcParameter>(); OdbcParameter p1, p2, p3, p4, p5, p6; p1 = new OdbcParameter(); p2 = new OdbcParameter(); p3 = new OdbcParameter(); p4 = new OdbcParameter(); p5 = new OdbcParameter(); p6 = new OdbcParameter(); p1.ParameterName = "@codigo"; p1.OdbcType = OdbcType.VarChar; p1.Size = 10; p1.Value = componente.Codigo; lista.Add(p1); p2.ParameterName = "@nombre"; p2.OdbcType = OdbcType.VarChar; p2.Size = 60; p2.Value = componente.Nombre; lista.Add(p2); p3.ParameterName = "@desc"; p3.OdbcType = OdbcType.VarChar; p3.Size = 200; p3.Value = componente.Descripcion; lista.Add(p3); p4.ParameterName = "@codproy"; p4.OdbcType = OdbcType.VarChar; p4.Size = 10; p4.Value = componente.CodProyecto.Codigo; lista.Add(p4); p5.ParameterName = "@codcomp"; p5.OdbcType = OdbcType.VarChar; p5.Size = 10; //componente.CodComponente = new Componente(); p5.Value = componente.CodComponente.Codigo;//componente.CodComponente.Codigo; lista.Add(p5); p6.ParameterName = "@idcrono"; p6.OdbcType = OdbcType.Int; p6.Value = componente.IDCronograma.Id; lista.Add(p6); Conexion.EjecutarProcedimientoAlmacenado("insertSubcomponente", lista, "Escritura"); } catch (Exception) { return; } finally { Conexion.cerrarConexion(); } }
public Componente(string codigo, string nombre, string descripcion, Proyecto codProy, Componente codcomponent, Cronograma idcrono, Tipo_Modificacion idtipoModif) { this.Codigo = codigo; this.Nombre = nombre; this.Descripcion = descripcion; this.CodProyecto = codProy; this.CodComponente = codcomponent; this.IDCronograma = idcrono; this.IDTipo_Modif = idtipoModif; }
public Estado_Componente() { CodComponente = new Componente(); IDEstado = new Estado(); }