|
|
|
@ -20,11 +20,18 @@ namespace Yavsc.Models.Haircut
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// Bill description
|
|
|
|
|
public override string Description { get
|
|
|
|
|
string _description = null;
|
|
|
|
|
public override string Description
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
string type = ResourcesHelpers.GlobalLocalizer[this.GetType().Name];
|
|
|
|
|
string gender = ResourcesHelpers.GlobalLocalizer[this.Prestation.Gender.ToString()];
|
|
|
|
|
return $"{type} ({gender})";
|
|
|
|
|
return $"{_description} {type} ({gender})";
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_description = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -73,24 +80,25 @@ namespace Yavsc.Models.Haircut
|
|
|
|
|
|
|
|
|
|
List<IBillItem> bill = new List<IBillItem>();
|
|
|
|
|
|
|
|
|
|
if (this.Prestation==null) throw new InvalidOperationException("Prestation property is null");
|
|
|
|
|
if (this.SelectedProfile==null) throw new InvalidOperationException("SelectedProfile property is null");
|
|
|
|
|
if (this.Prestation == null) throw new InvalidOperationException("Prestation property is null");
|
|
|
|
|
if (this.SelectedProfile == null) throw new InvalidOperationException("SelectedProfile property is null");
|
|
|
|
|
// Le shampoing
|
|
|
|
|
if (this.Prestation.Shampoo)
|
|
|
|
|
bill.Add(new CommandLine { Name = "Shampoing", Description="Shampoing", UnitaryCost = SelectedProfile.ShampooPrice });
|
|
|
|
|
bill.Add(new CommandLine { Name = "Shampoing", Description = "Shampoing", UnitaryCost = SelectedProfile.ShampooPrice });
|
|
|
|
|
|
|
|
|
|
// la coupe
|
|
|
|
|
if (Prestation.Cut) {
|
|
|
|
|
if (Prestation.Cut)
|
|
|
|
|
{
|
|
|
|
|
bill.Add(new CommandLine
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Name = "Coupe",
|
|
|
|
|
Description = $"Coupe "+
|
|
|
|
|
ResourcesHelpers.GlobalLocalizer[Prestation.Gender.ToString()]+ " "+
|
|
|
|
|
Description = $"Coupe " +
|
|
|
|
|
ResourcesHelpers.GlobalLocalizer[Prestation.Gender.ToString()] + " " +
|
|
|
|
|
(Prestation.Gender == HairCutGenders.Women ?
|
|
|
|
|
Prestation.Length == HairLength.Long ? longhairsuffix :
|
|
|
|
|
Prestation.Length == HairLength.HalfLong ? halflonghairsuffix :
|
|
|
|
|
shorthairsuffix: null),
|
|
|
|
|
shorthairsuffix : null),
|
|
|
|
|
UnitaryCost =
|
|
|
|
|
Prestation.Gender == HairCutGenders.Women ?
|
|
|
|
|
Prestation.Length == HairLength.Long ? SelectedProfile.WomenLongCutPrice :
|
|
|
|
@ -364,10 +372,14 @@ Prestation.Gender == HairCutGenders.Women ?
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// les soins
|
|
|
|
|
if (Prestation.Cares) {
|
|
|
|
|
bill.Add(new CommandLine { Name = "Soins",
|
|
|
|
|
if (Prestation.Cares)
|
|
|
|
|
{
|
|
|
|
|
bill.Add(new CommandLine
|
|
|
|
|
{
|
|
|
|
|
Name = "Soins",
|
|
|
|
|
Description = "Soins",
|
|
|
|
|
UnitaryCost = SelectedProfile.CarePrice });
|
|
|
|
|
UnitaryCost = SelectedProfile.CarePrice
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return bill;
|
|
|
|
@ -376,27 +388,30 @@ Prestation.Gender == HairCutGenders.Women ?
|
|
|
|
|
public HairCutPayementEvent CreatePaymentEvent(PaymentInfo info, IStringLocalizer localizer)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return new HairCutPayementEvent(Client.UserName,info,this, localizer);
|
|
|
|
|
return new HairCutPayementEvent(Client.UserName, info, this, localizer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual BrusherProfile SelectedProfile { get; set; }
|
|
|
|
|
|
|
|
|
|
public HairCutQueryEvent CreateEvent(string subTopic, string reason, string sender) {
|
|
|
|
|
public HairCutQueryEvent CreateEvent(string subTopic, string reason, string sender)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
string evdate = EventDate?.ToString("dddd dd/MM/yyyy à HH:mm")??"[pas de date spécifiée]";
|
|
|
|
|
string address = Location?.Address??"[pas de lieu spécifié]";
|
|
|
|
|
string evdate = EventDate?.ToString("dddd dd/MM/yyyy à HH:mm") ?? "[pas de date spécifiée]";
|
|
|
|
|
string address = Location?.Address ?? "[pas de lieu spécifié]";
|
|
|
|
|
var p = Prestation;
|
|
|
|
|
string total = GetBillItems().Addition().ToString("C",CultureInfo.CurrentUICulture);
|
|
|
|
|
string total = GetBillItems().Addition().ToString("C", CultureInfo.CurrentUICulture);
|
|
|
|
|
string strprestation = Description;
|
|
|
|
|
string bill = string.Join("\n", GetBillItems().Select(
|
|
|
|
|
l=> $"{l.Name} {l.Description} {l.UnitaryCost} € " +
|
|
|
|
|
((l.Count != 1) ? "*"+l.Count.ToString() : "")));
|
|
|
|
|
l => $"{l.Name} {l.Description} {l.UnitaryCost} € " +
|
|
|
|
|
((l.Count != 1) ? "*" + l.Count.ToString() : "")));
|
|
|
|
|
var yaev = new HairCutQueryEvent(subTopic)
|
|
|
|
|
{
|
|
|
|
|
Client = new ClientProviderInfo {
|
|
|
|
|
UserName = Client.UserName ,
|
|
|
|
|
UserId =ClientId,
|
|
|
|
|
Avatar = Client.Avatar } ,
|
|
|
|
|
Client = new ClientProviderInfo
|
|
|
|
|
{
|
|
|
|
|
UserName = Client.UserName,
|
|
|
|
|
UserId = ClientId,
|
|
|
|
|
Avatar = Client.Avatar
|
|
|
|
|
},
|
|
|
|
|
Previsional = Previsional,
|
|
|
|
|
EventDate = EventDate,
|
|
|
|
|
Location = Location,
|
|
|
|
|