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(); } }
public TeamModel(TeamBE team) { ID = team.ID; Name = team.Name; Abr = team.Abr; Slug = team.Slug; TeamURL = team.TeamURL; Mascot = team.Mascot; }
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); } }
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); }
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); }
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); }
public Boolean UpdateTeam(TeamBE objTeamBE) { return(objTeamADO.UpdateTeam(objTeamBE)); }
public Boolean InsertTeam(TeamBE objTeamBE) { return(objTeamADO.InsertTeam(objTeamBE)); }