refactoring

This commit is contained in:
2018-08-01 03:12:08 +02:00
parent 4ab43a7874
commit 29d85a0ccf
16 changed files with 11 additions and 53 deletions

View File

@ -20,13 +20,13 @@ namespace Yavsc.Models.Haircut
{
// Bill description
public override string GetDescription()
public override string Description { get
{
string type = ResourcesHelpers.GlobalLocalizer[this.GetType().Name];
string gender = ResourcesHelpers.GlobalLocalizer[this.Prestation.Gender.ToString()];
return $"{type} ({gender})";
}
}
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@ -387,7 +387,7 @@ Prestation.Gender == HairCutGenders.Women ?
string address = Location?.Address??"[pas de lieu spécifié]";
var p = Prestation;
string total = GetBillItems().Addition().ToString("C",CultureInfo.CurrentUICulture);
string strprestation = GetDescription();
string strprestation = Description;
string bill = string.Join("\n", GetBillItems().Select(
l=> $"{l.Name} {l.Description} {l.UnitaryCost} € " +
((l.Count != 1) ? "*"+l.Count.ToString() : "")));

View File

@ -25,10 +25,7 @@ namespace Yavsc.Models.Haircut
public class HairMultiCutQuery : NominativeServiceCommand
{
// Bill description
public override string GetDescription()
{
return "Prestation en coiffure à domicile [commande groupée]";
}
public override string Description => "Prestation en coiffure à domicile [commande groupée]" ;
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
override public long Id { get; set; }