diff --git a/Yavsc.Abstract/Authentication/OAuthenticator.cs b/Yavsc.Abstract/Authentication/OAuthenticator.cs index 28ad2bf7..001ff40f 100644 --- a/Yavsc.Abstract/Authentication/OAuthenticator.cs +++ b/Yavsc.Abstract/Authentication/OAuthenticator.cs @@ -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; diff --git a/Yavsc.Abstract/Billing/IBillable.cs b/Yavsc.Abstract/Billing/IBillable.cs index 91349057..dfc9ee0f 100644 --- a/Yavsc.Abstract/Billing/IBillable.cs +++ b/Yavsc.Abstract/Billing/IBillable.cs @@ -5,7 +5,7 @@ using Yavsc.Services; namespace Yavsc.Billing { public interface IBillable { - string GetDescription (); + string Description { get; } List GetBillItems(); long Id { get; set; } diff --git a/Yavsc.Server/Models/Billing/NominativeServiceCommand.cs b/Yavsc.Server/Models/Billing/NominativeServiceCommand.cs index 0ccf7991..c60cdcd1 100644 --- a/Yavsc.Server/Models/Billing/NominativeServiceCommand.cs +++ b/Yavsc.Server/Models/Billing/NominativeServiceCommand.cs @@ -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; } diff --git a/Yavsc.Server/Models/HairCut/HairCutQuery.cs b/Yavsc.Server/Models/HairCut/HairCutQuery.cs index 5554d11e..4b407efd 100644 --- a/Yavsc.Server/Models/HairCut/HairCutQuery.cs +++ b/Yavsc.Server/Models/HairCut/HairCutQuery.cs @@ -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() : ""))); diff --git a/Yavsc.Server/Models/HairCut/HairMultiCutQuery.cs b/Yavsc.Server/Models/HairCut/HairMultiCutQuery.cs index 544fd5bb..025c66d5 100644 --- a/Yavsc.Server/Models/HairCut/HairMultiCutQuery.cs +++ b/Yavsc.Server/Models/HairCut/HairMultiCutQuery.cs @@ -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; } diff --git a/Yavsc.Server/Models/IT/Project.cs b/Yavsc.Server/Models/IT/Project.cs index 58f0b380..b1b8a1f9 100644 --- a/Yavsc.Server/Models/IT/Project.cs +++ b/Yavsc.Server/Models/IT/Project.cs @@ -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() { diff --git a/Yavsc.Server/Models/Workflow/RdvQuery.cs b/Yavsc.Server/Models/Workflow/RdvQuery.cs index 84a63770..6ad089b3 100644 --- a/Yavsc.Server/Models/Workflow/RdvQuery.cs +++ b/Yavsc.Server/Models/Workflow/RdvQuery.cs @@ -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() { diff --git a/Yavsc/ApiControllers/AccountController.cs b/Yavsc/ApiControllers/AccountController.cs index a28f495f..e3e55a44 100644 --- a/Yavsc/ApiControllers/AccountController.cs +++ b/Yavsc/ApiControllers/AccountController.cs @@ -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; diff --git a/Yavsc/Controllers/IT/ProjectController.cs b/Yavsc/Controllers/IT/ProjectController.cs index e85a98f7..c40971cf 100644 --- a/Yavsc/Controllers/IT/ProjectController.cs +++ b/Yavsc/Controllers/IT/ProjectController.cs @@ -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 diff --git a/Yavsc/Helpers/EventHelpers.cs b/Yavsc/Helpers/EventHelpers.cs index 7e23b26d..2297c690 100644 --- a/Yavsc/Helpers/EventHelpers.cs +++ b/Yavsc/Helpers/EventHelpers.cs @@ -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), diff --git a/Yavsc/Helpers/PayPalHelpers.cs b/Yavsc/Helpers/PayPalHelpers.cs index 575cf1d9..e5238ec3 100644 --- a/Yavsc/Helpers/PayPalHelpers.cs +++ b/Yavsc/Helpers/PayPalHelpers.cs @@ -83,7 +83,7 @@ namespace Yavsc.Helpers SetExpressCheckoutRequestDetails = new SetExpressCheckoutRequestDetailsType { PaymentDetails = new List( new [] { new PaymentDetailsType{ - OrderDescription = query.GetDescription(), + OrderDescription = query.Description, OrderTotal = new BasicAmountType { currencyID = CurrencyCodeType.EUR, value = total diff --git a/Yavsc/Migrations/20180722232456_gitrepo.Designer.cs b/Yavsc/Migrations/20180722232456_gitrepo.Designer.cs index e07a5510..722053f1 100644 --- a/Yavsc/Migrations/20180722232456_gitrepo.Designer.cs +++ b/Yavsc/Migrations/20180722232456_gitrepo.Designer.cs @@ -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; diff --git a/Yavsc/Migrations/20180722232456_gitrepo.cs b/Yavsc/Migrations/20180722232456_gitrepo.cs index 33cd8eda..2ffac7f1 100644 --- a/Yavsc/Migrations/20180722232456_gitrepo.cs +++ b/Yavsc/Migrations/20180722232456_gitrepo.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using Microsoft.Data.Entity.Migrations; namespace Yavsc.Migrations diff --git a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs index aada393c..c8c55f1e 100644 --- a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs @@ -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 diff --git a/Yavsc/Services/MessageServices.cs b/Yavsc/Services/MessageServices.cs index 67b99c3b..d22650eb 100755 --- a/Yavsc/Services/MessageServices.cs +++ b/Yavsc/Services/MessageServices.cs @@ -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 diff --git a/Yavsc/Startup/Startup.OAuthHelpers.cs b/Yavsc/Startup/Startup.OAuthHelpers.cs index 43a53412..be266038 100644 --- a/Yavsc/Startup/Startup.OAuthHelpers.cs +++ b/Yavsc/Startup/Startup.OAuthHelpers.cs @@ -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;