Exemplo n.º 1
0
 /// <summary>
 /// Zählt alle Entities nach der Filterung durch.
 /// </summary>
 /// <param name="sortType"></param>
 /// <returns></returns>
 public long CountFilteredBo()
 {
     try
     {
         return(FilterBoCollection(BoCollection).Count());
     }
     catch (Exception ex)
     {
         throw BoCoBaseException.Create("CountFilteredEntities", ex);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Zählt alle Entities durch
 /// </summary>
 /// <returns></returns>
 public long CountAllBo()
 {
     try
     {
         return(BoCollection.Count());
     }
     catch (Exception ex)
     {
         throw BoCoBaseException.Create("CountAllEntities", ex);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Wendet auf die Menge der Entites alle definierten Filter an. Das Ergebnis ist die
 /// gefilterte Menge. Diese wird anschließend sortiert
 /// </summary>
 /// <returns></returns>
 public IQueryable <TBo> GetFilteredAndSortedListOfBo()
 {
     try
     {
         return(MultiSort(FilterBoCollection(BoCollection)).AsQueryable());
     }
     catch (Exception ex)
     {
         throw BoCoBaseException.Create("GetEntitiesFilteredAndSorted", ex);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Wendet auf die Menge der Entities alle definierten Filter an. Das Ergebnis ist die
 /// gefilterte Menge
 /// </summary>
 /// <returns></returns>
 public IQueryable <TBo> GetFilteredListOfBo()
 {
     try
     {
         return(FilterBoCollection(BoCollection));
     }
     catch (Exception ex)
     {
         throw BoCoBaseException.Create("ApplyFilter", ex);
     }
 }
Exemplo n.º 5
0
        //----------------------------------------------------------------------------------------------------------------
        // Teilmengen von Entities oder EntityViews berechnen

        /// <summary>
        /// Zugriff auf alle Entities
        /// </summary>
        /// <returns></returns>
        public IQueryable <TBo> GetAllBo()
        {
            try
            {
                return(BoCollection);
            }
            catch (Exception ex)
            {
                throw BoCoBaseException.Create("GetEntities", ex);
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// Prüft, ob überhaupt ein Element in der Menge enthalten ist
 /// </summary>
 /// <returns></returns>
 public bool IsFilterdListNotEmpty()
 {
     try
     {
         return(FilterBoCollection(BoCollection).Any());
     }
     catch (Exception ex)
     {
         throw BoCoBaseException.Create("IsFilterdListNotEmpty", ex);
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// Entfernt ein Filter aus dem Bo
 /// </summary>
 /// <param name="flt"></param>
 public void RemoveFilter(Filter <TBo> flt)
 {
     if (AllFilter.ContainsKey(flt))
     {
         AllFilter.Remove(flt);
     }
     else
     {
         throw BoCoBaseException.Create(this, "RemoveFilter", RemoveFilterErrorMsg(flt));
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// Eine elementare Einfügeoperation
 /// </summary>
 /// <param name="entity"></param>
 public virtual void Insert(TBo entity)
 {
     try
     {
         AddToCollection(entity);
         SubmitChanges();
     }
     catch (Exception ex)
     {
         throw BoCoBaseException.Create(this, "Insert", ex);
     }
 }
Exemplo n.º 9
0
 /// <summary>
 /// Löschen des durch die ID definierten Entity
 /// </summary>
 /// <param name="id"></param>
 public virtual void RemoveFromCollection(TBoId id)
 {
     try
     {
         if (BoCollection.Any(GetBoIDTest(id)))
         {
             //var flt = CreateIdFilter(id);
             //var entity = flt.filterImpl(EntityCollection).Single();
             var DbEntity = BoCollection.Single(GetBoIDTest(id));
             RemoveFromCollection(DbEntity);
             SubmitChanges();
         }
         else
         {
             throw new ArgumentOutOfRangeException("ID nicht gefunden: " + id);
         }
     }
     catch (Exception ex)
     {
         throw BoCoBaseException.Create(this, "Delete", ex);
     }
 }