Exemplo n.º 1
0
        public Boolean UpdateTeam(TeamBE objTeamBE)
        {
            connection.ConnectionString = MiConexion.GetCnx();
            command.Connection          = connection;
            command.CommandType         = CommandType.StoredProcedure;
            command.CommandText         = "ActualizarEquipo";

            command.Parameters.AddWithValue("@IdEquipo", objTeamBE.IdEquipo);
            command.Parameters.AddWithValue("@NomEquipo", objTeamBE.NomEquipo);
            command.Parameters.AddWithValue("@PaisEquipo", objTeamBE.PaisEquipo);
            try
            {
                connection.Open();
                command.ExecuteNonQuery();
                return(true);
            }
            catch (SqlException x)
            {
                throw new Exception(x.Message);
            }
            finally
            {
                if (connection.State == ConnectionState.Open)
                {
                    connection.Close();
                }
                command.Parameters.Clear();
            }
        }
Exemplo n.º 2
0
 public TeamModel(TeamBE team)
 {
     ID      = team.ID;
     Name    = team.Name;
     Abr     = team.Abr;
     Slug    = team.Slug;
     TeamURL = team.TeamURL;
     Mascot  = team.Mascot;
 }
Exemplo n.º 3
0
 private void Team03_Load(object sender, EventArgs e)
 {
     try
     {
         objTeamBE        = objTeamBL.ConsultTeam(Codigo);
         txtTeamName.Text = objTeamBE.NomEquipo;
         txtCountry.Text  = objTeamBE.PaisEquipo;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error : " + ex.Message);
     }
 }
Exemplo n.º 4
0
        private TeamBE GetEntity(TeamEntity te)
        {
            if (null == te)
            {
                return(null);
            }

            var result = new TeamBE
            {
                Abr     = te.abr,
                ID      = te.id,
                Mascot  = te.mascot,
                Name    = te.name,
                Slug    = te.slug,
                TeamURL = te.team_url
            };

            return(result);
        }
Exemplo n.º 5
0
        public TeamModel GetModel(TeamBE teamBE)
        {
            if (null == teamBE)
            {
                return(null);
            }

            var result = new TeamModel()
            {
                Abr     = teamBE.Abr,
                ID      = teamBE.ID,
                Mascot  = teamBE.Mascot,
                Name    = teamBE.Name,
                Slug    = teamBE.Slug,
                TeamURL = teamBE.TeamURL
            };

            return(result);
        }
Exemplo n.º 6
0
        public TeamBE ConsultTeam(String TeamId)
        {
            TeamBE objTeamBE = new TeamBE();

            try
            {
                connection.ConnectionString = MiConexion.GetCnx();
                command.Connection          = connection;
                command.CommandType         = CommandType.StoredProcedure;
                command.CommandText         = "ConsultarEquipo";

                command.Parameters.AddWithValue("@IdEquipo", TeamId);

                connection.Open();
                dataReader = command.ExecuteReader();

                if (dataReader.HasRows)
                {
                    dataReader.Read();

                    objTeamBE.IdEquipo   = Convert.ToInt32(dataReader["IdEquipo"]);
                    objTeamBE.NomEquipo  = dataReader["NomEquipo"].ToString();
                    objTeamBE.PaisEquipo = dataReader["PaisEquipo"].ToString();
                }
                dataReader.Close();
            }
            catch (SqlException ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                if (connection.State == ConnectionState.Open)
                {
                    connection.Close();
                }
                command.Parameters.Clear();
            }
            return(objTeamBE);
        }
Exemplo n.º 7
0
 public Boolean UpdateTeam(TeamBE objTeamBE)
 {
     return(objTeamADO.UpdateTeam(objTeamBE));
 }
Exemplo n.º 8
0
 public Boolean InsertTeam(TeamBE objTeamBE)
 {
     return(objTeamADO.InsertTeam(objTeamBE));
 }