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

            sol_Fee.FeeID          = SqlClientUtility.GetInt32(dataReader, "FeeID", 0);
            sol_Fee.FeeDescription = SqlClientUtility.GetString(dataReader, "FeeDescription", String.Empty);
            sol_Fee.FeeAmount      = SqlClientUtility.GetDecimal(dataReader, "FeeAmount", Decimal.Zero);
            sol_Fee.Percentage     = SqlClientUtility.GetBoolean(dataReader, "Percentage", false);

            return(sol_Fee);
        }
コード例 #2
0
        /// <summary>
        /// Saves a record to the sol_Fees table.
        /// </summary>
        public virtual void Insert(Sol_Fee sol_Fee)
        {
            ValidationUtility.ValidateArgument("sol_Fee", sol_Fee);

            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@FeeDescription", sol_Fee.FeeDescription),
                new SqlParameter("@FeeAmount", sol_Fee.FeeAmount),
                new SqlParameter("@Percentage", sol_Fee.Percentage)
            };

            sol_Fee.FeeID = (int)SqlClientUtility.ExecuteScalar(connectionStringName, CommandType.StoredProcedure, "sol_Fees_Insert", parameters);
        }
コード例 #3
0
        /// <summary>
        /// Selects all records from the sol_Fees table.
        /// </summary>
        public virtual List <Sol_Fee> SelectAll()
        {
            using (SqlDataReader dataReader = SqlClientUtility.ExecuteReader(connectionStringName, CommandType.StoredProcedure, "sol_Fees_SelectAll"))
            {
                List <Sol_Fee> sol_FeeList = new List <Sol_Fee>();
                while (dataReader.Read())
                {
                    Sol_Fee sol_Fee = MakeSol_Fee(dataReader);
                    sol_FeeList.Add(sol_Fee);
                }

                return(sol_FeeList);
            }
        }