Beispiel #1
0
        //待审批
        private void WaitApproveList(ApplyCarListModel vm, IEnumerable <tbWeOAFlowDetail> workflowApproveList)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var waitApproveList = OAWeWorkFlow.GetWaitApproveList(db, flowTypeCode);
                var wait            = (from a in waitApproveList
                                       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 = a.NodeApproveStatus
                }).Distinct(new Code.EqualComparer <Dto.ApplyCar.ApplyCarListDto>((x, y) => x.Id == y.Id)).OrderByDescending(m => m.ApproveDate);
                WaitListPage(vm, wait);
            }
        }
        //待审批
        private void WaitApproveList(OfficeListModel vm, IEnumerable <tbWeOAFlowDetail> workflowApproveList)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var waitApproveList = OAWeWorkFlow.GetWaitApproveList(db, flowTypeCode);
                var wait            = (from a in waitApproveList
                                       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 = a.NodeApproveStatus
                }).Distinct(new Code.EqualComparer <Dto.Office.OfficeListDto>((x, y) => x.Id == y.Id)).OrderByDescending(m => m.ApproveDate);
                //分页
                WaitListPage(vm, wait);
            }
        }