Esempio n. 1
0
        /// <summary>
        /// Saves a record to the Materia table.
        /// </summary>
        public void Insert(Materia materia)
        {
            ValidationUtility.ValidateArgument("materia", materia);

            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@IdMateria", materia.IdMateria),
                new SqlParameter("@IdDepartamento", materia.IdDepartamento),
                new SqlParameter("@Descripcion", materia.Descripcion)
            };

            SqlClientUtility.ExecuteNonQuery(connectionStringName, CommandType.StoredProcedure, "MateriaInsert", parameters);
            SqlConnection.ClearAllPools();
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new instance of the Materia class and populates it with data from the specified SqlDataReader.
        /// </summary>
        private Materia MapDataReader(SqlDataReader dataReader)
        {
            Materia materia = new Materia();
            materia.IdMateria = dataReader.GetInt32("IdMateria", 0);
            materia.IdDepartamento = dataReader.GetInt32("IdDepartamento", 0);
            materia.Descripcion = dataReader.GetString("Descripcion", null);

            return materia;
        }
Esempio n. 3
0
        /// <summary>
        /// Creates a new instance of the Materia class and populates it with data from the specified SqlDataReader.
        /// </summary>
        private Materia MapDataReaderMateria(SqlDataReader dataReader)
        {
            Materia materia = new Materia();
            materia.IdMateria = dataReader.GetInt32("IdMateria", 0);

            return materia;
        }