refactoring

This commit is contained in:
Paul Schneider 2018-08-01 03:12:08 +02:00
commit fb044dabcb
16 changed files with 11 additions and 53 deletions

View file

@ -18,7 +18,7 @@ namespace Yavsc.Models.Billing
public string GetInvoiceId() { return GetType().Name + "/" + Id; }
public abstract long Id { get; set; }
public abstract string GetDescription ();
public abstract string Description { get; }
[Required()]
public bool Consent { get; set; }

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; }

View file

@ -61,15 +61,8 @@ namespace Yavsc.Server.Models.IT
{
return bill;
}
public string Description { get; set; }
public override string GetDescription()
{
return Description;
}
string description;
public override string Description => description;
public Project()
{

View file

@ -42,10 +42,7 @@ namespace Yavsc.Models.Workflow
[Display(Name="GiveAnExplicitReason")]
public string Reason { get; set; }
public override string GetDescription ()
{
return "Rendez-vous";
}
public override string Description => "Rendez-vous";
public RdvQuery()
{