private void GetBusinessTripTaskList(BusinessTripManagementDAL businessTripManagementDAL)
        {
            var        taskListQuery    = _filterTaskManager.BuildTaskListQuery(StepModuleList.BusinessTripManagement.ToString(), TaskStatusList.InProgress.ToString(), _currentUserADId);
            List <int> delegatedItemIDs = this.DelegationList.Where(d => d.ListUrl == BusinessTripManagementList.Url).Select(d => d.ListItemID).ToList();
            var        delegationQuery  = _filterTaskManager.BuildApprovedByDelegationQuery(_currentUserADId, string.Empty, string.Empty, delegatedItemIDs);

            var query = $@"<Where>
                                <And>
                                    <Or>
                                        {taskListQuery}
                                        {delegationQuery}
                                    </Or>
                                    <Or>
                                        <Eq>
                                            <FieldRef Name='{CommonSPListField.CommonReqDueDateField}' />
                                            <Value IncludeTimeValue='FALSE' Type='DateTime'>{DateTime.Now.ToString(StringConstant.DateFormatForCAML)}</Value>
                                        </Eq>
                                        <Eq>
                                            <FieldRef Name='{CommonSPListField.CommonReqDueDateField}' />
                                            <Value IncludeTimeValue='FALSE' Type='DateTime'>{DateTime.Now.AddDays(1).ToString(StringConstant.DateFormatForCAML)}</Value>
                                        </Eq>
                                    </Or>
                                </And>
                            </Where>";

            if (this.CountOnly)
            {
                TotalCount += businessTripManagementDAL.CountByQuery(query);
            }
            else
            {
                var businessTripManagementList = businessTripManagementDAL.GetByQuery(query);

                if (businessTripManagementList != null)
                {
                    foreach (var businessTripManagement in businessTripManagementList)
                    {
                        var filterTask = new FilterTask(businessTripManagement);
                        filterTask.ApprovalStatusId = ApprovalStatusId;
                        FilterTaskList.Add(filterTask);
                    }
                }
            }
        }
예제 #2
0
        private void GetBusinessTripTaskList(BusinessTripManagementDAL businessTripManagementDAL)
        {
            var query = _filterTaskManager.BuildApprovalTaskListQuery(StepModuleList.BusinessTripManagement.ToString(), _currentUserADId, DateTime.Now);

            if (this.CountOnly)
            {
                TotalCount += businessTripManagementDAL.CountByQuery(query);
            }
            else
            {
                var businessTripManagementList = businessTripManagementDAL.GetByQuery(query);
                if (businessTripManagementList != null && businessTripManagementList.Count > 0)
                {
                    foreach (var businessTripManagement in businessTripManagementList)
                    {
                        var filterTask = new FilterTask(businessTripManagement);
                        filterTask.ApprovalStatusId = businessTripManagement.ApprovalStatus == Status.Approved ? ApprovedStatusId
                            : businessTripManagement.ApprovalStatus == Status.Rejected ? RejectedStatusId
                            : InProgressStatusId;
                        FilterTaskList.Add(filterTask);
                    }
                }
            }
        }