Esempio n. 1
0
        //已审批
        private void ApprovedList(ApplyCarListModel vm, IEnumerable <tbWeOAFlowDetail> workflowApproveList, IEnumerable <tbWeOAFlowDetail> allApproveList)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var approvedList = OAWeWorkFlow.GetApprovedList(db, flowTypeCode);
                var approved     = (from a in approvedList
                                    join b in db.Table <Wechat.Entity.tbWeOAApplyCar>().Include(m => m.tbTeacherDept) on a.ApproveBodyId equals b.Id
                                    select new Dto.ApplyCar.ApplyCarListDto
                {
                    CarTime = b.CarTime,
                    Destination = b.Destination,
                    tbTeacherDeptName = b.tbTeacherDept.TeacherDeptName,
                    Reason = b.Reason,
                    OtherUsers = b.OtherUsers,
                    Remark = b.Remark,

                    Id = b.Id,
                    ApplyUser = workflowApproveList.Where(m => m.ApproveBodyId == b.Id).FirstOrDefault().tbSysUser.UserName,
                    ApproveDate = a.ApproveDate,
                    ApproveOpinion = a.ApproveOpinion,
                    ApproveUserName = a.tbSysUser.UserName,
                    NodeApproveStatus = allApproveList.Where(m => m.ApproveBodyId == a.ApproveBodyId && m.NodeApproveStatus == Code.EnumHelper.OAFlowNodeStatus.WithoutApproval).FirstOrDefault() == null ? Code.EnumHelper.OAFlowNodeStatus.Approved : Code.EnumHelper.OAFlowNodeStatus.WithoutApproval,
                    IsComplete = allApproveList.Where(m => m.ApproveBodyId == a.ApproveBodyId && m.tbWeOAFlowNextNode == null).FirstOrDefault() != null
                }).Distinct(new Code.EqualComparer <Dto.ApplyCar.ApplyCarListDto>((x, y) => x.Id == y.Id)).OrderByDescending(m => m.ApproveDate);
                ApprovedListPage(vm, approved);
            }
        }
Esempio n. 2
0
        //已审批
        private void ApprovedList(OfficeListModel vm, IEnumerable <tbWeOAFlowDetail> workflowApproveList, IEnumerable <tbWeOAFlowDetail> allApproveList)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var approvedList = OAWeWorkFlow.GetApprovedList(db, flowTypeCode);
                var my           = (from a in approvedList
                                    join b in db.Table <Wechat.Entity.tbWeOAOffice>() on a.ApproveBodyId equals b.Id
                                    select new Dto.Office.OfficeListDto
                {
                    Title = b.Title,
                    LimitDateTo = b.LimitDateTo,
                    OfficeFileFrom = b.OfficeFileFrom,
                    OfficeFileName = b.OfficeFileName,
                    OfficeFileNameSeq = b.OfficeFileNameSeq,
                    ReceiveFileTime = b.ReceiveFileTime,

                    Id = b.Id,
                    ApplyUser = workflowApproveList.Where(m => m.ApproveBodyId == b.Id).FirstOrDefault().tbSysUser.UserName,
                    ApproveDate = a.ApproveDate,
                    ApproveOpinion = a.ApproveOpinion,
                    ApproveUserName = a.tbSysUser.UserName,
                    NodeApproveStatus = allApproveList.Where(m => m.ApproveBodyId == a.ApproveBodyId && m.NodeApproveStatus == Code.EnumHelper.OAFlowNodeStatus.WithoutApproval).FirstOrDefault() == null ? Code.EnumHelper.OAFlowNodeStatus.Approved : Code.EnumHelper.OAFlowNodeStatus.WithoutApproval,
                    IsComplete = allApproveList.Where(m => m.ApproveBodyId == a.ApproveBodyId && m.tbWeOAFlowNextNode == null).FirstOrDefault() != null
                }).Distinct(new Code.EqualComparer <Dto.Office.OfficeListDto>((x, y) => x.Id == y.Id)).OrderByDescending(m => m.ApproveDate);
                //分页
                ApprovedListPage(vm, my);
            }
        }