REORG
This commit is contained in:
parent
8d68ee380a
commit
45514010f2
3505 changed files with 154 additions and 523 deletions
24
src/Org/Helpers/ListItemHelpers.cs
Normal file
24
src/Org/Helpers/ListItemHelpers.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.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)
|
||||
{
|
||||
var activities = activity.ToArray();
|
||||
|
||||
List<SelectListItem> items = _dbContext.Activities.Select(
|
||||
x=> new SelectListItem() {
|
||||
Value = x.Code, Text = x.Name, Selected = activities.Any(a=>a.DoesCode == x.Code)
|
||||
} ).ToList();
|
||||
|
||||
return items;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue