当前位置: 首页>>代码示例>>C#>>正文


C# List.AsQueryable方法代码示例

本文整理汇总了C#中iTextSharp.text.List.AsQueryable方法的典型用法代码示例。如果您正苦于以下问题:C# List.AsQueryable方法的具体用法?C# List.AsQueryable怎么用?C# List.AsQueryable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iTextSharp.text.List的用法示例。


在下文中一共展示了List.AsQueryable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Index

        public ActionResult Index()
        {
            List<String> roles =(List<String>)Session["roles"];
            List<EmployeeLeaveRequestViewModel> requestViewModelList = new List<EmployeeLeaveRequestViewModel>();
            Dictionary<LeaveRequestInfo, LeaveRequestDescription> leaveRequests = new Dictionary<LeaveRequestInfo, LeaveRequestDescription>();

            if (roles == null) {

                return RedirectToAction("Index", "Login");
            }

            foreach (string role in roles) {

                if (role.Equals("Super User")) {

                    leaveRequests = getAllLeaveRequests(db);
                }
            }
            if (leaveRequests.Count == 0)
            {
                leaveRequests = getLRForCurrentUser();

            }
            foreach (KeyValuePair<LeaveRequestInfo,LeaveRequestDescription> pair in leaveRequests)
            {

                LeaveRequestInfo reqInfo = pair.Key;
                LeaveRequestDescription reqDesc = pair.Value;

                EmployeeLeaveRequestViewModel viewModel = new EmployeeLeaveRequestViewModel()
            {
                    AllDayEvent = reqDesc.AllDayEvent,
                    DeliveryManager = reqDesc.DeliveryManager,
                    DeliveryManagerStatus = reqDesc.DeliveryManagerStatus,
                    DepartmentManager = reqDesc.DepartmentManager,
                    DepartmentManagerStatus = reqDesc.DepartmentManagerStatus,
                    Description = reqDesc.Description,
                    Employee = reqInfo.Employee,
                    EndTime = reqDesc.EndTime,
                    LeaveReason = reqDesc.LeaveReason,
                    LeaveRequestID = reqInfo.LeaveRequestInfoID,
                    StartTime = reqDesc.StartTime,
                    DepartmentManagerComment = reqDesc.DepartmentManagerComment,
                    DeliveryManagerComment = reqDesc.DeliveryManagerComment

                };

                requestViewModelList.Add(viewModel);
            }
            return View(requestViewModelList.AsQueryable());
        }
开发者ID:Besermenji,项目名称:LeaveManager,代码行数:51,代码来源:EmployeeLeaveRequestViewModelsController.cs

示例2: Index

        // GET: EmployeeLeaveRequestViewModels
        public ActionResult Index()
        {
            //var employeeLeaveRequestViewModels = db.LeaveRequests.Include(e => e.leaveReason).Include(e => e.deliveryManagerStatus).Include(e => e.departmentManagerStatus);
            List<String> roles =(List<String>)Session["roles"];
            List<EmployeeLeaveRequestViewModel> requestViewModelList = new List<EmployeeLeaveRequestViewModel>();
            List<LeaveRequest> leaveRequests = new List<LeaveRequest>();
            foreach (string role in roles) {

                if (role.Equals("Super User")) {
                    leaveRequests = db.LeaveRequests.ToList();
                }

            }
            if (leaveRequests.Count == 0) {
                leaveRequests = getLRForCurrentUser();
            }

            foreach (LeaveRequest req in leaveRequests)
            {

                EmployeeLeaveRequestViewModel viewModel = new EmployeeLeaveRequestViewModel()
                {
                    allDayEvent = req.allDayEvent,
                    deliveryManager = req.deliveryManager,
                    deliveryManagerStatus = req.deliveryManagerStatus,
                    departmentManager = req.departmentManager,
                    departmentManagerStatus = req.departmentManagerStatus,
                    Description = req.Description,
                    employee = req.employee,
                    endTime = req.endTime,
                    leaveReason = req.leaveReason,
                    leaveRequestID = req.leaveRequestID,
                    startTime = req.startTime,
                    departmentManagerComment = req.departmentManagerComment,
                    deliveryManagerComment = req.deliveryManagerComment

                };

                requestViewModelList.Add(viewModel);

            }
            return View(requestViewModelList.AsQueryable());
        }
开发者ID:Besermenji,项目名称:LeaveManager,代码行数:44,代码来源:EmployeeLeaveRequestViewModelsController.cs


注:本文中的iTextSharp.text.List.AsQueryable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。