From 51b4ee2286198d4f3012491ac83bab95ff348a59 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 6 Nov 2016 02:03:36 +0100 Subject: [PATCH] estimate to LaTeX --- Yavsc/Controllers/FrontOfficeController.cs | 20 +- Yavsc/Controllers/ManageController.cs | 18 +- Yavsc/Helpers/TeXHelpers.cs | 15 + Yavsc/Interfaces/Workflow/IEstimate.cs | 1 - Yavsc/Migrations/20161010102616_recontact.cs | 2 - ...143022_estimateClientApprouval.Designer.cs | 1 - .../20161020143022_estimateClientApprouval.cs | 1 - .../20161020212947_userAddress.Designer.cs | 1 - .../Migrations/20161020212947_userAddress.cs | 3 +- .../20161021153306_estimateLines.Designer.cs | 1 - .../20161021153306_estimateLines.cs | 3 +- .../20161101234703_chatConnection.Designer.cs | 1 - .../20161101234703_chatConnection.cs | 3 +- .../20161102132129_fixCxOwner.Designer.cs | 1 - Yavsc/Migrations/20161102132129_fixCxOwner.cs | 3 +- .../20161102133253_fix2CxOwner.Designer.cs | 1 - .../Migrations/20161102133253_fix2CxOwner.cs | 3 +- ...61104164949_dropEstimateStatus.Designer.cs | 833 ++++++++++++++++++ .../20161104164949_dropEstimateStatus.cs | 278 ++++++ .../ApplicationDbContextModelSnapshot.cs | 2 - Yavsc/Model/Billing/Estimate.cs | 17 +- .../Yavsc.Resources.YavscLocalisation.fr.resx | 1 + .../ViewModels/Manage/AddBankInfoViewModel.cs | 24 + Yavsc/ViewModels/Manage/IndexViewModel.cs | 3 + Yavsc/Views/Estimate/Details.cshtml | 8 +- Yavsc/Views/FrontOffice/Estimate.tex.cshtml | 33 +- Yavsc/Views/FrontOffice/tmp.cshtml | 91 -- Yavsc/Views/Manage/AddBankInfo.cshtml | 65 ++ Yavsc/Views/Manage/Index.cshtml | 9 +- 29 files changed, 1294 insertions(+), 148 deletions(-) create mode 100644 Yavsc/Helpers/TeXHelpers.cs create mode 100644 Yavsc/Migrations/20161104164949_dropEstimateStatus.Designer.cs create mode 100644 Yavsc/Migrations/20161104164949_dropEstimateStatus.cs create mode 100644 Yavsc/ViewModels/Manage/AddBankInfoViewModel.cs delete mode 100644 Yavsc/Views/FrontOffice/tmp.cshtml create mode 100644 Yavsc/Views/Manage/AddBankInfo.cshtml diff --git a/Yavsc/Controllers/FrontOfficeController.cs b/Yavsc/Controllers/FrontOfficeController.cs index 218bacb8..a7b8fb8c 100644 --- a/Yavsc/Controllers/FrontOfficeController.cs +++ b/Yavsc/Controllers/FrontOfficeController.cs @@ -87,9 +87,8 @@ namespace Yavsc.Controllers )); } - [Produces("text/x-tex"), Authorize, - Route("estimate-{id}.tex")] - public ViewResult Estimate(long id) + [Produces("text/x-tex"), Authorize, Route("estimate-{id}.tex")] + public ViewResult EstimateTex(long id) { var estimate = _context.Estimates.Include(x=>x.Query) .Include(x=>x.Query.Client) @@ -97,10 +96,21 @@ namespace Yavsc.Controllers .Include(x=>x.Query.PerformerProfile.OrganizationAddress) .Include(x=>x.Query.PerformerProfile.Performer) .Include(e=>e.Bill).FirstOrDefault(x=>x.Id==id); - ViewBag.From = estimate.Query.PerformerProfile.Performer; - ViewBag.To = estimate.Query.Client; Response.ContentType = "text/x-tex"; return View("Estimate.tex", estimate); } + + + [Produces("application/x-pdf"), Authorize, Route("estimate-{id}.pdf")] + public ViewResult EstimatePdf(long id) + { + var estimate = _context.Estimates.Include(x=>x.Query) + .Include(x=>x.Query.Client) + .Include(x=>x.Query.PerformerProfile) + .Include(x=>x.Query.PerformerProfile.OrganizationAddress) + .Include(x=>x.Query.PerformerProfile.Performer) + .Include(e=>e.Bill).FirstOrDefault(x=>x.Id==id); + return View("Estimate.pdf", estimate); + } } } \ No newline at end of file diff --git a/Yavsc/Controllers/ManageController.cs b/Yavsc/Controllers/ManageController.cs index d9fe2630..a954e3cb 100644 --- a/Yavsc/Controllers/ManageController.cs +++ b/Yavsc/Controllers/ManageController.cs @@ -105,7 +105,8 @@ namespace Yavsc.Controllers Roles = await _userManager.GetRolesAsync(user), PostalAddress = user.PostalAddress?.Address, FullName = user.FullName, - Avatar = user.Avatar + Avatar = user.Avatar, + BankInfo = user.BankInfo }; if (_dbContext.Performers.Any(x => x.PerformerId == user.Id)) { @@ -296,6 +297,21 @@ namespace Yavsc.Controllers else return Redirect(model.ReturnUrl); } + [HttpGet,Authorize] + public async Task AddBankInfo() + { + var user = await _userManager.FindByIdAsync(User.GetUserId()); + + return View(new AddBankInfoViewModel( + user.BankInfo)); + } + + [HttpGet,Authorize] + public async Task SetFullName() + { + var user = await _userManager.FindByIdAsync(User.GetUserId()); + return View(user.FullName); + } // // POST: /Manage/ChangePassword [HttpPost] diff --git a/Yavsc/Helpers/TeXHelpers.cs b/Yavsc/Helpers/TeXHelpers.cs new file mode 100644 index 00000000..2157520a --- /dev/null +++ b/Yavsc/Helpers/TeXHelpers.cs @@ -0,0 +1,15 @@ +using System.Linq; + +namespace Yavsc.Helpers +{ + public static class TeXHelpers + { + public static string NewLinesWith(this string target, string separator) + { + var items = target.Split(new char[] {'\n'}).Where( + s=> !string.IsNullOrWhiteSpace(s) ) ; + + return string.Join(separator, items); + } + } +} \ No newline at end of file diff --git a/Yavsc/Interfaces/Workflow/IEstimate.cs b/Yavsc/Interfaces/Workflow/IEstimate.cs index 6e5ced18..82a10833 100644 --- a/Yavsc/Interfaces/Workflow/IEstimate.cs +++ b/Yavsc/Interfaces/Workflow/IEstimate.cs @@ -1,7 +1,6 @@ namespace Yavsc.Interfaces { using System.Collections.Generic; - using Yavsc.Interfaces.Workflow; using Yavsc.Models.Billing; public interface IEstimate { diff --git a/Yavsc/Migrations/20161010102616_recontact.cs b/Yavsc/Migrations/20161010102616_recontact.cs index 64749937..6cd94920 100644 --- a/Yavsc/Migrations/20161010102616_recontact.cs +++ b/Yavsc/Migrations/20161010102616_recontact.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using Microsoft.Data.Entity.Migrations; namespace Yavsc.Migrations diff --git a/Yavsc/Migrations/20161020143022_estimateClientApprouval.Designer.cs b/Yavsc/Migrations/20161020143022_estimateClientApprouval.Designer.cs index f37b13ca..027d1c0b 100644 --- a/Yavsc/Migrations/20161020143022_estimateClientApprouval.Designer.cs +++ b/Yavsc/Migrations/20161020143022_estimateClientApprouval.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/20161020143022_estimateClientApprouval.cs b/Yavsc/Migrations/20161020143022_estimateClientApprouval.cs index d72d7778..0f8a62ad 100644 --- a/Yavsc/Migrations/20161020143022_estimateClientApprouval.cs +++ b/Yavsc/Migrations/20161020143022_estimateClientApprouval.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using Microsoft.Data.Entity.Migrations; namespace Yavsc.Migrations diff --git a/Yavsc/Migrations/20161020212947_userAddress.Designer.cs b/Yavsc/Migrations/20161020212947_userAddress.Designer.cs index af31f4b6..08865733 100644 --- a/Yavsc/Migrations/20161020212947_userAddress.Designer.cs +++ b/Yavsc/Migrations/20161020212947_userAddress.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/20161020212947_userAddress.cs b/Yavsc/Migrations/20161020212947_userAddress.cs index 66feda9e..9305ad21 100644 --- a/Yavsc/Migrations/20161020212947_userAddress.cs +++ b/Yavsc/Migrations/20161020212947_userAddress.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; + using Microsoft.Data.Entity.Migrations; namespace Yavsc.Migrations diff --git a/Yavsc/Migrations/20161021153306_estimateLines.Designer.cs b/Yavsc/Migrations/20161021153306_estimateLines.Designer.cs index ca84e3ae..5eab2c3a 100644 --- a/Yavsc/Migrations/20161021153306_estimateLines.Designer.cs +++ b/Yavsc/Migrations/20161021153306_estimateLines.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/20161021153306_estimateLines.cs b/Yavsc/Migrations/20161021153306_estimateLines.cs index d2d1ed67..85e5b151 100644 --- a/Yavsc/Migrations/20161021153306_estimateLines.cs +++ b/Yavsc/Migrations/20161021153306_estimateLines.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; + using Microsoft.Data.Entity.Migrations; namespace Yavsc.Migrations diff --git a/Yavsc/Migrations/20161101234703_chatConnection.Designer.cs b/Yavsc/Migrations/20161101234703_chatConnection.Designer.cs index ba38ecd3..1a4be8e8 100644 --- a/Yavsc/Migrations/20161101234703_chatConnection.Designer.cs +++ b/Yavsc/Migrations/20161101234703_chatConnection.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/20161101234703_chatConnection.cs b/Yavsc/Migrations/20161101234703_chatConnection.cs index 21d91356..8e76f3a4 100644 --- a/Yavsc/Migrations/20161101234703_chatConnection.cs +++ b/Yavsc/Migrations/20161101234703_chatConnection.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; + using Microsoft.Data.Entity.Migrations; namespace Yavsc.Migrations diff --git a/Yavsc/Migrations/20161102132129_fixCxOwner.Designer.cs b/Yavsc/Migrations/20161102132129_fixCxOwner.Designer.cs index 09904ca2..fa762772 100644 --- a/Yavsc/Migrations/20161102132129_fixCxOwner.Designer.cs +++ b/Yavsc/Migrations/20161102132129_fixCxOwner.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/20161102132129_fixCxOwner.cs b/Yavsc/Migrations/20161102132129_fixCxOwner.cs index 41a50039..b482299d 100644 --- a/Yavsc/Migrations/20161102132129_fixCxOwner.cs +++ b/Yavsc/Migrations/20161102132129_fixCxOwner.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; + using Microsoft.Data.Entity.Migrations; namespace Yavsc.Migrations diff --git a/Yavsc/Migrations/20161102133253_fix2CxOwner.Designer.cs b/Yavsc/Migrations/20161102133253_fix2CxOwner.Designer.cs index 677cb754..050a1a82 100644 --- a/Yavsc/Migrations/20161102133253_fix2CxOwner.Designer.cs +++ b/Yavsc/Migrations/20161102133253_fix2CxOwner.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/20161102133253_fix2CxOwner.cs b/Yavsc/Migrations/20161102133253_fix2CxOwner.cs index 6b4b4c50..4f7673b1 100644 --- a/Yavsc/Migrations/20161102133253_fix2CxOwner.cs +++ b/Yavsc/Migrations/20161102133253_fix2CxOwner.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; + using Microsoft.Data.Entity.Migrations; namespace Yavsc.Migrations diff --git a/Yavsc/Migrations/20161104164949_dropEstimateStatus.Designer.cs b/Yavsc/Migrations/20161104164949_dropEstimateStatus.Designer.cs new file mode 100644 index 00000000..efbe04ab --- /dev/null +++ b/Yavsc/Migrations/20161104164949_dropEstimateStatus.Designer.cs @@ -0,0 +1,833 @@ +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 +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20161104164949_dropEstimateStatus")] + partial class dropEstimateStatus + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "7.0.0-rc1-16348"); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRole", b => + { + b.Property("Id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Name") + .HasAnnotation("MaxLength", 256); + + b.Property("NormalizedName") + .HasAnnotation("MaxLength", 256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .HasAnnotation("Relational:Name", "RoleNameIndex"); + + b.HasAnnotation("Relational:TableName", "AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("RoleId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasAnnotation("Relational:TableName", "AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasAnnotation("Relational:TableName", "AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin", b => + { + b.Property("LoginProvider"); + + b.Property("ProviderKey"); + + b.Property("ProviderDisplayName"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasAnnotation("Relational:TableName", "AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole", b => + { + b.Property("UserId"); + + b.Property("RoleId"); + + b.HasKey("UserId", "RoleId"); + + b.HasAnnotation("Relational:TableName", "AspNetUserRoles"); + }); + + modelBuilder.Entity("Yavsc.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Address") + .IsRequired() + .HasAnnotation("MaxLength", 512); + + b.Property("Latitude"); + + b.Property("Longitude"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Model.Bank.BankIdentity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccountNumber") + .HasAnnotation("MaxLength", 15); + + b.Property("BIC") + .HasAnnotation("MaxLength", 15); + + b.Property("BankCode") + .HasAnnotation("MaxLength", 5); + + b.Property("BankedKey"); + + b.Property("IBAN") + .HasAnnotation("MaxLength", 33); + + b.Property("WicketCode") + .HasAnnotation("MaxLength", 5); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Model.Chat.Connection", b => + { + b.Property("ConnectionId"); + + b.Property("ApplicationUserId"); + + b.Property("Connected"); + + b.Property("UserAgent"); + + b.HasKey("ConnectionId"); + }); + + modelBuilder.Entity("Yavsc.Model.ClientProviderInfo", b => + { + b.Property("UserId"); + + b.Property("Avatar"); + + b.Property("BillingAddressId"); + + b.Property("ChatHubConnectionId"); + + b.Property("EMail"); + + b.Property("Phone"); + + b.Property("Rate"); + + b.Property("UserName"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.Property("UserId"); + + b.Property("ContactCredits"); + + b.Property("Credits"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Activity", b => + { + b.Property("Code") + .HasAnnotation("MaxLength", 512); + + b.Property("ActorDenomination"); + + b.Property("Description"); + + b.Property("ModeratorGroupName"); + + b.Property("Name") + .IsRequired() + .HasAnnotation("MaxLength", 512); + + b.Property("Photo"); + + b.HasKey("Code"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.Property("Id"); + + b.Property("AccessFailedCount"); + + b.Property("Avatar") + .HasAnnotation("MaxLength", 512); + + b.Property("BankInfoId"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("DedicatedGoogleCalendar"); + + b.Property("Email") + .HasAnnotation("MaxLength", 256); + + b.Property("EmailConfirmed"); + + b.Property("FullName") + .HasAnnotation("MaxLength", 512); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("NormalizedEmail") + .HasAnnotation("MaxLength", 256); + + b.Property("NormalizedUserName") + .HasAnnotation("MaxLength", 256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("PostalAddressId"); + + b.Property("SecurityStamp"); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasAnnotation("MaxLength", 256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasAnnotation("Relational:Name", "EmailIndex"); + + b.HasIndex("NormalizedUserName") + .HasAnnotation("Relational:Name", "UserNameIndex"); + + b.HasAnnotation("Relational:TableName", "AspNetUsers"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.Client", b => + { + b.Property("Id"); + + b.Property("Active"); + + b.Property("DisplayName"); + + b.Property("LogoutRedirectUri") + .HasAnnotation("MaxLength", 100); + + b.Property("RedirectUri"); + + b.Property("RefreshTokenLifeTime"); + + b.Property("Secret"); + + b.Property("Type"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.RefreshToken", b => + { + b.Property("Id"); + + b.Property("ClientId") + .IsRequired() + .HasAnnotation("MaxLength", 50); + + b.Property("ExpiresUtc"); + + b.Property("IssuedUtc"); + + b.Property("ProtectedTicket") + .IsRequired(); + + b.Property("Subject") + .IsRequired() + .HasAnnotation("MaxLength", 50); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BalanceId") + .IsRequired(); + + b.Property("ExecDate"); + + b.Property("Impact"); + + b.Property("Reason") + .IsRequired(); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ArticleId"); + + b.Property("Count"); + + b.Property("Description") + .IsRequired() + .HasAnnotation("MaxLength", 512); + + b.Property("EstimateId"); + + b.Property("EstimateTemplateId"); + + b.Property("UnitaryCost"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AttachedFilesString"); + + b.Property("AttachedGraphicsString"); + + b.Property("ClientApprouvalDate"); + + b.Property("ClientId") + .IsRequired(); + + b.Property("CommandId"); + + b.Property("CommandType"); + + b.Property("Description"); + + b.Property("LatestValidationDate"); + + b.Property("OwnerId") + .IsRequired(); + + b.Property("Title"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.EstimateTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Description"); + + b.Property("OwnerId") + .IsRequired(); + + b.Property("Title"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.ExceptionSIREN", b => + { + b.Property("SIREN"); + + b.HasKey("SIREN"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AuthorId"); + + b.Property("Content"); + + b.Property("Modified"); + + b.Property("Photo"); + + b.Property("Posted") + .ValueGeneratedOnAdd() + .HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP"); + + b.Property("Rate"); + + b.Property("Title"); + + b.Property("Visible"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClientId") + .IsRequired(); + + b.Property("CreationDate") + .ValueGeneratedOnAdd() + .HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP"); + + b.Property("EventDate"); + + b.Property("LocationId"); + + b.Property("PerformerId") + .IsRequired(); + + b.Property("Previsional"); + + b.Property("ValidationDate"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Circle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ApplicationUserId"); + + b.Property("Name"); + + b.Property("OwnerId"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.CircleMember", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CircleId"); + + b.Property("MemberId") + .IsRequired(); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Contact", b => + { + b.Property("OwnerId"); + + b.Property("UserId"); + + b.Property("ApplicationUserId"); + + b.HasKey("OwnerId", "UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b => + { + b.Property("DeviceId"); + + b.Property("DeclarationDate") + .ValueGeneratedOnAdd() + .HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP"); + + b.Property("DeviceOwnerId"); + + b.Property("GCMRegistrationId") + .IsRequired(); + + b.Property("Model"); + + b.Property("Platform"); + + b.Property("Version"); + + b.HasKey("DeviceId"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.BaseProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Description"); + + b.Property("Discriminator") + .IsRequired(); + + b.Property("Name"); + + b.Property("Public"); + + b.HasKey("Id"); + + b.HasAnnotation("Relational:DiscriminatorProperty", "Discriminator"); + + b.HasAnnotation("Relational:DiscriminatorValue", "BaseProduct"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ContextId"); + + b.Property("Description"); + + b.Property("Name"); + + b.Property("Public"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.OAuth.OAuth2Tokens", b => + { + b.Property("UserId"); + + b.Property("AccessToken"); + + b.Property("Expiration"); + + b.Property("ExpiresIn"); + + b.Property("RefreshToken"); + + b.Property("TokenType"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.PostTag", b => + { + b.Property("PostId"); + + b.Property("TagId"); + + b.HasKey("PostId", "TagId"); + }); + + modelBuilder.Entity("Yavsc.Models.Skill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.Property("Rate"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name") + .IsRequired(); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.Property("PerformerId"); + + b.Property("AcceptGeoLocalization"); + + b.Property("AcceptNotifications"); + + b.Property("AcceptPublicContact"); + + b.Property("Active"); + + b.Property("ActivityCode") + .IsRequired(); + + b.Property("MaxDailyCost"); + + b.Property("MinDailyCost"); + + b.Property("OfferId"); + + b.Property("OrganizationAddressId"); + + b.Property("Rate"); + + b.Property("SIREN") + .IsRequired() + .HasAnnotation("MaxLength", 14); + + b.Property("WebSite"); + + b.HasKey("PerformerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Product", b => + { + b.HasBaseType("Yavsc.Models.Market.BaseProduct"); + + b.Property("Depth"); + + b.Property("Height"); + + b.Property("Price"); + + b.Property("Weight"); + + b.Property("Width"); + + b.HasAnnotation("Relational:DiscriminatorValue", "Product"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole") + .WithMany() + .HasForeignKey("RoleId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole") + .WithMany() + .HasForeignKey("RoleId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Model.Chat.Connection", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId"); + }); + + modelBuilder.Entity("Yavsc.Model.ClientProviderInfo", b => + { + b.HasOne("Yavsc.Location") + .WithMany() + .HasForeignKey("BillingAddressId"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithOne() + .HasForeignKey("Yavsc.Models.AccountBalance", "UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.HasOne("Yavsc.Model.Bank.BankIdentity") + .WithMany() + .HasForeignKey("BankInfoId"); + + b.HasOne("Yavsc.Location") + .WithMany() + .HasForeignKey("PostalAddressId"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.HasOne("Yavsc.Models.AccountBalance") + .WithMany() + .HasForeignKey("BalanceId"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.HasOne("Yavsc.Models.Market.BaseProduct") + .WithMany() + .HasForeignKey("ArticleId"); + + b.HasOne("Yavsc.Models.Billing.Estimate") + .WithMany() + .HasForeignKey("EstimateId"); + + b.HasOne("Yavsc.Models.Billing.EstimateTemplate") + .WithMany() + .HasForeignKey("EstimateTemplateId"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.HasOne("Yavsc.Models.Booking.BookQuery") + .WithMany() + .HasForeignKey("CommandId"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("AuthorId"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("ClientId"); + + b.HasOne("Yavsc.Location") + .WithMany() + .HasForeignKey("LocationId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Circle", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId"); + }); + + modelBuilder.Entity("Yavsc.Models.CircleMember", b => + { + b.HasOne("Yavsc.Models.Circle") + .WithMany() + .HasForeignKey("CircleId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("MemberId"); + }); + + modelBuilder.Entity("Yavsc.Models.Contact", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("DeviceOwnerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.HasOne("Yavsc.Models.Activity") + .WithMany() + .HasForeignKey("ContextId"); + }); + + modelBuilder.Entity("Yavsc.Models.PostTag", b => + { + b.HasOne("Yavsc.Models.Blog") + .WithMany() + .HasForeignKey("PostId"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.HasOne("Yavsc.Models.Activity") + .WithMany() + .HasForeignKey("ActivityCode"); + + b.HasOne("Yavsc.Models.Market.Service") + .WithMany() + .HasForeignKey("OfferId"); + + b.HasOne("Yavsc.Location") + .WithMany() + .HasForeignKey("OrganizationAddressId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("PerformerId"); + }); + } + } +} diff --git a/Yavsc/Migrations/20161104164949_dropEstimateStatus.cs b/Yavsc/Migrations/20161104164949_dropEstimateStatus.cs new file mode 100644 index 00000000..7c6ae53c --- /dev/null +++ b/Yavsc/Migrations/20161104164949_dropEstimateStatus.cs @@ -0,0 +1,278 @@ +using System; +using System.Collections.Generic; +using Microsoft.Data.Entity.Migrations; + +namespace Yavsc.Migrations +{ + public partial class dropEstimateStatus : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim_IdentityRole_RoleId", table: "AspNetRoleClaims"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim_ApplicationUser_UserId", table: "AspNetUserClaims"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin_ApplicationUser_UserId", table: "AspNetUserLogins"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole_IdentityRole_RoleId", table: "AspNetUserRoles"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole_ApplicationUser_UserId", table: "AspNetUserRoles"); + migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance"); + migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact"); + migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine"); + migrationBuilder.DropForeignKey(name: "FK_BookQuery_ApplicationUser_ClientId", table: "BookQuery"); + migrationBuilder.DropForeignKey(name: "FK_BookQuery_PerformerProfile_PerformerId", table: "BookQuery"); + migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember"); + migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember"); + migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Activity_ActivityCode", table: "PerformerProfile"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile"); + migrationBuilder.DropColumn(name: "Status", table: "Estimate"); + migrationBuilder.AddForeignKey( + name: "FK_IdentityRoleClaim_IdentityRole_RoleId", + table: "AspNetRoleClaims", + column: "RoleId", + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserClaim_ApplicationUser_UserId", + table: "AspNetUserClaims", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserLogin_ApplicationUser_UserId", + table: "AspNetUserLogins", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserRole_IdentityRole_RoleId", + table: "AspNetUserRoles", + column: "RoleId", + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserRole_ApplicationUser_UserId", + table: "AspNetUserRoles", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_AccountBalance_ApplicationUser_UserId", + table: "AccountBalance", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_BalanceImpact_AccountBalance_BalanceId", + table: "BalanceImpact", + column: "BalanceId", + principalTable: "AccountBalance", + principalColumn: "UserId", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_CommandLine_Estimate_EstimateId", + table: "CommandLine", + column: "EstimateId", + principalTable: "Estimate", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_BookQuery_ApplicationUser_ClientId", + table: "BookQuery", + column: "ClientId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_BookQuery_PerformerProfile_PerformerId", + table: "BookQuery", + column: "PerformerId", + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_CircleMember_Circle_CircleId", + table: "CircleMember", + column: "CircleId", + principalTable: "Circle", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_CircleMember_ApplicationUser_MemberId", + table: "CircleMember", + column: "MemberId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_PostTag_Blog_PostId", + table: "PostTag", + column: "PostId", + principalTable: "Blog", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_Activity_ActivityCode", + table: "PerformerProfile", + column: "ActivityCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_Location_OrganizationAddressId", + table: "PerformerProfile", + column: "OrganizationAddressId", + principalTable: "Location", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_ApplicationUser_PerformerId", + table: "PerformerProfile", + column: "PerformerId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim_IdentityRole_RoleId", table: "AspNetRoleClaims"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim_ApplicationUser_UserId", table: "AspNetUserClaims"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin_ApplicationUser_UserId", table: "AspNetUserLogins"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole_IdentityRole_RoleId", table: "AspNetUserRoles"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole_ApplicationUser_UserId", table: "AspNetUserRoles"); + migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance"); + migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact"); + migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine"); + migrationBuilder.DropForeignKey(name: "FK_BookQuery_ApplicationUser_ClientId", table: "BookQuery"); + migrationBuilder.DropForeignKey(name: "FK_BookQuery_PerformerProfile_PerformerId", table: "BookQuery"); + migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember"); + migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember"); + migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Activity_ActivityCode", table: "PerformerProfile"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile"); + migrationBuilder.AddColumn( + name: "Status", + table: "Estimate", + nullable: true); + migrationBuilder.AddForeignKey( + name: "FK_IdentityRoleClaim_IdentityRole_RoleId", + table: "AspNetRoleClaims", + column: "RoleId", + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserClaim_ApplicationUser_UserId", + table: "AspNetUserClaims", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserLogin_ApplicationUser_UserId", + table: "AspNetUserLogins", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserRole_IdentityRole_RoleId", + table: "AspNetUserRoles", + column: "RoleId", + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserRole_ApplicationUser_UserId", + table: "AspNetUserRoles", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_AccountBalance_ApplicationUser_UserId", + table: "AccountBalance", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_BalanceImpact_AccountBalance_BalanceId", + table: "BalanceImpact", + column: "BalanceId", + principalTable: "AccountBalance", + principalColumn: "UserId", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_CommandLine_Estimate_EstimateId", + table: "CommandLine", + column: "EstimateId", + principalTable: "Estimate", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_BookQuery_ApplicationUser_ClientId", + table: "BookQuery", + column: "ClientId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_BookQuery_PerformerProfile_PerformerId", + table: "BookQuery", + column: "PerformerId", + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_CircleMember_Circle_CircleId", + table: "CircleMember", + column: "CircleId", + principalTable: "Circle", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_CircleMember_ApplicationUser_MemberId", + table: "CircleMember", + column: "MemberId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_PostTag_Blog_PostId", + table: "PostTag", + column: "PostId", + principalTable: "Blog", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_Activity_ActivityCode", + table: "PerformerProfile", + column: "ActivityCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_Location_OrganizationAddressId", + table: "PerformerProfile", + column: "OrganizationAddressId", + principalTable: "Location", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_ApplicationUser_PerformerId", + table: "PerformerProfile", + column: "PerformerId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + } +} diff --git a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs index dca0444a..e76b8d63 100644 --- a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs @@ -372,8 +372,6 @@ namespace Yavsc.Migrations b.Property("OwnerId") .IsRequired(); - b.Property("Status"); - b.Property("Title"); b.HasKey("Id"); diff --git a/Yavsc/Model/Billing/Estimate.cs b/Yavsc/Model/Billing/Estimate.cs index 21dc8216..67405153 100644 --- a/Yavsc/Model/Billing/Estimate.cs +++ b/Yavsc/Model/Billing/Estimate.cs @@ -1,13 +1,14 @@ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; + namespace Yavsc.Models.Billing { - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Linq; - using Yavsc.Interfaces; - using Yavsc.Interfaces.Workflow; - using Yavsc.Models.Booking; + using Interfaces; + using Models.Booking; public partial class Estimate : IEstimate { [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)] diff --git a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.fr.resx b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.fr.resx index 1f297824..ba0b5098 100644 --- a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.fr.resx +++ b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.fr.resx @@ -209,6 +209,7 @@ Base de données éxistante Inscriptions externes Veuillez, s'il vous plait, utiliser une date future. + Saisir vos coordonées bancaires Saisissez votre demande de rendez-vous Contenu à accès restreint Mot de passe perdu? diff --git a/Yavsc/ViewModels/Manage/AddBankInfoViewModel.cs b/Yavsc/ViewModels/Manage/AddBankInfoViewModel.cs new file mode 100644 index 00000000..7969a518 --- /dev/null +++ b/Yavsc/ViewModels/Manage/AddBankInfoViewModel.cs @@ -0,0 +1,24 @@ +namespace Yavsc.ViewModels.Manage +{ + using Model.Bank; + public class AddBankInfoViewModel + { + public BankIdentity Data{get; private set; } + public AddBankInfoViewModel(BankIdentity data) + { + this.Data = data; + } + + public bool IsValid { get { + return ByIbanBIC || ByAccountNumber ; + }} + public bool ByIbanBIC { get {  + return (Data.BIC != null && Data.IBAN != null) ; + }} + public bool ByAccountNumber {  + get {  + return (Data.BankCode != null && Data.WicketCode != null && Data.AccountNumber != null && Data.BankedKey >0); + } + } + } +} \ No newline at end of file diff --git a/Yavsc/ViewModels/Manage/IndexViewModel.cs b/Yavsc/ViewModels/Manage/IndexViewModel.cs index df4c142c..7067598c 100644 --- a/Yavsc/ViewModels/Manage/IndexViewModel.cs +++ b/Yavsc/ViewModels/Manage/IndexViewModel.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Microsoft.AspNet.Identity; +using Yavsc.Model.Bank; using Yavsc.Models; namespace Yavsc.ViewModels.Manage @@ -35,5 +36,7 @@ namespace Yavsc.ViewModels.Manage public string FullName { get; set; } public string PostalAddress { get; set; } + + public BankIdentity BankInfo { get; set; } } } diff --git a/Yavsc/Views/Estimate/Details.cshtml b/Yavsc/Views/Estimate/Details.cshtml index 3ecb1b8b..ae367964 100644 --- a/Yavsc/Views/Estimate/Details.cshtml +++ b/Yavsc/Views/Estimate/Details.cshtml @@ -35,6 +35,10 @@

- Edit | - Back to List + @SR["Edit"] | + @SR["Back to List"] | + @{ var filenametex = $"estimate-{Model.Id}.tex" ; + var filenamepdf = $"estimate-{Model.Id}.pdf" ;} + Export au format LaTeX + Export au format LaTeX

diff --git a/Yavsc/Views/FrontOffice/Estimate.tex.cshtml b/Yavsc/Views/FrontOffice/Estimate.tex.cshtml index 69ec0273..9633eba9 100644 --- a/Yavsc/Views/FrontOffice/Estimate.tex.cshtml +++ b/Yavsc/Views/FrontOffice/Estimate.tex.cshtml @@ -1,9 +1,14 @@ @model Estimate +@using Yavsc.Helpers @{ Layout = null; var pro = Model.Query.PerformerProfile; var from = Model.Query.PerformerProfile.Performer; var to = Model.Query.Client; + var PostalAddress = (to.PostalAddress!=null) ? to.PostalAddress.Address.Replace("\n","\\\\\n") : null ; + var proaddr = Model.Query?.PerformerProfile.OrganizationAddress.Address; + var proaddrn = (proaddr!=null) ? proaddr.NewLinesWith("\\\\\n") : null ; + var proaddrm = (proaddr!=null) ? proaddr.NewLinesWith(" - ") : null ; } \documentclass[french,11pt]{article} \usepackage{babel} @@ -62,7 +67,7 @@ \def\FactureNum {@Model.Id.ToString()} % Numéro de facture \def\FactureAcquittee {non} % Facture acquittée : oui/non -\def\FactureLieu {@Model.Query.PerformerProfile.OrganizationAddress} % Lieu de l'édition de la facture +\def\FactureLieu {@proaddrn} % Lieu de l'édition de la facture \def\FactureObjet {Facture : @Model.Title} % Objet du document % Description de la facture \def\FactureDescr { @@ -70,18 +75,16 @@ } % Infos Client -\def\ClientNom{@ViewBag.To.UserName} % Nom du client +\def\ClientNom{@to.UserName} % Nom du client \def\ClientAdresse{ % Adresse du client - @if (ViewBag.To.PostalAddress!=null) { - @ViewBag.To.PostalAddress.Address.Replace("\n","\\\\\n") - } - @if (!string.IsNullOrWhiteSpace(ViewBag.To.PhoneNumber)) { - \\ Téléphone fixe: @ViewBag.To.PhoneNumber +@if (!string.IsNullOrWhiteSpace(PostalAddress)) { + @PostalAddress\\ } + @if (!string.IsNullOrWhiteSpace(to.PhoneNumber)) { + @to.PhoneNumber \\ } -@if (!string.IsNullOrWhiteSpace(ViewBag.To.Email)) { - \\ E-mail: @ViewBag.To.Email } + E-mail: @to.Email } % Liste des produits facturés : Désignation, prix @@ -106,12 +109,10 @@ \setlength{\parindent}{0pt} \renewcommand{\headrulewidth}{0pt} -\cfoot{ - @if (!string.IsNullOrWhiteSpace(ViewBag.From.UserName)) { @ViewBag.From.UserName } - @if (!string.IsNullOrWhiteSpace(ViewBag.From.PostalAddress)) { - @ViewBag.From.PostalAddress.Address } } \newline - \small{ - @if (!string.IsNullOrWhiteSpace(ViewBag.From.Email)) { E-mail: @ViewBag.From.Email } - @if (!string.IsNullOrWhiteSpace(ViewBag.From.PhoneNumber)) { - Téléphone fixe: @ViewBag.From.PhoneNumber } +\cfoot{ @if (!string.IsNullOrWhiteSpace(from.UserName)) { @from.UserName } + @if (!string.IsNullOrWhiteSpace(proaddrm)) { - @proaddrm } \newline + \small{ E-mail: @from.Email + @if (!string.IsNullOrWhiteSpace(from.PhoneNumber)) { - Téléphone fixe: @from.PhoneNumber } } } @@ -125,7 +126,7 @@ } % Nom et adresse de la société @from.UserName \\ - @pro.OrganizationAddress.Address + @proaddrn Facture n°\FactureNum diff --git a/Yavsc/Views/FrontOffice/tmp.cshtml b/Yavsc/Views/FrontOffice/tmp.cshtml deleted file mode 100644 index 1b1e9f81..00000000 --- a/Yavsc/Views/FrontOffice/tmp.cshtml +++ /dev/null @@ -1,91 +0,0 @@ - - - - -\geometry{verbose,tmargin=4em,bmargin=8em,lmargin=6em,rmargin=6em} -\setlength{\parindent}{0pt} -\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex} - -\thispagestyle{fancy} -\pagestyle{fancy} -\setlength{\parindent}{0pt} - -\renewcommand{\headrulewidth}{0pt} -\cfoot{ - @if (!string.IsNullOrWhiteSpace(ViewBag.From.Name)) { @ViewBag.From.Name } - @if (!string.IsNullOrWhiteSpace(ViewBag.From.Address)) { - @ViewBag.From.Address } - @if (!string.IsNullOrWhiteSpace(ViewBag.From.CityAndState)) { - @ViewBag.From.CityAndState } \newline - \small{ - @if (!string.IsNullOrWhiteSpace(ViewBag.From.Email)) { E-mail: @ViewBag.From.Email } - @if (!string.IsNullOrWhiteSpace(ViewBag.From.Mobile)) { - Téléphone mobile: @ViewBag.From.Mobile } - @if (!string.IsNullOrWhiteSpace(ViewBag.From.Phone)) { - Téléphone fixe: @ViewBag.From.Phone } - } -} - -\begin{document} - -% Logo de la société -%\includegraphics{logo.jpg} - -% Nom et adresse de la société - from.Name \\ - from.Address \\ -from.ZipCode from.CityAndState\\ - -Facture n°\FactureNum - - -{\addtolength{\leftskip}{10.5cm} %in ERT - \textbf{\ClientNom} \\ - \ClientAdresse \\ - -} %in ERT - - -\hspace*{10.5cm} -\FactureLieu, le \today - -~\\~\\ - -\textbf{Objet : \FactureObjet \\} - -\textnormal{\FactureDescr} - -~\\ - -\begin{center} - \begin{tabular}{lrrr} - \textbf{Désignation ~~~~~~} & \textbf{Prix unitaire} & \textbf{Quantité} & \textbf{Montant (EUR)} \\ - \hline - \AfficheResultat{} - \end{tabular} -\end{center} - -\begin{flushright} -\textit{Auto entreprise en franchise de TVA}\\ - -\end{flushright} -~\\ - -\ifthenelse{\equal{\FactureAcquittee}{oui}}{ - Facture acquittée. -}{ - - À régler par chèque ou par virement bancaire : - - \begin{center} - \begin{tabular}{|c c c c|} - if (!string.IsNullOrWhiteSpace(from.BankCode) && !string.IsNullOrWhiteSpace(from.WicketCode) - && !string.IsNullOrWhiteSpace(from.AccountNumber) ) { - \hline \textbf{Code banque} & \textbf{Code guichet} & \textbf{N° de Compte} & \textbf{Clé RIB} \\ - from.BankCode & from.WicketCode & from.AccountNumber & from.BankedKey \\ - } - if (!string.IsNullOrWhiteSpace(from.IBAN) && !string.IsNullOrWhiteSpace(from.BIC)) { - \hline \textbf{IBAN N°} & \multicolumn{3}{|l|}{ from.IBAN } \\ - \hline \textbf{Code BIC} & \multicolumn{3}{|l|}{ from.BIC } - } \\ - \hline - \end{tabular} - \end{center} -} -\end{document} diff --git a/Yavsc/Views/Manage/AddBankInfo.cshtml b/Yavsc/Views/Manage/AddBankInfo.cshtml new file mode 100644 index 00000000..47351abb --- /dev/null +++ b/Yavsc/Views/Manage/AddBankInfo.cshtml @@ -0,0 +1,65 @@ +@model Yavsc.ViewModels.Manage.AddBankInfoViewModel +@{ + ViewData["Title"] = SR["Fill in your Bank Info"]; +} + +

@ViewData["Title"].

+
+

Vous pouvez valider vos coordonnée bancaire ci après.

+ +
+
+ +
+
+ +
+ + +
+ +
+ + +
+
+
+
+
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ +
+
+
+
+ +
+
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } +} diff --git a/Yavsc/Views/Manage/Index.cshtml b/Yavsc/Views/Manage/Index.cshtml index a3f42a7a..60fdbd61 100755 --- a/Yavsc/Views/Manage/Index.cshtml +++ b/Yavsc/Views/Manage/Index.cshtml @@ -28,12 +28,11 @@ else {@SR["Create"]}] +
@SR["External Logins"]:
@Model.Logins.Count [@SR["Manage"]]
- -
@SR["Full name"]:
@Model.FullName [@SR[@Model.Activity==null?"Set":"Modify settings"]]
- + +
@SR["Bank info"]:
+
@Html.DisplayFor(m => m.BankInfo) [@SR[@Model.BankInfo==null?"Set":"Modify"]]
+
@SR["YourPosts"]:
@Model.PostsCounter [