コード例 #1
0
        /// <summary>
        /// Creates a new instance of the Sac_Settings class and populates it with data from the specified SqlDataReader.
        /// </summary>
        protected virtual Sac_Setting MakeSac_Setting(SqlDataReader dataReader)
        {
            Sac_Setting sac_Setting = new Sac_Setting();

            sac_Setting.Name        = SqlClientUtility.GetString(dataReader, "Name", String.Empty);
            sac_Setting.Description = SqlClientUtility.GetString(dataReader, "Description", String.Empty);
            sac_Setting.SetValue    = SqlClientUtility.GetBytes(dataReader, "SetValue", new byte[0]);

            return(sac_Setting);
        }
コード例 #2
0
        /// <summary>
        /// Updates a record in the Sac_Settings table.
        /// </summary>
        public virtual void Update(Sac_Setting sac_Setting)
        {
            ValidationUtility.ValidateArgument("sac_Setting", sac_Setting);

            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@Name", sac_Setting.Name),
                new SqlParameter("@Description", sac_Setting.Description),
                new SqlParameter("@SetValue", sac_Setting.SetValue)
            };

            SqlClientUtility.ExecuteNonQuery(connectionStringName, CommandType.StoredProcedure, "Sac_Settings_Update", parameters);
        }
コード例 #3
0
        /// <summary>
        /// Selects all records from the Sac_Settings table.
        /// </summary>
        public virtual List <Sac_Setting> SelectAll()
        {
            using (SqlDataReader dataReader = SqlClientUtility.ExecuteReader(connectionStringName, CommandType.StoredProcedure, "Sac_Settings_SelectAll"))
            {
                List <Sac_Setting> sac_SettingList = new List <Sac_Setting>();
                while (dataReader.Read())
                {
                    Sac_Setting sac_Setting = MakeSac_Setting(dataReader);
                    sac_SettingList.Add(sac_Setting);
                }

                return(sac_SettingList);
            }
        }