2017-01-31 13:19:12 +01:00
|
|
|
|
2017-01-13 16:31:40 +01:00
|
|
|
|
|
|
|
|
namespace Yavsc.Helpers
|
|
|
|
|
{
|
2017-02-03 15:25:47 +01:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2023-03-19 17:57:55 +00:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
2017-02-03 15:25:47 +01:00
|
|
|
using Yavsc.Models;
|
2018-06-15 15:44:21 +02:00
|
|
|
using Yavsc.Services;
|
|
|
|
|
using Yavsc.ViewModels.FrontOffice;
|
|
|
|
|
|
2017-01-13 16:31:40 +01:00
|
|
|
public static class WorkflowHelpers
|
|
|
|
|
{
|
2025-02-24 23:29:48 +00:00
|
|
|
public static async Task<List<PerformerProfileViewModel>> ListPerformersAsync(this ApplicationDbContext context,
|
2018-06-15 15:44:21 +02:00
|
|
|
IBillingService billing,
|
|
|
|
|
string actCode)
|
2017-02-03 15:25:47 +01:00
|
|
|
{
|
2018-06-15 15:44:21 +02:00
|
|
|
|
|
|
|
|
var actors = context.Performers
|
2017-02-03 15:25:47 +01:00
|
|
|
.Include(p=>p.Activity)
|
|
|
|
|
.Include(p=>p.Performer)
|
2018-06-15 15:44:21 +02:00
|
|
|
.Where(p => p.Active && p.Activity.Any(u=>u.DoesCode==actCode)).OrderBy( x => x.Rate )
|
|
|
|
|
.ToArray();
|
2025-02-24 23:29:48 +00:00
|
|
|
|
|
|
|
|
List<PerformerProfileViewModel> result = new ();
|
|
|
|
|
foreach (var a in actors)
|
|
|
|
|
{
|
|
|
|
|
var settings = await billing.GetPerformersSettingsAsync(actCode, a.PerformerId);
|
|
|
|
|
result.Add(new PerformerProfileViewModel(a, actCode,settings));
|
|
|
|
|
}
|
2018-06-15 15:44:21 +02:00
|
|
|
|
2019-08-20 16:49:38 +01:00
|
|
|
return result;
|
2017-02-03 15:25:47 +01:00
|
|
|
}
|
2017-05-12 16:29:47 +02:00
|
|
|
|
2017-01-13 16:31:40 +01:00
|
|
|
}
|
2017-05-12 16:29:47 +02:00
|
|
|
}
|