protected override void LoadListOfMyRequests()
        {
            try
            {
                StringBuilder queryStringMyRequestBuilder = new StringBuilder();
                queryStringMyRequestBuilder.Append(this.queryStringMyRequest);
                queryStringMyRequestBuilder.Append(this.orderByQueryString);
                List <Biz.Models.RequisitionOfMeetingRoom> myRequests = requisitionOfMeetingRoomDAL.GetByQuery(queryStringMyRequestBuilder.ToString());
                this.gridMyRquests.DataSource = myRequests;
                this.gridMyRquests.DataBind();

                this.Page.Session[MyRequestsSessionKey + this.moduleId] = myRequests;
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
                ULSLogging.LogMessageToFile($"-- Error occurs on MeetingRoomListUserControl: {ex.Message}");
            }
        }
        private void GetMeetingRoomTaskList(RequisitionOfMeetingRoomDAL requisitionOfMeetingRoomDAL)
        {
            List <int> delegatedItemIDs = this.DelegationList.Where(d => d.ListUrl == RequisitionOfMeetingRoomList.Url).Select(d => d.ListItemID).ToList();
            var        delegationQuery  = _filterTaskManager.BuildApprovedByDelegationQuery(_currentUserInfoId, RequisitionOfMeetingRoomList.Fields.PendingAtField, "Lookup", delegatedItemIDs);

            var query = $@"<Where>
                            <And>
                                <And>
                                    {delegationQuery}
                                    <Eq>
                                        <FieldRef Name='{ApprovalFields.WFStatus}' />
                                        <Value Type='Text'>{StringConstant.ApprovalStatus.InProgress}</Value>
                                    </Eq>
                                </And>
                                <Or>
                                    <Eq>
                                        <FieldRef Name='{RequisitionOfMeetingRoomList.Fields.StartDate}' />
                                        <Value IncludeTimeValue='FALSE' Type='DateTime'>{DateTime.Now.ToString(StringConstant.DateFormatForCAML)}</Value>
                                    </Eq>
                                    <Eq>
                                        <FieldRef Name='{RequisitionOfMeetingRoomList.Fields.StartDate}' />
                                        <Value IncludeTimeValue='FALSE' Type='DateTime'>{DateTime.Now.AddDays(1).ToString(StringConstant.DateFormatForCAML)}</Value>
                                    </Eq>
                                </Or>
                            </And>
                            </Where>";

            if (this.CountOnly)
            {
                TotalCount += requisitionOfMeetingRoomDAL.CountByQuery(query);
            }
            else
            {
                var requisitionOfMeetingRoomList = requisitionOfMeetingRoomDAL.GetByQuery(query);
                if (requisitionOfMeetingRoomList != null && requisitionOfMeetingRoomList.Count > 0)
                {
                    foreach (var requisitionOfMeetingRoom in requisitionOfMeetingRoomList)
                    {
                        var filterTask = new FilterTask(requisitionOfMeetingRoom);
                        filterTask.ApprovalStatusId = ApprovalStatusId;
                        FilterTaskList.Add(filterTask);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void GetMeetingRoomTaskList(RequisitionOfMeetingRoomDAL requisitionOfMeetingRoomDAL)
        {
            var query = _filterTaskManager.BuildApprovalWorkflowHistoryQuery(RequisitionOfMeetingRoomList.ListName, this.ApproverFullName, DateTime.Now);

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