Пример #1
0
        private void DeleteWorkplace(string sql)
        {
            ProductWorkplaceCollection oWorkplaceList = ProductWorkplace.LoadCollection(sql);

            foreach (ProductWorkplace oWorkplace in oWorkplaceList)
            {
                oWorkplace.Delete();
            }
        }
Пример #2
0
        /// <summary>
        /// Loads a collection of ProductWorkplace objects from the database.
        /// </summary>
        /// <returns>A collection containing all of the ProductWorkplace objects in the database.</returns>
        public static ProductWorkplaceCollection LoadCollection(string spName, SqlParameter[] parms)
        {
            ProductWorkplaceCollection result = new ProductWorkplaceCollection();

            using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms))
            {
                while (reader.Read())
                {
                    ProductWorkplace tmp = new ProductWorkplace();
                    tmp.LoadFromReader(reader);
                    result.Add(tmp);
                }
            }
            return(result);
        }