refactoring
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
@ -5,7 +5,7 @@ using Yavsc.Services;
|
||||
namespace Yavsc.Billing
|
||||
{
|
||||
public interface IBillable {
|
||||
string GetDescription ();
|
||||
string Description { get; }
|
||||
List<IBillItem> GetBillItems();
|
||||
long Id { get; set; }
|
||||
|
||||
|
@ -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; }
|
||||
|
@ -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() : "")));
|
||||
|
@ -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; }
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -10,7 +10,6 @@ namespace Yavsc.WebApi.Controllers
|
||||
using Models;
|
||||
using Models.Account;
|
||||
using ViewModels.Account;
|
||||
using Models.Auth;
|
||||
using Yavsc.Helpers;
|
||||
using System.Linq;
|
||||
using Microsoft.Data.Entity;
|
||||
|
@ -10,7 +10,6 @@ using Yavsc.Server.Helpers;
|
||||
using Yavsc.Models.Workflow;
|
||||
using Yavsc.Models.Payment;
|
||||
using Yavsc.Server.Models.IT.SourceCode;
|
||||
using Microsoft.AspNet.Mvc.Localization;
|
||||
using Microsoft.Extensions.Localization;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
|
@ -40,7 +40,7 @@ namespace Yavsc.Helpers
|
||||
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.GetDescription();
|
||||
string strprestation = query.Description;
|
||||
|
||||
var yaev = query.CreateEvent("NewHairCutQuery",
|
||||
string.Format(ResourcesHelpers.GlobalLocalizer["HairCutQueryValidation"],query.Client.UserName),
|
||||
|
@ -83,7 +83,7 @@ namespace Yavsc.Helpers
|
||||
SetExpressCheckoutRequestDetails = new SetExpressCheckoutRequestDetailsType
|
||||
{
|
||||
PaymentDetails = new List<PaymentDetailsType>( new [] { new PaymentDetailsType{
|
||||
OrderDescription = query.GetDescription(),
|
||||
OrderDescription = query.Description,
|
||||
OrderTotal = new BasicAmountType {
|
||||
currencyID = CurrencyCodeType.EUR,
|
||||
value = total
|
||||
|
@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.Data.Entity.Infrastructure;
|
||||
using Microsoft.Data.Entity.Metadata;
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
using Yavsc.Models;
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
|
@ -1,8 +1,6 @@
|
||||
using System;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.Data.Entity.Infrastructure;
|
||||
using Microsoft.Data.Entity.Metadata;
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
using Yavsc.Models;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
|
@ -1,23 +1,4 @@
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using MailKit.Net.Smtp;
|
||||
using MimeKit;
|
||||
using MailKit.Security;
|
||||
using System;
|
||||
using Yavsc.Models.Messaging;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Google.Messaging;
|
||||
using System.Collections.Generic;
|
||||
using Yavsc.Models.Haircut;
|
||||
using Yavsc.Interfaces.Workflow;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Server.Helpers;
|
||||
using Yavsc.Abstract.Manage;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.OptionsModel;
|
||||
|
||||
namespace Yavsc.Services
|
||||
{
|
||||
// This class is used by the application to send Email and SMS
|
||||
|
@ -6,7 +6,6 @@ using System.Security.Claims;
|
||||
using System.Security.Principal;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using OAuth.AspNet.AuthServer;
|
||||
using Yavsc.Models;
|
||||
|
Reference in New Issue
Block a user