public static ICollection<StockInformation> GetAvailableStock(ICollection<StockInformation> stockInformations, ICollection<ApprovedDetail> approvedDetails,ActivityGroup activityGroup,Manufacturer manufacturer,PhysicalStore physicalStore,DateTime? expiryDate)
        {
            var approvedDetailClone = approvedDetails.Select(a => new ApprovedDetail(a)).ToList();

            var nonPreferredStockInformation = stockInformations
                .Where(s => ((activityGroup != null && activityGroup.ActivityGroupID != s.Activity.ActivityGroupID)
                             || ((manufacturer != null) && (manufacturer.ManufacturerID != s.Manufacturer.ManufacturerID))
                             || (physicalStore != null && (physicalStore.PhysicalStoreID != s.PhysicalStore.PhysicalStoreID))
                             || (expiryDate != null && expiryDate != s.ExpiryDate))).Select(s => new StockInformation(s)).ToList();

            SubstractApprovedQuantityFromStock(nonPreferredStockInformation, approvedDetailClone);

            //Substract Then From Preferred if Non Prefered cannot satisfy approvedDetail

            var preferredStockInformation = stockInformations
                .Where(s => ((activityGroup == null     || activityGroup.ActivityGroupID == s.Activity.ActivityGroupID)
                             && ((manufacturer == null) || ( manufacturer.ManufacturerID == s.Manufacturer.ManufacturerID))
                             && (physicalStore == null  ||  ( physicalStore.PhysicalStoreID == s.PhysicalStore.PhysicalStoreID))
                             && (expiryDate == null     || expiryDate == s.ExpiryDate))).Select(s=> new StockInformation(s)).ToList();

            SubstractApprovedQuantityFromStock(preferredStockInformation, approvedDetailClone);

            return preferredStockInformation;
        }
 public ActivityViewModel(ActivityGroup activity)
 {
     ActivityID = activity.ActivityGroupID;
     Name = activity.Name;
 }