une commande de coupe de cheveux
This commit is contained in:
18
Yavsc/Helpers/BankInfoHelpers.cs
Normal file
18
Yavsc/Helpers/BankInfoHelpers.cs
Normal file
@ -0,0 +1,18 @@
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
using Models.Bank;
|
||||
public static class BankInfoHelpers
|
||||
{
|
||||
public static bool IsValid(this BankIdentity info) {
|
||||
return ByIbanBIC(info) || ByAccountNumber(info) ;
|
||||
}
|
||||
public static bool ByIbanBIC(this BankIdentity info) {
|
||||
return (info.BIC != null && info.IBAN != null) ;
|
||||
}
|
||||
public static bool ByAccountNumber(this BankIdentity info){
|
||||
|
||||
return (info.BankCode != null && info.WicketCode != null && info.AccountNumber != null && info.BankedKey >0);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -12,7 +12,7 @@ namespace Yavsc.Helpers
|
||||
IStringLocalizer SR)
|
||||
{
|
||||
var yaev = new RdvQueryEvent
|
||||
{
|
||||
{
|
||||
Sender = query.ClientId,
|
||||
Message = string.Format(SR["RdvToPerf"],
|
||||
query.Client.UserName,
|
||||
@ -21,8 +21,8 @@ namespace Yavsc.Helpers
|
||||
query.ActivityCode)+
|
||||
"\n"+query.Reason,
|
||||
Client = new ClientProviderInfo {
|
||||
UserName = query.Client.UserName ,
|
||||
UserId = query.ClientId,
|
||||
UserName = query.Client.UserName ,
|
||||
UserId = query.ClientId,
|
||||
Avatar = query.Client.Avatar } ,
|
||||
Previsional = query.Previsional,
|
||||
EventDate = query.EventDate,
|
||||
@ -37,22 +37,22 @@ namespace Yavsc.Helpers
|
||||
IStringLocalizer SR)
|
||||
{
|
||||
var yaev = new HairCutQueryEvent
|
||||
{
|
||||
{
|
||||
Sender = query.ClientId,
|
||||
Message = string.Format(SR["RdvToPerf"],
|
||||
query.Client.UserName,
|
||||
query.EventDate.ToString("dddd dd/MM/yyyy à HH:mm"),
|
||||
query.Location.Address,
|
||||
query.EventDate?.ToString("dddd dd/MM/yyyy à HH:mm")??"[pas de date spécifiée]",
|
||||
query.Location?.Address??"[pas de lieu spécifié]",
|
||||
query.ActivityCode),
|
||||
Client = new ClientProviderInfo {
|
||||
UserName = query.Client.UserName ,
|
||||
UserId = query.ClientId,
|
||||
UserName = query.Client.UserName ,
|
||||
UserId = query.ClientId,
|
||||
Avatar = query.Client.Avatar } ,
|
||||
Previsional = query.Previsional,
|
||||
EventDate = query.EventDate,
|
||||
Location = query.Location,
|
||||
Id = query.Id,
|
||||
Reason = "Coupe particulier",
|
||||
Reason = "Coupe pour un particulier",
|
||||
ActivityCode = query.ActivityCode
|
||||
};
|
||||
return yaev;
|
||||
@ -62,7 +62,7 @@ namespace Yavsc.Helpers
|
||||
IStringLocalizer SR)
|
||||
{
|
||||
var yaev = new HairCutQueryEvent
|
||||
{
|
||||
{
|
||||
Sender = query.ClientId,
|
||||
Message = string.Format(SR["RdvToPerf"],
|
||||
query.Client.UserName,
|
||||
@ -70,8 +70,8 @@ namespace Yavsc.Helpers
|
||||
query.Location.Address,
|
||||
query.ActivityCode),
|
||||
Client = new ClientProviderInfo {
|
||||
UserName = query.Client.UserName ,
|
||||
UserId = query.ClientId,
|
||||
UserName = query.Client.UserName ,
|
||||
UserId = query.ClientId,
|
||||
Avatar = query.Client.Avatar } ,
|
||||
Previsional = query.Previsional,
|
||||
EventDate = query.EventDate,
|
||||
|
130
Yavsc/Helpers/HaircutHelpers.cs
Normal file
130
Yavsc/Helpers/HaircutHelpers.cs
Normal file
@ -0,0 +1,130 @@
|
||||
using Yavsc.Models.Haircut;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
public static class HaircutHelpers
|
||||
{
|
||||
public static decimal Addition (this HairPrestation p, BrusherProfile profile)
|
||||
{
|
||||
decimal sub=0;
|
||||
// Le shampoing
|
||||
sub += p.Shampoo ? profile.ShampooPrice:0;
|
||||
|
||||
// la coupe
|
||||
sub += p.Cut ? p.Gender == HairCutGenders.Women ?
|
||||
p.Length == HairLength.Long ? profile.WomenLongCutPrice :
|
||||
p.Length == HairLength.HalfLong ? profile.WomenHalfCutPrice :
|
||||
profile.WomenShortCutPrice : p.Gender == HairCutGenders.Man ?
|
||||
profile.ManCutPrice : profile.KidCutPrice : 0;
|
||||
|
||||
// Les techniques
|
||||
switch (p.Tech) {
|
||||
case HairTechnos.Color:
|
||||
bool multicolor = p.Taints.Count>1;
|
||||
switch (p.Length) {
|
||||
case HairLength.Long:
|
||||
sub += sub += multicolor? profile.LongMultiColorPrice : profile.LongColorPrice;
|
||||
break;
|
||||
case HairLength.HalfLong: sub += multicolor? profile.HalfMultiColorPrice : profile.HalfColorPrice;
|
||||
break;
|
||||
default:
|
||||
sub += multicolor? profile.ShortMultiColorPrice : profile.ShortColorPrice;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case HairTechnos.Balayage:
|
||||
switch (p.Length) {
|
||||
case HairLength.Long:
|
||||
sub += profile.LongBalayagePrice;
|
||||
break;
|
||||
case HairLength.HalfLong: sub += profile.HalfBalayagePrice;
|
||||
break;
|
||||
default:
|
||||
sub += profile.ShortBalayagePrice;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case HairTechnos.Defris:
|
||||
switch (p.Length) {
|
||||
case HairLength.Long:
|
||||
sub += profile.LongDefrisPrice;
|
||||
break;
|
||||
case HairLength.HalfLong: sub += profile.HalfDefrisPrice;
|
||||
break;
|
||||
default:
|
||||
sub += profile.ShortDefrisPrice;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case HairTechnos.Mech:
|
||||
switch (p.Length) {
|
||||
case HairLength.Long:
|
||||
sub += profile.LongMechPrice;
|
||||
break;
|
||||
case HairLength.HalfLong: sub += profile.HalfMechPrice;
|
||||
break;
|
||||
default:
|
||||
sub += profile.ShortMechPrice;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case HairTechnos.Permanent:
|
||||
switch (p.Length) {
|
||||
case HairLength.Long:
|
||||
sub += profile.LongPermanentPrice;
|
||||
break;
|
||||
case HairLength.HalfLong: sub += profile.HalfPermanentPrice;
|
||||
break;
|
||||
default:
|
||||
sub += profile.ShortPermanentPrice;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// Les coiffages
|
||||
switch (p.Dressing) {
|
||||
case HairDressings.Brushing:
|
||||
switch (p.Gender) {
|
||||
case HairCutGenders.Women:
|
||||
switch (p.Length) {
|
||||
case HairLength.Long:
|
||||
sub += profile.LongBrushingPrice;
|
||||
break;
|
||||
case HairLength.HalfLong: sub += profile.HalfBrushingPrice;
|
||||
break;
|
||||
default:
|
||||
sub += profile.ShortBrushingPrice;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case HairCutGenders.Man:
|
||||
sub += profile.ManBrushPrice;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case HairDressings.Coiffage:
|
||||
// est offert
|
||||
break;
|
||||
case HairDressings.Folding:
|
||||
switch (p.Length) {
|
||||
case HairLength.Long:
|
||||
sub += profile.LongFoldingPrice;
|
||||
break;
|
||||
case HairLength.HalfLong: sub += profile.HalfFoldingPrice;
|
||||
break;
|
||||
default:
|
||||
sub += profile.ShortFoldingPrice;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// les soins
|
||||
sub += p.Cares ? profile.CarePrice:0;
|
||||
return sub;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user