billing
parent
a8437733ae
commit
db02e965dc
@ -1,130 +0,0 @@
|
|||||||
using Yavsc.Models.Haircut;
|
|
||||||
|
|
||||||
namespace Yavsc.Helpers
|
|
||||||
{
|
|
||||||
public static class HaircutHelpers
|
|
||||||
{
|
|
||||||
public static decimal Addition (this HairPrestation p, BrusherProfile profile)
|
|
||||||
{
|
|
||||||
decimal sub=0;
|
|
||||||
// Le shampoing
|
|
||||||
sub += p.Shampoo ? profile.ShampooPrice:0;
|
|
||||||
|
|
||||||
// la coupe
|
|
||||||
sub += p.Cut ? p.Gender == HairCutGenders.Women ?
|
|
||||||
p.Length == HairLength.Long ? profile.WomenLongCutPrice :
|
|
||||||
p.Length == HairLength.HalfLong ? profile.WomenHalfCutPrice :
|
|
||||||
profile.WomenShortCutPrice : p.Gender == HairCutGenders.Man ?
|
|
||||||
profile.ManCutPrice : profile.KidCutPrice : 0;
|
|
||||||
|
|
||||||
// Les techniques
|
|
||||||
switch (p.Tech) {
|
|
||||||
case HairTechnos.Color:
|
|
||||||
bool multicolor = p.Taints.Count>1;
|
|
||||||
switch (p.Length) {
|
|
||||||
case HairLength.Long:
|
|
||||||
sub += sub += multicolor? profile.LongMultiColorPrice : profile.LongColorPrice;
|
|
||||||
break;
|
|
||||||
case HairLength.HalfLong: sub += multicolor? profile.HalfMultiColorPrice : profile.HalfColorPrice;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
sub += multicolor? profile.ShortMultiColorPrice : profile.ShortColorPrice;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case HairTechnos.Balayage:
|
|
||||||
switch (p.Length) {
|
|
||||||
case HairLength.Long:
|
|
||||||
sub += profile.LongBalayagePrice;
|
|
||||||
break;
|
|
||||||
case HairLength.HalfLong: sub += profile.HalfBalayagePrice;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
sub += profile.ShortBalayagePrice;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case HairTechnos.Defris:
|
|
||||||
switch (p.Length) {
|
|
||||||
case HairLength.Long:
|
|
||||||
sub += profile.LongDefrisPrice;
|
|
||||||
break;
|
|
||||||
case HairLength.HalfLong: sub += profile.HalfDefrisPrice;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
sub += profile.ShortDefrisPrice;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case HairTechnos.Mech:
|
|
||||||
switch (p.Length) {
|
|
||||||
case HairLength.Long:
|
|
||||||
sub += profile.LongMechPrice;
|
|
||||||
break;
|
|
||||||
case HairLength.HalfLong: sub += profile.HalfMechPrice;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
sub += profile.ShortMechPrice;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case HairTechnos.Permanent:
|
|
||||||
switch (p.Length) {
|
|
||||||
case HairLength.Long:
|
|
||||||
sub += profile.LongPermanentPrice;
|
|
||||||
break;
|
|
||||||
case HairLength.HalfLong: sub += profile.HalfPermanentPrice;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
sub += profile.ShortPermanentPrice;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Les coiffages
|
|
||||||
switch (p.Dressing) {
|
|
||||||
case HairDressings.Brushing:
|
|
||||||
switch (p.Gender) {
|
|
||||||
case HairCutGenders.Women:
|
|
||||||
switch (p.Length) {
|
|
||||||
case HairLength.Long:
|
|
||||||
sub += profile.LongBrushingPrice;
|
|
||||||
break;
|
|
||||||
case HairLength.HalfLong: sub += profile.HalfBrushingPrice;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
sub += profile.ShortBrushingPrice;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case HairCutGenders.Man:
|
|
||||||
sub += profile.ManBrushPrice;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case HairDressings.Coiffage:
|
|
||||||
// est offert
|
|
||||||
break;
|
|
||||||
case HairDressings.Folding:
|
|
||||||
switch (p.Length) {
|
|
||||||
case HairLength.Long:
|
|
||||||
sub += profile.LongFoldingPrice;
|
|
||||||
break;
|
|
||||||
case HairLength.HalfLong: sub += profile.HalfFoldingPrice;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
sub += profile.ShortFoldingPrice;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// les soins
|
|
||||||
sub += p.Cares ? profile.CarePrice:0;
|
|
||||||
return sub;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,726 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
namespace Yavsc.Migrations
|
||||||
|
{
|
||||||
|
public partial class hairCutPaypalPayment : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BlackListed_ApplicationUser_OwnerId", table: "BlackListed");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Blog_BlogPostId", table: "CircleAuthorizationToBlogPost");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId", table: "CircleAuthorizationToBlogPost");
|
||||||
|
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_Estimate_ApplicationUser_ClientId", table: "Estimate");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Estimate_PerformerProfile_OwnerId", table: "Estimate");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Connection_ApplicationUser_ApplicationUserId", table: "Connection");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BrusherProfile_PerformerProfile_UserId", table: "BrusherProfile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_Activity_ActivityCode", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_ApplicationUser_ClientId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_PerformerProfile_PerformerId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_HairPrestation_PrestationId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_Activity_ActivityCode", table: "HairMultiCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_ApplicationUser_ClientId", table: "HairMultiCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId", table: "HairMultiCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairPrestationCollectionItem_HairPrestation_PrestationId", table: "HairPrestationCollectionItem");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairPrestationCollectionItem_HairMultiCutQuery_QueryId", table: "HairPrestationCollectionItem");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairTaint_Color_ColorId", table: "HairTaint");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairTaintInstance_HairPrestation_PrestationId", table: "HairTaintInstance");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairTaintInstance_HairTaint_TaintId", table: "HairTaintInstance");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_Notification_NotificationId", table: "DimissClicked");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_ApplicationUser_UserId", table: "DimissClicked");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_PaypalPayment_ApplicationUser_ExecutorId", table: "PaypalPayment");
|
||||||
|
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_CommandForm_Activity_ActivityCode", table: "CommandForm");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_Activity_ActivityCode", table: "RdvQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_ApplicationUser_ClientId", table: "RdvQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_PerformerProfile_PerformerId", table: "RdvQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_UserActivity_Activity_DoesCode", table: "UserActivity");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity");
|
||||||
|
migrationBuilder.DropPrimaryKey(name: "PK_PaypalPayment", table: "PaypalPayment");
|
||||||
|
migrationBuilder.AddPrimaryKey(
|
||||||
|
name: "PK_PaypalPayment",
|
||||||
|
table: "PaypalPayment",
|
||||||
|
column: "PaypalPaymentId");
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "PaymentId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "CommandLine",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
|
||||||
|
table: "AspNetRoleClaims",
|
||||||
|
column: "RoleId",
|
||||||
|
principalTable: "AspNetRoles",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
|
||||||
|
table: "AspNetUserClaims",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
|
||||||
|
table: "AspNetUserLogins",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
|
||||||
|
table: "AspNetUserRoles",
|
||||||
|
column: "RoleId",
|
||||||
|
principalTable: "AspNetRoles",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
|
||||||
|
table: "AspNetUserRoles",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BlackListed_ApplicationUser_OwnerId",
|
||||||
|
table: "BlackListed",
|
||||||
|
column: "OwnerId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_CircleAuthorizationToBlogPost_Blog_BlogPostId",
|
||||||
|
table: "CircleAuthorizationToBlogPost",
|
||||||
|
column: "BlogPostId",
|
||||||
|
principalTable: "Blog",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId",
|
||||||
|
table: "CircleAuthorizationToBlogPost",
|
||||||
|
column: "CircleId",
|
||||||
|
principalTable: "Circle",
|
||||||
|
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_Estimate_ApplicationUser_ClientId",
|
||||||
|
table: "Estimate",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Estimate_PerformerProfile_OwnerId",
|
||||||
|
table: "Estimate",
|
||||||
|
column: "OwnerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Connection_ApplicationUser_ApplicationUserId",
|
||||||
|
table: "Connection",
|
||||||
|
column: "ApplicationUserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BrusherProfile_PerformerProfile_UserId",
|
||||||
|
table: "BrusherProfile",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_Activity_ActivityCode",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_ApplicationUser_ClientId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_PaypalPayment_PaymentId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "PaymentId",
|
||||||
|
principalTable: "PaypalPayment",
|
||||||
|
principalColumn: "PaypalPaymentId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_PerformerProfile_PerformerId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_HairPrestation_PrestationId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "PrestationId",
|
||||||
|
principalTable: "HairPrestation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairMultiCutQuery_Activity_ActivityCode",
|
||||||
|
table: "HairMultiCutQuery",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairMultiCutQuery_ApplicationUser_ClientId",
|
||||||
|
table: "HairMultiCutQuery",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId",
|
||||||
|
table: "HairMultiCutQuery",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairPrestationCollectionItem_HairPrestation_PrestationId",
|
||||||
|
table: "HairPrestationCollectionItem",
|
||||||
|
column: "PrestationId",
|
||||||
|
principalTable: "HairPrestation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairPrestationCollectionItem_HairMultiCutQuery_QueryId",
|
||||||
|
table: "HairPrestationCollectionItem",
|
||||||
|
column: "QueryId",
|
||||||
|
principalTable: "HairMultiCutQuery",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairTaint_Color_ColorId",
|
||||||
|
table: "HairTaint",
|
||||||
|
column: "ColorId",
|
||||||
|
principalTable: "Color",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairTaintInstance_HairPrestation_PrestationId",
|
||||||
|
table: "HairTaintInstance",
|
||||||
|
column: "PrestationId",
|
||||||
|
principalTable: "HairPrestation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairTaintInstance_HairTaint_TaintId",
|
||||||
|
table: "HairTaintInstance",
|
||||||
|
column: "TaintId",
|
||||||
|
principalTable: "HairTaint",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_DimissClicked_Notification_NotificationId",
|
||||||
|
table: "DimissClicked",
|
||||||
|
column: "NotificationId",
|
||||||
|
principalTable: "Notification",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_DimissClicked_ApplicationUser_UserId",
|
||||||
|
table: "DimissClicked",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Instrumentation_Instrument_InstrumentId",
|
||||||
|
table: "Instrumentation",
|
||||||
|
column: "InstrumentId",
|
||||||
|
principalTable: "Instrument",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_PaypalPayment_ApplicationUser_ExecutorId",
|
||||||
|
table: "PaypalPayment",
|
||||||
|
column: "ExecutorId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
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_CommandForm_Activity_ActivityCode",
|
||||||
|
table: "CommandForm",
|
||||||
|
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);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_RdvQuery_Activity_ActivityCode",
|
||||||
|
table: "RdvQuery",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_RdvQuery_ApplicationUser_ClientId",
|
||||||
|
table: "RdvQuery",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_RdvQuery_PerformerProfile_PerformerId",
|
||||||
|
table: "RdvQuery",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_UserActivity_Activity_DoesCode",
|
||||||
|
table: "UserActivity",
|
||||||
|
column: "DoesCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_UserActivity_PerformerProfile_UserId",
|
||||||
|
table: "UserActivity",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.RenameColumn(
|
||||||
|
name: "orderReference",
|
||||||
|
table: "PaypalPayment",
|
||||||
|
newName: "OrderReference");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BlackListed_ApplicationUser_OwnerId", table: "BlackListed");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Blog_BlogPostId", table: "CircleAuthorizationToBlogPost");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId", table: "CircleAuthorizationToBlogPost");
|
||||||
|
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_Estimate_ApplicationUser_ClientId", table: "Estimate");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Estimate_PerformerProfile_OwnerId", table: "Estimate");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Connection_ApplicationUser_ApplicationUserId", table: "Connection");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BrusherProfile_PerformerProfile_UserId", table: "BrusherProfile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_Activity_ActivityCode", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_ApplicationUser_ClientId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_PaypalPayment_PaymentId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_PerformerProfile_PerformerId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_HairPrestation_PrestationId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_Activity_ActivityCode", table: "HairMultiCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_ApplicationUser_ClientId", table: "HairMultiCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId", table: "HairMultiCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairPrestationCollectionItem_HairPrestation_PrestationId", table: "HairPrestationCollectionItem");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairPrestationCollectionItem_HairMultiCutQuery_QueryId", table: "HairPrestationCollectionItem");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairTaint_Color_ColorId", table: "HairTaint");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairTaintInstance_HairPrestation_PrestationId", table: "HairTaintInstance");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairTaintInstance_HairTaint_TaintId", table: "HairTaintInstance");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_Notification_NotificationId", table: "DimissClicked");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_ApplicationUser_UserId", table: "DimissClicked");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_PaypalPayment_ApplicationUser_ExecutorId", table: "PaypalPayment");
|
||||||
|
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_CommandForm_Activity_ActivityCode", table: "CommandForm");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_Activity_ActivityCode", table: "RdvQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_ApplicationUser_ClientId", table: "RdvQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_PerformerProfile_PerformerId", table: "RdvQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_UserActivity_Activity_DoesCode", table: "UserActivity");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity");
|
||||||
|
migrationBuilder.DropPrimaryKey(name: "PK_PaypalPayment", table: "PaypalPayment");
|
||||||
|
migrationBuilder.DropColumn(name: "PaymentId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropColumn(name: "Name", table: "CommandLine");
|
||||||
|
migrationBuilder.AddPrimaryKey(
|
||||||
|
name: "PK_PaypalPayment",
|
||||||
|
table: "PaypalPayment",
|
||||||
|
column: "PaypalPayerId");
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
|
||||||
|
table: "AspNetRoleClaims",
|
||||||
|
column: "RoleId",
|
||||||
|
principalTable: "AspNetRoles",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
|
||||||
|
table: "AspNetUserClaims",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
|
||||||
|
table: "AspNetUserLogins",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
|
||||||
|
table: "AspNetUserRoles",
|
||||||
|
column: "RoleId",
|
||||||
|
principalTable: "AspNetRoles",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
|
||||||
|
table: "AspNetUserRoles",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BlackListed_ApplicationUser_OwnerId",
|
||||||
|
table: "BlackListed",
|
||||||
|
column: "OwnerId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_CircleAuthorizationToBlogPost_Blog_BlogPostId",
|
||||||
|
table: "CircleAuthorizationToBlogPost",
|
||||||
|
column: "BlogPostId",
|
||||||
|
principalTable: "Blog",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId",
|
||||||
|
table: "CircleAuthorizationToBlogPost",
|
||||||
|
column: "CircleId",
|
||||||
|
principalTable: "Circle",
|
||||||
|
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_Estimate_ApplicationUser_ClientId",
|
||||||
|
table: "Estimate",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Estimate_PerformerProfile_OwnerId",
|
||||||
|
table: "Estimate",
|
||||||
|
column: "OwnerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Connection_ApplicationUser_ApplicationUserId",
|
||||||
|
table: "Connection",
|
||||||
|
column: "ApplicationUserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BrusherProfile_PerformerProfile_UserId",
|
||||||
|
table: "BrusherProfile",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_Activity_ActivityCode",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_ApplicationUser_ClientId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_PerformerProfile_PerformerId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_HairPrestation_PrestationId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "PrestationId",
|
||||||
|
principalTable: "HairPrestation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairMultiCutQuery_Activity_ActivityCode",
|
||||||
|
table: "HairMultiCutQuery",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairMultiCutQuery_ApplicationUser_ClientId",
|
||||||
|
table: "HairMultiCutQuery",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId",
|
||||||
|
table: "HairMultiCutQuery",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairPrestationCollectionItem_HairPrestation_PrestationId",
|
||||||
|
table: "HairPrestationCollectionItem",
|
||||||
|
column: "PrestationId",
|
||||||
|
principalTable: "HairPrestation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairPrestationCollectionItem_HairMultiCutQuery_QueryId",
|
||||||
|
table: "HairPrestationCollectionItem",
|
||||||
|
column: "QueryId",
|
||||||
|
principalTable: "HairMultiCutQuery",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairTaint_Color_ColorId",
|
||||||
|
table: "HairTaint",
|
||||||
|
column: "ColorId",
|
||||||
|
principalTable: "Color",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairTaintInstance_HairPrestation_PrestationId",
|
||||||
|
table: "HairTaintInstance",
|
||||||
|
column: "PrestationId",
|
||||||
|
principalTable: "HairPrestation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairTaintInstance_HairTaint_TaintId",
|
||||||
|
table: "HairTaintInstance",
|
||||||
|
column: "TaintId",
|
||||||
|
principalTable: "HairTaint",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_DimissClicked_Notification_NotificationId",
|
||||||
|
table: "DimissClicked",
|
||||||
|
column: "NotificationId",
|
||||||
|
principalTable: "Notification",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_DimissClicked_ApplicationUser_UserId",
|
||||||
|
table: "DimissClicked",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Instrumentation_Instrument_InstrumentId",
|
||||||
|
table: "Instrumentation",
|
||||||
|
column: "InstrumentId",
|
||||||
|
principalTable: "Instrument",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_PaypalPayment_ApplicationUser_ExecutorId",
|
||||||
|
table: "PaypalPayment",
|
||||||
|
column: "ExecutorId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
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_CommandForm_Activity_ActivityCode",
|
||||||
|
table: "CommandForm",
|
||||||
|
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);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_RdvQuery_Activity_ActivityCode",
|
||||||
|
table: "RdvQuery",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_RdvQuery_ApplicationUser_ClientId",
|
||||||
|
table: "RdvQuery",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_RdvQuery_PerformerProfile_PerformerId",
|
||||||
|
table: "RdvQuery",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_UserActivity_Activity_DoesCode",
|
||||||
|
table: "UserActivity",
|
||||||
|
column: "DoesCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_UserActivity_PerformerProfile_UserId",
|
||||||
|
table: "UserActivity",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.RenameColumn(
|
||||||
|
name: "OrderReference",
|
||||||
|
table: "PaypalPayment",
|
||||||
|
newName: "orderReference");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,26 +0,0 @@
|
|||||||
|
|
||||||
namespace Yavsc.ViewModels.PayPal
|
|
||||||
{
|
|
||||||
public class Amount
|
|
||||||
{
|
|
||||||
public string total { get; set; }
|
|
||||||
public string currency { get; set; } = "EUR";
|
|
||||||
public class Details
|
|
||||||
{
|
|
||||||
public string subtotal { get; set; }
|
|
||||||
public string shipping { get; set; }
|
|
||||||
public string tax { get; set; }
|
|
||||||
public string shipping_discount { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
public Details details;
|
|
||||||
public class ItemList
|
|
||||||
{
|
|
||||||
public Item[] items;
|
|
||||||
public string description { get; set; }
|
|
||||||
public string invoice_number { get; set; }
|
|
||||||
public string custom { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
|
|
||||||
namespace Yavsc.ViewModels.PayPal
|
|
||||||
{
|
|
||||||
public class Item
|
|
||||||
{
|
|
||||||
public string quantity { get; set; }
|
|
||||||
public string name { get; set; }
|
|
||||||
public string price { get; set; }
|
|
||||||
public string currency { get; set; } = "EUR";
|
|
||||||
public string description { get; set; }
|
|
||||||
public string tax { get; set; } = "1";
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,11 @@
|
|||||||
|
using PayPal.Api;
|
||||||
|
using Yavsc.Models.Payment;
|
||||||
|
|
||||||
|
namespace Yavsc.ViewModels.PayPal
|
||||||
|
{
|
||||||
|
public class PaymentInfo
|
||||||
|
{
|
||||||
|
public PaypalPayment DbContent { get; set; }
|
||||||
|
public Payment FromPaypal { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
@model ApplicationUser
|
@model ApplicationUser
|
||||||
|
@if (Model!=null) {
|
||||||
<img src="~/Avatars/@(Model.UserName).s.png" alt="" class="smalltofhol">
|
<img src="~/Avatars/@(Model.UserName).s.png" alt="" class="smalltofhol">
|
||||||
@Model.UserName
|
@Model.UserName
|
||||||
@if (Model.Posts!=null) { <a asp-controller="Blogspot" asp-action="UserPosts"
|
@if (Model.Posts!=null) { <a asp-controller="Blogspot" asp-action="UserPosts"
|
||||||
asp-route-id="@Model.UserName" class="btn btn-link">@SR["index de ses articles"]</a>
|
asp-route-id="@Model.UserName" class="btn btn-link">@SR["index de ses articles"]</a>
|
||||||
}
|
}} else { <text>néant</text> }
|
@ -0,0 +1,50 @@
|
|||||||
|
@model PaypalPayment
|
||||||
|
|
||||||
|
@if (Model!=null && Model.Executor!=null) {
|
||||||
|
@Html.DisplayFor(m=>m.Executor)
|
||||||
|
} else {
|
||||||
|
|
||||||
|
<div id="paypal-button"></div>
|
||||||
|
|
||||||
|
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
|
||||||
|
<environement names="lua,coiffure,zicmoove,yavsc,yavscpre">
|
||||||
|
<script>
|
||||||
|
var CREATE_PAYMENT_URL = '@(ViewData["PaymentUrl"])';
|
||||||
|
var EXECUTE_PAYMENT_URL = 'https://lua.pschneider.fr/api/payment/execute';
|
||||||
|
var PAYPAL_ENV = 'sandbox';
|
||||||
|
</script>
|
||||||
|
</environement>
|
||||||
|
<environement names="Development">
|
||||||
|
<script>
|
||||||
|
var CREATE_PAYMENT_URL = '@(ViewData["PaymentUrl"])';
|
||||||
|
var EXECUTE_PAYMENT_URL = 'https://dev.pschneider.fr/api/payment/execute';
|
||||||
|
var PAYPAL_ENV = 'sandbox';
|
||||||
|
</script>
|
||||||
|
</environement>
|
||||||
|
<script>
|
||||||
|
paypal.Button.render({
|
||||||
|
|
||||||
|
env: PAYPAL_ENV, // 'production', Optional: specify 'sandbox' environment
|
||||||
|
|
||||||
|
payment: function(resolve, reject) {
|
||||||
|
|
||||||
|
return paypal.request.post(CREATE_PAYMENT_URL)
|
||||||
|
.then(function(data) { resolve(data.id); })
|
||||||
|
.catch(function(err) { reject(err); });
|
||||||
|
},
|
||||||
|
|
||||||
|
onAuthorize: function(data) {
|
||||||
|
|
||||||
|
// Note: you can display a confirmation page before executing
|
||||||
|
|
||||||
|
return paypal.request.post(EXECUTE_PAYMENT_URL,
|
||||||
|
{ paymentID: data.paymentID, payerID: data.payerID })
|
||||||
|
|
||||||
|
.then(function(data) { /* Go to a success page */ })
|
||||||
|
.catch(function(err) { /* Go to an error page */ });
|
||||||
|
}
|
||||||
|
|
||||||
|
}, '#paypal-button');
|
||||||
|
</script>
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
namespace YavscLib.Billing
|
||||||
|
{
|
||||||
|
public interface IBillItem {
|
||||||
|
string Name { get; set; }
|
||||||
|
string Description { get; set; }
|
||||||
|
int Count { get; set; }
|
||||||
|
decimal UnitaryCost { get; set; }
|
||||||
|
string Currency { get; set; }
|
||||||
|
|
||||||
|
string Reference { get; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace YavscLib.Billing
|
||||||
|
{
|
||||||
|
public interface IBillable {
|
||||||
|
string Description { get; set; }
|
||||||
|
List<IBillItem> GetBillItems();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue