public int GetAllMeetingHoursByDateTypeState(DateTime? @from, DateTime? to, MeetingType? meetingType, MeetingStateEnum? state, bool withMinuts, bool withAttachment, string userName)
        {
            var q = ctx.Meetings.AsNoTracking().Where(m => m.CreatorUser.UserName == userName);
            if (meetingType.HasValue)
            {
                if (meetingType.Value == MeetingType.Working)
                {
                    q = withMinuts ? q.Cast<WorkingMeeting>().Where(m => m.Decisions != "") : q.Cast<WorkingMeeting>();
                }

                if (meetingType.Value == MeetingType.NonWorking)
                    q = q.Cast<NoneWorkingMeeting>();
            }
            if (state.HasValue)
                q = q.Where(m => m.StateCode == state.Value);
            if (from.HasValue)
                q = q.Where(m => m.StartDate >= from.Value);
            if (to.HasValue)
                q = q.Where(m => m.StartDate <= to.Value);
            if (withAttachment)
                q = q.Where(m => m.Files.Any());
            return q.Sum(m => m.Duration);
        }
Пример #2
0
 public List<MeetingDto> GetMeetingByState(MeetingStateEnum state)
 {
     var userName = securityService.GetCurrentUserName();
     var res = reportRepository.GetMeetingByState(state, userName);
     return res.Select(RMSMapper.Map<Meeting, MeetingDto>).ToList();
 }
Пример #3
0
 public void AddMeetingHistory(MeetingStateEnum currentState,MeetingOperationEnum operation)
 {
    
     if(MeetingHistories==null) 
         MeetingHistories=new List<MeetingHistory>();
     MeetingHistories.Add(new MeetingHistory(currentState,operation));
 }
Пример #4
0
 public MeetingHistory(MeetingStateEnum currentState,MeetingOperationEnum operation)
 {
     Operation = operation;
     OperationDate = DateTime.Now;
     CurrentState = currentState;
 } 
Пример #5
0
 public static void AreEqual_State(MeetingStateEnum state, MeetingDto actual)
 {
     Assert.AreEqual(state,actual.State);
 }
 public List<Meeting> GetMeetingByState(MeetingStateEnum state, string userName)
 {
     return meetingsAsNoTracking.Where(m => m.CreatorUser.UserName == userName && m.StateCode == state).ToList();
 }
 public List<MeetingDto> PutMeetingByState(MeetingStateEnum state)
 {
     return meetingReportService.GetMeetingByState(state);
 }