diff --git a/BookAStar/BookAStar/Interfaces/IEstimate.cs b/BookAStar/BookAStar/Interfaces/IEstimate.cs index 662546cd..6a21f114 100644 --- a/BookAStar/BookAStar/Interfaces/IEstimate.cs +++ b/BookAStar/BookAStar/Interfaces/IEstimate.cs @@ -14,7 +14,6 @@ namespace BookAStar.Model.Interfaces string Description { get; set; } long Id { get; set; } string OwnerId { get; set; } - int? Status { get; set; } string Title { get; set; } } } \ No newline at end of file diff --git a/BookAStar/BookAStar/Model/Workflow/Estimate.cs b/BookAStar/BookAStar/Model/Workflow/Estimate.cs index 277168f7..a2cb664e 100644 --- a/BookAStar/BookAStar/Model/Workflow/Estimate.cs +++ b/BookAStar/BookAStar/Model/Workflow/Estimate.cs @@ -14,7 +14,6 @@ namespace BookAStar.Model.Workflow public string CommandType { get; set; } // Markdown expected public string Description { get; set; } - public int? Status { get; set; } public string Title { get; set; } public IList Bill { get; set; } /// diff --git a/BookAStar/BookAStar/ViewModels/EditEstimateViewModel.cs b/BookAStar/BookAStar/ViewModels/EditEstimateViewModel.cs index d639b78c..cef7746a 100644 --- a/BookAStar/BookAStar/ViewModels/EditEstimateViewModel.cs +++ b/BookAStar/BookAStar/ViewModels/EditEstimateViewModel.cs @@ -81,21 +81,6 @@ namespace BookAStar.ViewModels } } - private int? status; - [JsonIgnore] - public int? Status - { - get - { - return Data.Status; - } - - set - { - SetProperty(ref status, value, "Status"); - Data.Status = status; - } - } private string title; [JsonIgnore] public string Title diff --git a/Yavsc/Interfaces/IAccountBalance.cs b/Yavsc/Interfaces/Workflow/IAccountBalance.cs similarity index 100% rename from Yavsc/Interfaces/IAccountBalance.cs rename to Yavsc/Interfaces/Workflow/IAccountBalance.cs diff --git a/Yavsc/Interfaces/IBillingClause.cs b/Yavsc/Interfaces/Workflow/IBillingClause.cs similarity index 100% rename from Yavsc/Interfaces/IBillingClause.cs rename to Yavsc/Interfaces/Workflow/IBillingClause.cs diff --git a/Yavsc/Interfaces/ICircle.cs b/Yavsc/Interfaces/Workflow/ICircle.cs similarity index 100% rename from Yavsc/Interfaces/ICircle.cs rename to Yavsc/Interfaces/Workflow/ICircle.cs diff --git a/Yavsc/Interfaces/IContact.cs b/Yavsc/Interfaces/Workflow/IContact.cs similarity index 100% rename from Yavsc/Interfaces/IContact.cs rename to Yavsc/Interfaces/Workflow/IContact.cs diff --git a/Yavsc/Interfaces/IEstimate.cs b/Yavsc/Interfaces/Workflow/IEstimate.cs similarity index 93% rename from Yavsc/Interfaces/IEstimate.cs rename to Yavsc/Interfaces/Workflow/IEstimate.cs index 1c833cc6..6e5ced18 100644 --- a/Yavsc/Interfaces/IEstimate.cs +++ b/Yavsc/Interfaces/Workflow/IEstimate.cs @@ -1,6 +1,7 @@ namespace Yavsc.Interfaces { using System.Collections.Generic; + using Yavsc.Interfaces.Workflow; using Yavsc.Models.Billing; public interface IEstimate { @@ -13,7 +14,6 @@ string Description { get; set; } long Id { get; set; } string OwnerId { get; set; } - int? Status { get; set; } string Title { get; set; } } } \ No newline at end of file diff --git a/Yavsc/Interfaces/IEvent.cs b/Yavsc/Interfaces/Workflow/IEvent.cs similarity index 100% rename from Yavsc/Interfaces/IEvent.cs rename to Yavsc/Interfaces/Workflow/IEvent.cs diff --git a/Yavsc/Interfaces/IPerformerSpecified.cs b/Yavsc/Interfaces/Workflow/IPerformerSpecified.cs similarity index 100% rename from Yavsc/Interfaces/IPerformerSpecified.cs rename to Yavsc/Interfaces/Workflow/IPerformerSpecified.cs diff --git a/Yavsc/Interfaces/Workflow/QueryStatus.cs b/Yavsc/Interfaces/Workflow/QueryStatus.cs new file mode 100644 index 00000000..39bbbbe7 --- /dev/null +++ b/Yavsc/Interfaces/Workflow/QueryStatus.cs @@ -0,0 +1,20 @@ +namespace Yavsc.Interfaces.Workflow +{ + /// + /// Status, + /// should be associated to any + /// client user query to a provider user or + /// other external entity. + /// + public enum QueryStatus: int + { + Inserted, + OwnerValidated, + Visited, + Rejected, + Accepted, + InProgress, + Failed, + Success + } +} \ No newline at end of file diff --git a/Yavsc/Migrations/20161104090806_bankUserProfile.Designer.cs b/Yavsc/Migrations/20161104090806_bankUserProfile.Designer.cs new file mode 100644 index 00000000..b548239b --- /dev/null +++ b/Yavsc/Migrations/20161104090806_bankUserProfile.Designer.cs @@ -0,0 +1,834 @@ +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("20161104090806_bankUserProfile")] + partial class bankUserProfile + { + 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("Status"); + + 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/20161104090806_bankUserProfile.cs b/Yavsc/Migrations/20161104090806_bankUserProfile.cs new file mode 100644 index 00000000..53faa0a9 --- /dev/null +++ b/Yavsc/Migrations/20161104090806_bankUserProfile.cs @@ -0,0 +1,302 @@ +using Microsoft.Data.Entity.Migrations; + +namespace Yavsc.Migrations +{ + public partial class bankUserProfile : 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.CreateTable( + name: "BankIdentity", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:Serial", true), + AccountNumber = table.Column(nullable: true), + BIC = table.Column(nullable: true), + BankCode = table.Column(nullable: true), + BankedKey = table.Column(nullable: false), + IBAN = table.Column(nullable: true), + WicketCode = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_BankIdentity", x => x.Id); + }); + migrationBuilder.AddColumn( + name: "BankInfoId", + table: "AspNetUsers", + nullable: true); + 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_ApplicationUser_BankIdentity_BankInfoId", + table: "AspNetUsers", + column: "BankInfoId", + principalTable: "BankIdentity", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + 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_ApplicationUser_BankIdentity_BankInfoId", table: "AspNetUsers"); + 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: "BankInfoId", table: "AspNetUsers"); + migrationBuilder.DropTable("BankIdentity"); + 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 0eca2168..dca0444a 100644 --- a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs @@ -113,6 +113,31 @@ namespace Yavsc.Migrations 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"); @@ -187,6 +212,8 @@ namespace Yavsc.Migrations b.Property("Avatar") .HasAnnotation("MaxLength", 512); + b.Property("BankInfoId"); + b.Property("ConcurrencyStamp") .IsConcurrencyToken(); @@ -678,6 +705,10 @@ namespace Yavsc.Migrations modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => { + b.HasOne("Yavsc.Model.Bank.BankIdentity") + .WithMany() + .HasForeignKey("BankInfoId"); + b.HasOne("Yavsc.Location") .WithMany() .HasForeignKey("PostalAddressId"); diff --git a/Yavsc/Model/Bank/BankIdentity.cs b/Yavsc/Model/Bank/BankIdentity.cs new file mode 100644 index 00000000..9d58b1b4 --- /dev/null +++ b/Yavsc/Model/Bank/BankIdentity.cs @@ -0,0 +1,63 @@ +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Yavsc.Model.Bank +{ + public class BankIdentity + { + [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long Id { get; set; } + + /// + /// Gets or sets the BI. + /// + /// The BI. + [DisplayName("Code BIC")] + [StringLength(15)] + public string BIC { get; set; } + + /// + /// Gets or sets the IBA. + /// + /// The IBA. + [DisplayName("Code IBAN")] + [StringLength(33)] + public string IBAN { get; set; } + + + /// + /// Gets or sets the bank code. + /// + /// The bank code. + [DisplayName("Code Banque")] + [StringLength(5)] + public string BankCode { get; set; } + + /// + /// Gets or sets the wicket code. + /// + /// The wicket code. + [DisplayName("Code Guichet")] + [StringLength(5)] + public string WicketCode { get; set; } + + /// + /// Gets or sets the account number. + /// + /// The account number. + [DisplayName("Numéro de compte")] + [StringLength(15)] + public string AccountNumber { get; set; } + + /// + /// Gets or sets the banked key. + /// + /// The banked key. + [DisplayName("Clé RIB")] + public int BankedKey { get; set; } + + } + + +} \ No newline at end of file diff --git a/Yavsc/Model/Billing/Command.cs b/Yavsc/Model/Billing/Command.cs deleted file mode 100644 index fa9ffb36..00000000 --- a/Yavsc/Model/Billing/Command.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Yavsc.Models.Market; - -namespace Yavsc.Models.Billing -{ - - public class Command

where P:BaseProduct { - } - - } diff --git a/Yavsc/Model/Billing/Estimate.cs b/Yavsc/Model/Billing/Estimate.cs index 9bd59c9b..21dc8216 100644 --- a/Yavsc/Model/Billing/Estimate.cs +++ b/Yavsc/Model/Billing/Estimate.cs @@ -6,6 +6,7 @@ namespace Yavsc.Models.Billing using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using Yavsc.Interfaces; + using Yavsc.Interfaces.Workflow; using Yavsc.Models.Booking; public partial class Estimate : IEstimate { @@ -22,7 +23,6 @@ namespace Yavsc.Models.Billing [ForeignKey("CommandId")] public BookQuery Query { get; set; } public string Description { get; set; } - public int? Status { get; set; } public string Title { get; set; } [InverseProperty("Estimate")] diff --git a/Yavsc/Model/Billing/NominatvieCommand.cs b/Yavsc/Model/Billing/NominatvieCommand.cs index 98d70a04..1f713c4e 100644 --- a/Yavsc/Model/Billing/NominatvieCommand.cs +++ b/Yavsc/Model/Billing/NominatvieCommand.cs @@ -8,7 +8,7 @@ using Yavsc.Models.Workflow; namespace Yavsc.Models.Billing { - public class NominativeServiceCommand : Command { + public class NominativeServiceCommand : Query { public string ClientId { get; set; } diff --git a/Yavsc/Model/Billing/Query.cs b/Yavsc/Model/Billing/Query.cs new file mode 100644 index 00000000..a21ccf63 --- /dev/null +++ b/Yavsc/Model/Billing/Query.cs @@ -0,0 +1,12 @@ +using Yavsc.Interfaces.Workflow; +using Yavsc.Models.Market; + +namespace Yavsc.Models.Billing +{ + + public class Query

where P : BaseProduct + { + QueryStatus Status { get; set; } + } + +} diff --git a/Yavsc/Model/Identity/ApplicationUser.cs b/Yavsc/Model/Identity/ApplicationUser.cs index 60427d52..08336cff 100644 --- a/Yavsc/Model/Identity/ApplicationUser.cs +++ b/Yavsc/Model/Identity/ApplicationUser.cs @@ -5,6 +5,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Yavsc.Models.Identity; using Yavsc.Model.Chat; +using Yavsc.Model.Bank; namespace Yavsc.Models { @@ -81,5 +82,8 @@ namespace Yavsc.Models public override string ToString() { return this.Id+" "+this.AccountBalance?.Credits.ToString()+this.Email+" "+this.UserName+" $"+this.AccountBalance?.Credits.ToString(); } + + public BankIdentity BankInfo { get; set; } + } } diff --git a/Yavsc/ViewModels/WorkFlow/EstimateEdition.cs b/Yavsc/ViewModels/WorkFlow/EstimateEdition.cs new file mode 100644 index 00000000..f25ec028 --- /dev/null +++ b/Yavsc/ViewModels/WorkFlow/EstimateEdition.cs @@ -0,0 +1,11 @@ +using Yavsc.Models.Billing; + +namespace Yavsc.ViewModels.WorkFlow +{ + public class EstimateEdition + { + public Estimate Data { get; set; } + + + } +} \ No newline at end of file diff --git a/Yavsc/Views/Estimate/Create.cshtml b/Yavsc/Views/Estimate/Create.cshtml index 03bbe9d7..1300fb1b 100644 --- a/Yavsc/Views/Estimate/Create.cshtml +++ b/Yavsc/Views/Estimate/Create.cshtml @@ -40,13 +40,6 @@ -

- -
- - -
-
diff --git a/Yavsc/Views/Estimate/Delete.cshtml b/Yavsc/Views/Estimate/Delete.cshtml index 17c57de7..1de650e8 100644 --- a/Yavsc/Views/Estimate/Delete.cshtml +++ b/Yavsc/Views/Estimate/Delete.cshtml @@ -17,12 +17,6 @@
@Html.DisplayFor(model => model.Description)
-
- @Html.DisplayNameFor(model => model.Status) -
-
- @Html.DisplayFor(model => model.Status) -
@Html.DisplayNameFor(model => model.Title)
diff --git a/Yavsc/Views/Estimate/Details.cshtml b/Yavsc/Views/Estimate/Details.cshtml index cc3d783f..3ecb1b8b 100644 --- a/Yavsc/Views/Estimate/Details.cshtml +++ b/Yavsc/Views/Estimate/Details.cshtml @@ -24,13 +24,6 @@ @Html.DisplayFor(model => model.Description) -
- @Html.DisplayNameFor(model => model.Status) -
-
- @Html.DisplayFor(model => model.Status) -
-
@Html.DisplayNameFor(model => model.Bill)
diff --git a/Yavsc/Views/Estimate/Edit.cshtml b/Yavsc/Views/Estimate/Edit.cshtml index 2e14961d..8fc1ce4a 100644 --- a/Yavsc/Views/Estimate/Edit.cshtml +++ b/Yavsc/Views/Estimate/Edit.cshtml @@ -19,12 +19,6 @@
-
- -
- - -
diff --git a/Yavsc/Views/Estimate/Index.cshtml b/Yavsc/Views/Estimate/Index.cshtml index a05b342a..85fdf739 100644 --- a/Yavsc/Views/Estimate/Index.cshtml +++ b/Yavsc/Views/Estimate/Index.cshtml @@ -14,9 +14,6 @@ @Html.DisplayNameFor(model => model.Description) - - @Html.DisplayNameFor(model => model.Status) - @Html.DisplayNameFor(model => model.Title) @@ -37,9 +34,6 @@ @Html.DisplayFor(modelItem => item.Description) - - @Html.DisplayFor(modelItem => item.Status) - @Html.DisplayFor(modelItem => item.Title) diff --git a/Yavsc/Views/FrontOffice/Estimate.tex.cshtml b/Yavsc/Views/FrontOffice/Estimate.tex.cshtml index ad5d034e..69ec0273 100644 --- a/Yavsc/Views/FrontOffice/Estimate.tex.cshtml +++ b/Yavsc/Views/FrontOffice/Estimate.tex.cshtml @@ -1,6 +1,9 @@ @model Estimate @{ Layout = null; + var pro = Model.Query.PerformerProfile; + var from = Model.Query.PerformerProfile.Performer; + var to = Model.Query.Client; } \documentclass[french,11pt]{article} \usepackage{babel} @@ -115,12 +118,14 @@ \begin{document} % Logo de la société -%\includegraphics{logo.jpg} - +@if (from.Avatar != null) { +\includegraphics{@from.Avatar} +} else { +%\includegraphics{logo.png} +} % Nom et adresse de la société - from.Name \\ - from.Address \\ -from.ZipCode from.CityAndState\\ + @from.UserName \\ + @pro.OrganizationAddress.Address Facture n°\FactureNum @@ -160,22 +165,30 @@ Facture n°\FactureNum \ifthenelse{\equal{\FactureAcquittee}{oui}}{ Facture acquittée. }{ - - À régler par chèque ou par virement bancaire : +@{ + var bi = from.BankInfo; + if (bi!=null) { + À 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(bi.BankCode) && !string.IsNullOrWhiteSpace(bi.WicketCode) + && !string.IsNullOrWhiteSpace(bi.AccountNumber) ) { +\hline \textbf{Code banque} & \textbf{Code guichet} & \textbf{N° de Compte} & \textbf{Clé RIB} \\ +@bi.BankCode & @bi.WicketCode & @bi.AccountNumber & @bi.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 } + @if (!string.IsNullOrWhiteSpace(@bi.IBAN) && !string.IsNullOrWhiteSpace(@bi.BIC)) { + + \hline \textbf{IBAN N°} & \multicolumn{3}{|l|}{ @bi.IBAN } \\ + \hline \textbf{Code BIC} & \multicolumn{3}{|l|}{ @bi.BIC } + } \\ \hline \end{tabular} - \end{center} + \end{center} + } +} + } \end{document}