Example #1
0
        public static void EliminarEditorial(Editorial e)
        {
            using (SqlConnection con = new SqlConnection(SqlServer.CADENA_CONEXION))

            {
                con.Open();
                string SENTENCIA_SQL = "delete from Editorial where Id = @Id";

                SqlCommand   cmd = new SqlCommand(SENTENCIA_SQL, con);
                SqlParameter p5  = new SqlParameter("@id", e.id);
                p5.SqlDbType = SqlDbType.Int;
                cmd.Parameters.Add(p5);

                cmd.ExecuteNonQuery();
            }
        }
Example #2
0
        public static Editorial ObtenerEditoriales(int id)
        {
            Editorial editorial = null;

            if (listaEditoriales.Count == 0)
            {
                Editorial.ObtenerEditoriales();
            }

            foreach (Editorial e in listaEditoriales)
            {
                if (e.id == id)
                {
                    editorial = e;
                    break;
                }
            }

            return(editorial);
        }
 public static void EditarEditorial(Editorial e, int indice)
 {
     Editorial.listaEditoriales[indice] = e;
 }
 public static void EliminarEditorial(Editorial e)
 {
     listaEditoriales.Remove(e);
 }
 public static void AgregarEditorial(Editorial e)
 {
     listaEditoriales.Add(e);
 }