Пример #1
0
 public static bool IsValidToRemove(int makeId)
 {
     SearchCarModel search
         = new SearchCarModel
         {
             MakeId = makeId,
             Deleted = false
         };
     return !CarModelManager.Search(search).SafeAny();
 }
Пример #2
0
        /// <summary>
        /// Searches for CarModel
        /// </summary>
        /// <param name="item" />
        /// <returns>An IEnumerable set of CarModel</returns>
        public static IEnumerable<CarModel> Search(SearchCarModel item)
        {
            List<SqlParameter> parameters
                = new List<SqlParameter>
                    {
                        new SqlParameter("@ModelId", item.ModelId),
                        new SqlParameter("@MakeId", item.MakeId),
                        new SqlParameter("@Name", item.Name),
                        new SqlParameter("@CarImage", SqlDbType.VarBinary) { Value = item.CarImage },
                        new SqlParameter("@Deleted", item.Deleted)
                    };

            DataSet set = DataManager.ExecuteProcedure(KarzPlusConnectionString, "PKP_GetCarModel", parameters);
            IEnumerable<DataRow> dataRows = set.GetRowsFromDataSet();
            return ConvertToEntityObject(dataRows);
        }
Пример #3
0
 /// <summary>
 /// Searches for CarModel
 /// </summary>
 /// <param name="search" />
 /// <returns>An IEnumerable set of CarModel</returns>
 public static IEnumerable<CarModel> Search(SearchCarModel search)
 {
     return search == null ? new List<CarModel>() : CarModelDao.Search(search);
 }