예제 #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();
            }
        }
예제 #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);
        }
예제 #3
0
 public static void EditarEditorial(Editorial e, int indice)
 {
     Editorial.listaEditoriales[indice] = e;
 }
예제 #4
0
 public static void EliminarEditorial(Editorial e)
 {
     listaEditoriales.Remove(e);
 }
예제 #5
0
 public static void AgregarEditorial(Editorial e)
 {
     listaEditoriales.Add(e);
 }