Пример #1
0
        /// <summary>
        /// Saves a record to the Sede table.
        /// </summary>
        public void Insert(Sede sede)
        {
            ValidationUtility.ValidateArgument("sede", sede);

            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@Nombre", sede.Nombre)
            };

            sede.IdSede = (int) SqlClientUtility.ExecuteScalar(connectionStringName, CommandType.StoredProcedure, "SedeInsert", parameters);
            SqlConnection.ClearAllPools();
        }
Пример #2
0
        /// <summary>
        /// Creates a new instance of the Sede class and populates it with data from the specified SqlDataReader.
        /// </summary>
        private Sede MapDataReader(SqlDataReader dataReader)
        {
            Sede sede = new Sede();
            sede.IdSede = dataReader.GetInt32("IdSede", 0);
            sede.Nombre = dataReader.GetString("Nombre", null);

            return sede;
        }
Пример #3
0
        /// <summary>
        /// Updates a record in the Sede table.
        /// </summary>
        public void Update(Sede sede)
        {
            ValidationUtility.ValidateArgument("sede", sede);

            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@IdSede", sede.IdSede),
                new SqlParameter("@Nombre", sede.Nombre)
            };

            SqlClientUtility.ExecuteNonQuery(connectionStringName, CommandType.StoredProcedure, "SedeUpdate", parameters);
            SqlConnection.ClearAllPools();
        }