本文整理汇总了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());
}
示例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());
}