Exemple #1
0
        /// <summary>
        /// Gets the number of clients with services with a status
        /// </summary>
        /// <param name="min">Minimum date time</param>
        /// <param name="status">Status of Service Requisition</param>
        /// <returns>int</returns>
        public int NumberOfClientsService(ServiceRequisitionStatus status, DateTime min)
        {
            int count = 0;

            count = (from serviceR in _context.ServiceRequisition
                     where serviceR.ServiceRequisitionStatus == status && serviceR.LastUpdatedTime >= min
                     select serviceR).Select(sr => sr.RequisitionerID).Distinct().Count();
            return(count);
        }
Exemple #2
0
        /// <summary>
        /// Number of services
        /// </summary>
        /// <param name="status">Status of Service Requisition</param>
        /// <returns>int</returns>
        public async Task <int> NumberOfServices(ServiceRequisitionStatus status)
        {
            var user = await _userManager.GetUserAsync(User);

            int count = 0;

            count = (from r in _context.ServiceRequisition
                     join s in _context.Service
                     on r.ServiceID equals s.ServiceID
                     where s.UserID == user.Id && r.ServiceRequisitionStatus == status
                     select new
            {
                RequisitionerID = r.RequisitionerID
            }).Count();
            return(count);
        }