Example #1
0
        /// <summary>
        /// Creates a new instance of the Sol_Categories class and populates it with data from the specified SqlDataReader.
        /// </summary>
        protected virtual Sol_Category MakeSol_Category(SqlDataReader dataReader)
        {
            Sol_Category Sol_Category = new Sol_Category();

            Sol_Category.CategoryID           = SqlClientUtility.GetInt32(dataReader, "CategoryID", 0);
            Sol_Category.Description          = SqlClientUtility.GetString(dataReader, "Description", String.Empty);
            Sol_Category.RefundAmount         = SqlClientUtility.GetDecimal(dataReader, "RefundAmount", Decimal.Zero);
            Sol_Category.SubContainerQuantity = SqlClientUtility.GetInt32(dataReader, "SubContainerQuantity", 0);
            Sol_Category.StagingMethodID      = SqlClientUtility.GetInt32(dataReader, "StagingMethodID", 0);
            Sol_Category.StagingProductID     = SqlClientUtility.GetInt32(dataReader, "StagingProductID", 0);

            return(Sol_Category);
        }
Example #2
0
        /// <summary>
        /// Selects all records from the Sol_Categories table.
        /// </summary>
        public virtual List <Sol_Category> SelectAll()
        {
            using (SqlDataReader dataReader = SqlClientUtility.ExecuteReader(connectionStringName, CommandType.StoredProcedure, "Sol_Categories_SelectAll"))
            {
                List <Sol_Category> Sol_CategoryList = new List <Sol_Category>();
                while (dataReader.Read())
                {
                    Sol_Category Sol_Category = MakeSol_Category(dataReader);
                    Sol_CategoryList.Add(Sol_Category);
                }

                return(Sol_CategoryList);
            }
        }
Example #3
0
        /// <summary>
        /// Saves a record to the Sol_Categories table.
        /// </summary>
        public virtual void Insert(Sol_Category Sol_Category)
        {
            ValidationUtility.ValidateArgument("Sol_Category", Sol_Category);

            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@Description", Sol_Category.Description),
                new SqlParameter("@RefundAmount", Sol_Category.RefundAmount),
                new SqlParameter("@SubContainerQuantity", Sol_Category.SubContainerQuantity),
                new SqlParameter("@StagingMethodID", Sol_Category.StagingMethodID),
                new SqlParameter("@StagingProductID", Sol_Category.StagingProductID)
            };

            Sol_Category.CategoryID = (int)SqlClientUtility.ExecuteScalar(connectionStringName, CommandType.StoredProcedure, "Sol_Categories_Insert", parameters);
        }