REORG
This commit is contained in:
parent
8d68ee380a
commit
45514010f2
3505 changed files with 154 additions and 523 deletions
77
src/Org/Helpers/EventHelpers.cs
Normal file
77
src/Org/Helpers/EventHelpers.cs
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
using Microsoft.Extensions.Localization;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
using Models.Workflow;
|
||||
using Models.Messaging;
|
||||
using Yavsc.Models.Haircut;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Billing;
|
||||
using Yavsc.Abstract.Identity;
|
||||
|
||||
public static class EventHelpers
|
||||
{
|
||||
public static RdvQueryEvent CreateEvent(this RdvQuery query, string subtopic)
|
||||
{
|
||||
var yaev = new RdvQueryEvent(subtopic)
|
||||
{
|
||||
Sender = query.ClientId,
|
||||
Reason = query.Reason,
|
||||
Client = new ClientProviderInfo {
|
||||
UserName = query.Client.UserName ,
|
||||
UserId = query.ClientId,
|
||||
Avatar = query.Client.Avatar } ,
|
||||
Previsional = query.Previsional,
|
||||
EventDate = query.EventDate,
|
||||
Location = query.Location,
|
||||
Id = query.Id,
|
||||
ActivityCode = query.ActivityCode,
|
||||
BillingCode = BillingCodes.Rdv
|
||||
};
|
||||
|
||||
return yaev;
|
||||
}
|
||||
|
||||
|
||||
public static HairCutQueryEvent CreateNewHairCutQueryEvent(this HairCutQuery query,
|
||||
IStringLocalizer<HairCutQuery> SR)
|
||||
{
|
||||
string evdate = query.EventDate?.ToString("dddd dd/MM/yyyy à hh:mm")??"[pas de date spécifiée]";
|
||||
string address = query.Location?.Address??"[pas de lieu spécifié]";
|
||||
var p = query.Prestation;
|
||||
string strprestation = query.Description;
|
||||
|
||||
var yaev = query.CreateEvent("NewHairCutQuery",
|
||||
string.Format(SR["HairCutQueryValidation"],query.Client.UserName),
|
||||
$"{query.Client.Id}");
|
||||
|
||||
|
||||
return yaev;
|
||||
}
|
||||
public static string GetSender(this ApplicationUser user)
|
||||
{
|
||||
return user.UserName+" ["+user.Id+"@"+Config.Authority+"]";
|
||||
}
|
||||
public static HairCutQueryEvent CreateEvent(this HairMultiCutQuery query,
|
||||
IStringLocalizer SR, BrusherProfile bpr)
|
||||
{
|
||||
var yaev = new HairCutQueryEvent("newCommand")
|
||||
{
|
||||
Sender = query.ClientId,
|
||||
|
||||
Client = new ClientProviderInfo {
|
||||
UserName = query.Client.UserName ,
|
||||
UserId = query.ClientId,
|
||||
Avatar = query.Client.Avatar } ,
|
||||
Previsional = query.Previsional,
|
||||
EventDate = query.EventDate,
|
||||
Location = query.Location,
|
||||
Id = query.Id,
|
||||
Reason = "Commande groupée!",
|
||||
ActivityCode = query.ActivityCode,
|
||||
BillingCode = BillingCodes.MBrush
|
||||
};
|
||||
return yaev;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue