From d99e9b209f4af7237ee1ad94ac31d5af2cf2b132 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 24 Nov 2016 01:01:41 +0100 Subject: [PATCH] WIP --- Yavsc/ApiControllers/EstimateApiController.cs | 14 +- Yavsc/ApiControllers/PdfEstimateController.cs | 3 +- Yavsc/ApiControllers/PodcastController.cs | 22 + Yavsc/Helpers/FileSystemHelpers.cs | 1 - Yavsc/Helpers/TeXHelpers.cs | 2 - Yavsc/Interfaces/IFormNode.cs | 11 + ...61123235323_estimatesignatures.Designer.cs | 836 ++++++++++++++++++ .../20161123235323_estimatesignatures.cs | 306 +++++++ .../ApplicationDbContextModelSnapshot.cs | 12 +- Yavsc/Model/Billing/Contract.cs | 2 +- Yavsc/Model/Billing/Estimate.cs | 8 +- Yavsc/Model/Billing/EstimateAgreement.cs | 12 - Yavsc/Model/Forms/Field.cs | 5 +- Yavsc/ViewComponents/EstimateViewComponent.cs | 3 +- .../ViewModels/UserFiles/UserDirectoryInfo.cs | 1 - .../Shared/Components/Files/UserFiles.cshtml | 5 + 16 files changed, 1209 insertions(+), 34 deletions(-) create mode 100644 Yavsc/ApiControllers/PodcastController.cs create mode 100644 Yavsc/Interfaces/IFormNode.cs create mode 100644 Yavsc/Migrations/20161123235323_estimatesignatures.Designer.cs create mode 100644 Yavsc/Migrations/20161123235323_estimatesignatures.cs delete mode 100644 Yavsc/Model/Billing/EstimateAgreement.cs create mode 100644 Yavsc/Views/Shared/Components/Files/UserFiles.cshtml diff --git a/Yavsc/ApiControllers/EstimateApiController.cs b/Yavsc/ApiControllers/EstimateApiController.cs index e93c8181..3b35502d 100644 --- a/Yavsc/ApiControllers/EstimateApiController.cs +++ b/Yavsc/ApiControllers/EstimateApiController.cs @@ -68,6 +68,8 @@ namespace Yavsc.Controllers [HttpPut("{id}")] public IActionResult PutEstimate(long id, [FromBody] Estimate estimate) { + var valdate = DateTime.Now; + if (!ModelState.IsValid) { return HttpBadRequest(ModelState); @@ -88,7 +90,7 @@ namespace Yavsc.Controllers } var entry = _context.Attach(estimate); - estimate.LatestValidationDate = DateTime.Now; + estimate.ProviderValidationDate = valdate; try { _context.SaveChanges(); @@ -105,7 +107,7 @@ namespace Yavsc.Controllers } } - return Ok( new { Id = estimate.Id, LatestValidationDate = estimate.LatestValidationDate }); + return Ok( new { Id = estimate.Id, LatestValidationDate = valdate }); } // POST: api/Estimate @@ -125,7 +127,9 @@ namespace Yavsc.Controllers return HttpBadRequest(ModelState); } } - estimate.LatestValidationDate = DateTime.Now; + var valdate = DateTime.Now; + estimate.ProviderValidationDate = valdate; + _context.Estimates.Add(estimate); /* _context.AttachRange(estimate.Bill); _context.Attach(estimate); @@ -149,7 +153,7 @@ namespace Yavsc.Controllers throw; } } - return Ok( new { Id = estimate.Id, Bill = estimate.Bill , LatestValidationDate = estimate.LatestValidationDate }); + return Ok( new { Id = estimate.Id, Bill = estimate.Bill , LatestValidationDate = valdate }); } // DELETE: api/Estimate/5 @@ -182,7 +186,7 @@ namespace Yavsc.Controllers return Ok(estimate); } - protected override void Dispose(bool disposing) + protected override void Dispose (bool disposing) { if (disposing) { diff --git a/Yavsc/ApiControllers/PdfEstimateController.cs b/Yavsc/ApiControllers/PdfEstimateController.cs index 10ba682e..9328cf87 100644 --- a/Yavsc/ApiControllers/PdfEstimateController.cs +++ b/Yavsc/ApiControllers/PdfEstimateController.cs @@ -1,7 +1,6 @@ using System.IO; using Microsoft.AspNet.Authorization; using Microsoft.AspNet.Mvc; -using System.Threading.Tasks; using System.Web.Routing; using Microsoft.AspNet.Mvc.ViewComponents; using Microsoft.AspNet.Razor; @@ -84,7 +83,7 @@ namespace Yavsc.ApiControllers } [HttpPost("gen/{id}")] - public async Task GeneratePdf(long id) + public IActionResult GeneratePdf(long id) { return ViewComponent("Estimate",new object[] { id, true } ); } diff --git a/Yavsc/ApiControllers/PodcastController.cs b/Yavsc/ApiControllers/PodcastController.cs new file mode 100644 index 00000000..8bb5a5db --- /dev/null +++ b/Yavsc/ApiControllers/PodcastController.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Concurrent; +using System.Net.WebSockets; +using System.Threading.Tasks; +using Microsoft.AspNet.Mvc; + +namespace Yavsc.ApiControllers +{ + public class PodcastController : Controller + { + public ArraySegment CurrentOutput ; + public bool IsEnd; + + ConcurrentBag Listeners = new ConcurrentBag(); + + public async Task Connect() + { + var socket = await this.HttpContext.WebSockets.AcceptWebSocketAsync(); + + } + } +} \ No newline at end of file diff --git a/Yavsc/Helpers/FileSystemHelpers.cs b/Yavsc/Helpers/FileSystemHelpers.cs index 2cd44afc..a4a6d745 100644 --- a/Yavsc/Helpers/FileSystemHelpers.cs +++ b/Yavsc/Helpers/FileSystemHelpers.cs @@ -2,7 +2,6 @@ using System.IO; using System.Linq; using System.Security.Claims; -using Microsoft.AspNet.FileProviders; using Yavsc.ViewModels.UserFiles; namespace Yavsc.Helpers diff --git a/Yavsc/Helpers/TeXHelpers.cs b/Yavsc/Helpers/TeXHelpers.cs index 59052165..f16ad7ba 100644 --- a/Yavsc/Helpers/TeXHelpers.cs +++ b/Yavsc/Helpers/TeXHelpers.cs @@ -3,10 +3,8 @@ using System.IO; using System.Linq; using Microsoft.AspNet.Http; using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.ModelBinding; using Microsoft.AspNet.Mvc.Rendering; using Microsoft.AspNet.Mvc.ViewEngines; -using Microsoft.AspNet.Mvc.ViewFeatures; namespace Yavsc.Helpers { diff --git a/Yavsc/Interfaces/IFormNode.cs b/Yavsc/Interfaces/IFormNode.cs new file mode 100644 index 00000000..16be861e --- /dev/null +++ b/Yavsc/Interfaces/IFormNode.cs @@ -0,0 +1,11 @@ +namespace Yavsc.Interfaces +{ + public interface IFormNode + { + + T GetControl(); + bool IsUIControl { get; } + bool IsInputControl { get; } + + } +} \ No newline at end of file diff --git a/Yavsc/Migrations/20161123235323_estimatesignatures.Designer.cs b/Yavsc/Migrations/20161123235323_estimatesignatures.Designer.cs new file mode 100644 index 00000000..23143717 --- /dev/null +++ b/Yavsc/Migrations/20161123235323_estimatesignatures.Designer.cs @@ -0,0 +1,836 @@ +using System; +using Microsoft.Data.Entity; +using Microsoft.Data.Entity.Infrastructure; +using Microsoft.Data.Entity.Migrations; +using Yavsc.Models; + +namespace Yavsc.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20161123235323_estimatesignatures")] + partial class estimatesignatures + { + 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("ClientId") + .IsRequired(); + + b.Property("ClientSignature"); + + b.Property("ClientValidationDate"); + + b.Property("CommandId"); + + b.Property("CommandType"); + + b.Property("Description"); + + b.Property("OwnerId") + .IsRequired(); + + b.Property("ProviderSignature"); + + b.Property("ProviderValidationDate"); + + 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/20161123235323_estimatesignatures.cs b/Yavsc/Migrations/20161123235323_estimatesignatures.cs new file mode 100644 index 00000000..20e5190f --- /dev/null +++ b/Yavsc/Migrations/20161123235323_estimatesignatures.cs @@ -0,0 +1,306 @@ +using System; +using Microsoft.Data.Entity.Migrations; + +namespace Yavsc.Migrations +{ + public partial class estimatesignatures : 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: "ClientApprouvalDate", table: "Estimate"); + migrationBuilder.DropColumn(name: "LatestValidationDate", table: "Estimate"); + migrationBuilder.AddColumn( + name: "ClientSignature", + table: "Estimate", + nullable: true); + migrationBuilder.AddColumn( + name: "ClientValidationDate", + table: "Estimate", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + migrationBuilder.AddColumn( + name: "ProviderSignature", + table: "Estimate", + nullable: true); + migrationBuilder.AddColumn( + name: "ProviderValidationDate", + table: "Estimate", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + 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.DropColumn(name: "ClientSignature", table: "Estimate"); + migrationBuilder.DropColumn(name: "ClientValidationDate", table: "Estimate"); + migrationBuilder.DropColumn(name: "ProviderSignature", table: "Estimate"); + migrationBuilder.DropColumn(name: "ProviderValidationDate", table: "Estimate"); + migrationBuilder.AddColumn( + name: "ClientApprouvalDate", + table: "Estimate", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + migrationBuilder.AddColumn( + name: "LatestValidationDate", + table: "Estimate", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + 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 2fbfe465..b7899ef1 100644 --- a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs @@ -354,22 +354,26 @@ namespace Yavsc.Migrations b.Property("AttachedGraphicsString"); - b.Property("ClientApprouvalDate"); - b.Property("ClientId") .IsRequired(); + b.Property("ClientSignature"); + + b.Property("ClientValidationDate"); + b.Property("CommandId"); b.Property("CommandType"); b.Property("Description"); - b.Property("LatestValidationDate"); - b.Property("OwnerId") .IsRequired(); + b.Property("ProviderSignature"); + + b.Property("ProviderValidationDate"); + b.Property("Title"); b.HasKey("Id"); diff --git a/Yavsc/Model/Billing/Contract.cs b/Yavsc/Model/Billing/Contract.cs index 896293db..ba4f11f8 100644 --- a/Yavsc/Model/Billing/Contract.cs +++ b/Yavsc/Model/Billing/Contract.cs @@ -5,7 +5,7 @@ namespace Yavsc.Models.Billing public class ServiceContract

where P : Service { - + } } \ No newline at end of file diff --git a/Yavsc/Model/Billing/Estimate.cs b/Yavsc/Model/Billing/Estimate.cs index 67405153..7609d669 100644 --- a/Yavsc/Model/Billing/Estimate.cs +++ b/Yavsc/Model/Billing/Estimate.cs @@ -69,8 +69,10 @@ namespace Yavsc.Models.Billing get; set; } - public DateTime LatestValidationDate { get; set; } - - public DateTime ClientApprouvalDate { get; set; } + public Byte [] ProviderSignature { get; set; } + public Byte [] ClientSignature { get; set; } + public DateTime ProviderValidationDate { get; set; } + public DateTime ClientValidationDate { get; set; } + } } diff --git a/Yavsc/Model/Billing/EstimateAgreement.cs b/Yavsc/Model/Billing/EstimateAgreement.cs deleted file mode 100644 index a290f900..00000000 --- a/Yavsc/Model/Billing/EstimateAgreement.cs +++ /dev/null @@ -1,12 +0,0 @@ - -using System; -using System.ComponentModel.DataAnnotations; - -namespace Yavsc.Models.Billing -{ - public partial class Contract : Estimate - { - [Required] - public DateTime ClientValidationDate { get; set; } - } -} \ No newline at end of file diff --git a/Yavsc/Model/Forms/Field.cs b/Yavsc/Model/Forms/Field.cs index e2e12b6f..2513a46f 100644 --- a/Yavsc/Model/Forms/Field.cs +++ b/Yavsc/Model/Forms/Field.cs @@ -10,11 +10,14 @@ namespace Yavsc.Model.Forms public long Id {  get; set; } public abstract Method [] ValidationMethods (); + [Required] public string Name { get; set; } public string Label { get; set; } + public string PlaceHolder { get; set; } - + + [Required] public string ValueType { get; set; } } diff --git a/Yavsc/ViewComponents/EstimateViewComponent.cs b/Yavsc/ViewComponents/EstimateViewComponent.cs index 720bc2f1..2de4c272 100644 --- a/Yavsc/ViewComponents/EstimateViewComponent.cs +++ b/Yavsc/ViewComponents/EstimateViewComponent.cs @@ -1,7 +1,6 @@ using System; using System.IO; using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNet.Mvc; using Microsoft.Data.Entity; using Yavsc.Models; @@ -17,7 +16,7 @@ namespace Yavsc.ViewComponents { this.dbContext = dbContext; } - public async Task InvokeAsync(long id, bool toPdf = false) + public IViewComponentResult InvokeAsync(long id, bool toPdf = false) { Estimate estimate = dbContext.Estimates.Include(x => x.Query) diff --git a/Yavsc/ViewModels/UserFiles/UserDirectoryInfo.cs b/Yavsc/ViewModels/UserFiles/UserDirectoryInfo.cs index 39513a87..05cb828f 100644 --- a/Yavsc/ViewModels/UserFiles/UserDirectoryInfo.cs +++ b/Yavsc/ViewModels/UserFiles/UserDirectoryInfo.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Linq; using Yavsc.Helpers; diff --git a/Yavsc/Views/Shared/Components/Files/UserFiles.cshtml b/Yavsc/Views/Shared/Components/Files/UserFiles.cshtml new file mode 100644 index 00000000..12fa7a8b --- /dev/null +++ b/Yavsc/Views/Shared/Components/Files/UserFiles.cshtml @@ -0,0 +1,5 @@ +@model UserDirectoryInfo +@{ + var files = User.GetUserFiles(); + +} \ No newline at end of file