files tree made better.
This commit is contained in:
parent
ffbf032480
commit
ccc91bbf19
1630 changed files with 18209 additions and 41860 deletions
22
src/Yavsc/Helpers/ListItemHelpers.cs
Normal file
22
src/Yavsc/Helpers/ListItemHelpers.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Workflow;
|
||||
|
||||
namespace Yavsc.Helpers {
|
||||
public static class ListItemHelpers {
|
||||
|
||||
public static List<SelectListItem> ActivityItems(
|
||||
this ApplicationDbContext _dbContext, List<UserActivity> activity)
|
||||
{
|
||||
List<SelectListItem> items = _dbContext.Activities.Select(
|
||||
x=> new SelectListItem() {
|
||||
Value = x.Code, Text = x.Name, Selected = activity.Any(a=>a.DoesCode == x.Code)
|
||||
} ).ToList();
|
||||
|
||||
return items;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue