Example #1
0
 public static JugadorEquipo SelectById(int id)
 {
     JugadorEquipoDSTableAdapters.tbl_jugadorEquipoTableAdapter adapter =
         new JugadorEquipoDSTableAdapters.tbl_jugadorEquipoTableAdapter();
     JugadorEquipoDS.tbl_jugadorEquipoDataTable table = adapter.SelectById(id);
     if (table.Rows.Count == 0)
     {
         return(null);
     }
     return(RowToDto(table[0]));
 }
Example #2
0
    public static List <JugadorEquipo> SelectByTipo(string tipo, string idEquipo)
    {
        JugadorEquipoDSTableAdapters.tbl_jugadorEquipoTableAdapter adapter =
            new JugadorEquipoDSTableAdapters.tbl_jugadorEquipoTableAdapter();
        JugadorEquipoDS.tbl_jugadorEquipoDataTable table = adapter.SelectByTipo(tipo, Convert.ToInt32(idEquipo));
        List <JugadorEquipo> listJugadorEquipo           = new List <JugadorEquipo>();

        foreach (JugadorEquipoDS.tbl_jugadorEquipoRow row in table)
        {
            listJugadorEquipo.Add(RowToDto(row));
        }
        return(listJugadorEquipo);
    }
Example #3
0
    public static List <JugadorEquipo> SelectByEquipo(int id)
    {
        JugadorEquipoDSTableAdapters.tbl_jugadorEquipoTableAdapter adapter =
            new JugadorEquipoDSTableAdapters.tbl_jugadorEquipoTableAdapter();
        JugadorEquipoDS.tbl_jugadorEquipoDataTable table = adapter.SelectByIdEquipo(id);
        List <JugadorEquipo> listJugadorEquipo           = new List <JugadorEquipo>();

        foreach (JugadorEquipoDS.tbl_jugadorEquipoRow row in table)
        {
            listJugadorEquipo.Add(RowToDto(row));
        }
        return(listJugadorEquipo);
    }
Example #4
0
    public static JugadorEquipo InsertWithReturn(string nombre, string posicion, int idEquipo, int nroCamiseta, string tipo)
    {
        JugadorEquipoDSTableAdapters.tbl_jugadorEquipoTableAdapter adapter =
            new JugadorEquipoDSTableAdapters.tbl_jugadorEquipoTableAdapter();
        JugadorEquipoDS.tbl_jugadorEquipoDataTable table =
            adapter.InsertWithReturn(nombre, posicion, idEquipo, nroCamiseta, tipo, 0);
        if (table.Rows.Count == 0)
        {
            return(null);
        }
        int idJugadorEquipo = RowToDto(table[0]).IdJugadorEquipo;

        GolesBLL.Insertar(idJugadorEquipo, 0, 0);
        return(RowToDto(table[0]));
    }