Пример #1
0
        private void GetCertificateTaskList(RequestForDiplomaSupplyDAL certificateDAL)
        {
            List <int> delegatedItemIDs = this.DelegationList.Where(d => d.ListUrl == RequestForDiplomaSuppliesList.Url).Select(d => d.ListItemID).ToList();
            var        delegationQuery  = _filterTaskManager.BuildApprovedByDelegationQuery(_currentUserInfoId, RequestForDiplomaSuppliesList.Fields.PendingAtField, "Lookup", delegatedItemIDs);

            var query = $@"<Where>
                                <And>
                                    {delegationQuery}
                                    <Eq>
                                        <FieldRef Name='{ApprovalFields.WFStatus}' />
                                        <Value Type='Text'>{StringConstant.ApprovalStatus.InProgress}</Value>
                                    </Eq>
                                </And>
                            </Where>";

            if (this.CountOnly)
            {
                TotalCount += certificateDAL.CountByQuery(query);
            }
            else
            {
                var certificateManagementList = certificateDAL.GetByQuery(query);
                if (certificateManagementList != null && certificateManagementList.Count > 0)
                {
                    foreach (var certificateManagement in certificateManagementList)
                    {
                        var filterTask = new FilterTask(certificateManagement);
                        filterTask.ApprovalStatusId = ApprovalStatusId;
                        FilterTaskList.Add(filterTask);
                    }
                }
            }
        }
Пример #2
0
        /// <summary>
        /// InitDALObject
        /// </summary>
        /// <param name="listUrl"></param>
        /// <param name="currentWeb"></param>
        /// <returns></returns>
        private static IDelegationManager InitDALObject(string listUrl, SPWeb currentWeb)
        {
            IDelegationManager moduleDAL = null;

            if (string.Compare(listUrl, ShiftManagementList.ListUrl, true) == 0)
            {
                moduleDAL = new ShiftManagementDAL(currentWeb.Url);
            }
            else if (string.Compare(listUrl, ChangeShiftList.ListUrl, true) == 0)
            {
                moduleDAL = new ChangeShiftManagementDAL(currentWeb.Url);
            }
            else if (string.Compare(listUrl, OverTimeManagementList.ListUrl, true) == 0)
            {
                moduleDAL = new OverTimeManagementDAL(currentWeb.Url);
            }
            else if (string.Compare(listUrl, NotOvertimeList.ListUrl, true) == 0)
            {
                moduleDAL = new NotOvertimeManagementDAL(currentWeb.Url);
            }
            else if (string.Compare(listUrl, VehicleManagementList.ListUrl, true) == 0)
            {
                moduleDAL = new VehicleManagementDAL(currentWeb.Url);
            }
            else if (string.Compare(listUrl, LeaveManagementList.ListUrl, true) == 0)
            {
                moduleDAL = new LeaveManagementDAL(currentWeb.Url);
            }
            else if (string.Compare(listUrl, FreightManagementList.ListUrl, true) == 0)
            {
                moduleDAL = new FreightManagementDAL(currentWeb.Url);
            }
            else if (string.Compare(listUrl, BusinessTripManagementList.Url, true) == 0)
            {
                moduleDAL = new BusinessTripManagementDAL(currentWeb.Url);
            }
            else if (string.Compare(listUrl, RequestsList.Url, true) == 0)
            {
                moduleDAL = new RequestsDAL(currentWeb.Url);
            }
            else if (string.Compare(listUrl, EmployeeRequirementSheetsList.Url, true) == 0)
            {
                moduleDAL = new EmployeeRequirementSheetDAL(currentWeb.Url);
            }
            else if (string.Compare(listUrl, RequestForDiplomaSuppliesList.Url, true) == 0)
            {
                moduleDAL = new RequestForDiplomaSupplyDAL(currentWeb.Url);
            }
            else if (string.Compare(listUrl, RequisitionOfMeetingRoomList.Url, true) == 0)
            {
                moduleDAL = new RequisitionOfMeetingRoomDAL(currentWeb.Url);
            }

            return(moduleDAL);
        }
        protected override void OnInit(EventArgs e)
        {
            try
            {
                // Set current list url.
                this.listUrl = RequestForDiplomaSuppliesList.Url;
                this.requestForDiplomaSupplyDAL = new RequestForDiplomaSupplyDAL(SPContext.Current.Web.Url);

                base.OnInit(e);
            }
            catch (Exception ex)
            {
                ULSLogging.LogError(ex);
            }
        }
Пример #4
0
        private void GetCertificateTaskList(RequestForDiplomaSupplyDAL certificateDAL)
        {
            var query = _filterTaskManager.BuildApprovalWorkflowHistoryQuery(RequestForDiplomaSuppliesList.ListName, this.ApproverFullName, DateTime.Now);

            if (this.CountOnly)
            {
                TotalCount += certificateDAL.CountByQuery(query);
            }
            else
            {
                var certificateManagementList = certificateDAL.GetByQuery(query);
                if (certificateManagementList != null && certificateManagementList.Count > 0)
                {
                    foreach (var certificateManagement in certificateManagementList)
                    {
                        var filterTask = new FilterTask(certificateManagement);
                        filterTask.ApprovalStatusId = certificateManagement.WFStatus == Status.Approved ? ApprovedStatusId
                            : certificateManagement.WFStatus == ApprovalStatus.Rejected ? RejectedStatusId
                            : InProgressStatusId;
                        FilterTaskList.Add(filterTask);
                    }
                }
            }
        }
Пример #5
0
 public void Visit(RequestForDiplomaSupplyDAL certificateDAL)
 {
     GetCertificateTaskList(certificateDAL);
 }
 public void Visit(RequestForDiplomaSupplyDAL certificateDAL)
 {
     // Do nothing
 }