Ejemplo n.º 1
0
 /// <summary>
 /// Loads Special by the id parameter
 /// </summary>
 /// <param name="specialId">Primary Key of Special table</param>
 /// <returns>Special entity</returns>
 public static Special Load(int specialId)
 {
     SearchSpecial search
         = new SearchSpecial
             {
                 SpecialId = specialId
             };
     return Search(search).FirstOrDefault();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Searches for Special
        /// </summary>
        /// <param name="item" />
        /// <returns>An IEnumerable set of Special</returns>
        public static IEnumerable<Special> Search(SearchSpecial item)
        {
            List<SqlParameter> parameters
                = new List<SqlParameter>
                    {
                        new SqlParameter("@SpecialId", item.SpecialId),
                        new SqlParameter("@InventoryId", item.InventoryId),
                        new SqlParameter("@DateStart", item.DateStart),
                        new SqlParameter("@DateEnd", item.DateEnd),
                        new SqlParameter("@Price", item.Price)
                    };

            DataSet set = DataManager.ExecuteProcedure(KarzPlusConnectionString, "PKP_GetSpecial", parameters);
            IEnumerable<DataRow> dataRows = set.GetRowsFromDataSet();
            return ConvertToEntityObject(dataRows);
        }
Ejemplo n.º 3
0
        public static IEnumerable<Special> LoadByInventoryId(int inventoryId)
        {
            SearchSpecial searchSpecial = new SearchSpecial {InventoryId = inventoryId};

            return Search(searchSpecial);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Loads all specials
        /// </summary>
        /// <returns></returns>
        public static IEnumerable<Special> LoadAll()
        {
            SearchSpecial searchSpecial = new SearchSpecial();

            return Search(searchSpecial);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Searches for Special
 /// </summary>
 /// <param name="search" />
 /// <returns>An IEnumerable set of Special</returns>
 public static IEnumerable<Special> Search(SearchSpecial search)
 {
     return search == null ? new List <Special>() : SpecialDao.Search(search);
 }