Esempio n. 1
0
 public static Noticia SelectById(int id)
 {
     NoticiaDSTableAdapters.tbl_noticiasTableAdapter adapter =
         new NoticiaDSTableAdapters.tbl_noticiasTableAdapter();
     NoticiaDS.tbl_noticiasDataTable table = adapter.SelectById(id);
     if (table.Rows.Count == 0)
     {
         return(null);
     }
     return(RowToDto(table[0]));
 }
Esempio n. 2
0
 public static Noticia InsertWithReturn(string titulo, string descripcion, string fecha, int idEvento)
 {
     NoticiaDSTableAdapters.tbl_noticiasTableAdapter adapter =
         new NoticiaDSTableAdapters.tbl_noticiasTableAdapter();
     NoticiaDS.tbl_noticiasDataTable table =
         adapter.InsertWithReturn(titulo, descripcion, Convert.ToDateTime(fecha), 0, idEvento);
     if (table.Rows.Count == 0)
     {
         return(null);
     }
     return(RowToDto(table[0]));
 }
Esempio n. 3
0
    public static List <Noticia> SelectByEvento(string id)
    {
        NoticiaDSTableAdapters.tbl_noticiasTableAdapter adapter =
            new NoticiaDSTableAdapters.tbl_noticiasTableAdapter();
        NoticiaDS.tbl_noticiasDataTable table = adapter.SelectByEvento(Convert.ToInt32(id));
        List <Noticia> listNoticia            = new List <Noticia>();

        foreach (NoticiaDS.tbl_noticiasRow row in table)
        {
            listNoticia.Add(RowToDto(row));
        }
        return(listNoticia);
    }
Esempio n. 4
0
    public static List <Noticia> SelectTop5()
    {
        NoticiaDSTableAdapters.tbl_noticiasTableAdapter adapter =
            new NoticiaDSTableAdapters.tbl_noticiasTableAdapter();
        NoticiaDS.tbl_noticiasDataTable table = adapter.selectTop5();
        List <Noticia> listNoticia            = new List <Noticia>();

        foreach (NoticiaDS.tbl_noticiasRow row in table)
        {
            listNoticia.Add(RowToDto(row));
        }
        return(listNoticia);
    }
Esempio n. 5
0
 public static void DeleteEvento(int id)
 {
     NoticiaDSTableAdapters.tbl_noticiasTableAdapter adapter =
         new NoticiaDSTableAdapters.tbl_noticiasTableAdapter();
     adapter.DeleteAllEvents(id);
 }
Esempio n. 6
0
 public static void Delete(int id)
 {
     NoticiaDSTableAdapters.tbl_noticiasTableAdapter adapter =
         new NoticiaDSTableAdapters.tbl_noticiasTableAdapter();
     adapter.DeleteNoticia(id);
 }
Esempio n. 7
0
 public static void Update(string titulo, string descripcion, string fecha, int id, int idEvento)
 {
     NoticiaDSTableAdapters.tbl_noticiasTableAdapter adapter =
         new NoticiaDSTableAdapters.tbl_noticiasTableAdapter();
     adapter.UpdateNoticia(titulo, descripcion, Convert.ToDateTime(fecha), 0, id, id, idEvento);
 }