Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public IQueryable <WorkAssignmentSummary> GetSummary(string search)
        {
            IQueryable <WorkAssignment> query = waRepo.GetAllQ();

            if (!string.IsNullOrEmpty(search))
            {
                IndexViewBase.filterOnDatePart(search, ref query);
            }

            var sum_query = from wa in query
                            group wa by new
            {
                dateSoW = TimeZoneInfo
                          .ConvertTimeFromUtc(wa.workOrder.dateTimeofWork, _clientTimeZoneInfo).Date,
                wa.workOrder.statusID
            } into dayGroup
                select new WorkAssignmentSummary
            {
                date   = dayGroup.Key.dateSoW,
                status = dayGroup.Key.statusID,
                count  = dayGroup.Count()
            };

            return(sum_query);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public IQueryable <WorkAssignmentSummary> GetSummary(string search)
        {
            IQueryable <WorkAssignment> query = waRepo.GetAllQ();

            if (!string.IsNullOrEmpty(search))
            {
                IndexViewBase.filterOnDatePart(search, ref query);
            }

            var sum_query = from wa in query //LINQ
                            group wa by new
            {
                dateSoW = DbFunctions
                          .TruncateTime(wa.workOrder.dateTimeofWork),
                wa.workOrder.statusID
            } into dayGroup
                select new WorkAssignmentSummary()
            {
                date   = dayGroup.Key.dateSoW,
                status = dayGroup.Key.statusID,
                count  = dayGroup.Count()
            };

            return(sum_query);
        }