vnext
Paul Schneider 7 years ago
parent 4bc53c34cf
commit 01f0f7cbc5
19 changed files with 2664 additions and 41 deletions

@ -51,9 +51,14 @@ Dans le cas des arrhes, à tout moment, jusqu'avant la date et l'heure de la pre
## Nouvelle activité ## Nouvelle activité
L'impact d'une custo de son activité pourrait à peu près tout concerner, L'impact d'une custo de son activité pourrait à peu près tout concerner.
un bon point de départ est la création d'un controller de commande dédié, enrichi des données de profile associées à Un bon point de départ est la création d'un controller de commande dédié, enrichi des données de profile associées à un nouveau type de profiles prestataire.
un nouveau type de profiles prestataire.
Ceci implique:
* Un modèle de donnée, un controleur web, ses vues et son API pour:
* Le profile prestataire, dont la donnée est représentée par une classe arbitraire
* L'éventuelle commande customisée, dont la donnée réalise l'objet abstrait 'NominativeServiceCommand'
## Un nouvel environnement d'execution ## Un nouvel environnement d'execution

@ -0,0 +1,123 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.Data.Entity;
using Yavsc.Models;
using Yavsc.Models.Calendar;
using System;
namespace Yavsc.Controllers
{
public class PeriodController : Controller
{
private ApplicationDbContext _context;
public PeriodController(ApplicationDbContext context)
{
_context = context;
}
// GET: Period
public async Task<IActionResult> Index()
{
return View(await _context.Period.ToListAsync());
}
// GET: Period/Details/5
public async Task<IActionResult> Details(DateTime id)
{
if (id == null)
{
return HttpNotFound();
}
Period period = await _context.Period.SingleAsync(m => m.Start == id);
if (period == null)
{
return HttpNotFound();
}
return View(period);
}
// GET: Period/Create
public IActionResult Create()
{
return View();
}
// POST: Period/Create
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(Period period)
{
if (ModelState.IsValid)
{
_context.Period.Add(period);
await _context.SaveChangesAsync();
return RedirectToAction("Index");
}
return View(period);
}
// GET: Period/Edit/5
public async Task<IActionResult> Edit(DateTime id)
{
if (id == null)
{
return HttpNotFound();
}
Period period = await _context.Period.SingleAsync(m => m.Start == id);
if (period == null)
{
return HttpNotFound();
}
return View(period);
}
// POST: Period/Edit/5
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Edit(Period period)
{
if (ModelState.IsValid)
{
_context.Update(period);
await _context.SaveChangesAsync();
return RedirectToAction("Index");
}
return View(period);
}
// GET: Period/Delete/5
[ActionName("Delete")]
public async Task<IActionResult> Delete(DateTime id)
{
if (id == null)
{
return HttpNotFound();
}
Period period = await _context.Period.SingleAsync(m => m.Start == id);
if (period == null)
{
return HttpNotFound();
}
return View(period);
}
// POST: Period/Delete/5
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(DateTime id)
{
Period period = await _context.Period.SingleAsync(m => m.Start == id);
_context.Period.Remove(period);
await _context.SaveChangesAsync();
return RedirectToAction("Index");
}
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,783 @@
using System;
using System.Collections.Generic;
using Microsoft.Data.Entity.Migrations;
namespace Yavsc.Migrations
{
public partial class period : 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.DropColumn(name: "Description", table: "RdvQuery");
migrationBuilder.DropColumn(name: "Description", table: "HairMultiCutQuery");
migrationBuilder.DropColumn(name: "Description", table: "HairCutQuery");
migrationBuilder.DropColumn(name: "EndOfTheDay", table: "BrusherProfile");
migrationBuilder.DropColumn(name: "StartOfTheDay", table: "BrusherProfile");
migrationBuilder.DropTable("Link");
migrationBuilder.CreateTable(
name: "Period",
columns: table => new
{
Start = table.Column<DateTime>(nullable: false),
End = table.Column<DateTime>(nullable: false),
BrusherProfileUserId = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Period", x => new { x.Start, x.End });
table.ForeignKey(
name: "FK_Period_BrusherProfile_BrusherProfileUserId",
column: x => x.BrusherProfileUserId,
principalTable: "BrusherProfile",
principalColumn: "UserId",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "HyperLink",
columns: table => new
{
HRef = table.Column<string>(nullable: false),
Method = table.Column<string>(nullable: false),
BrusherProfileUserId = table.Column<string>(nullable: true),
ContentType = table.Column<string>(nullable: true),
PayPalPaymentCreationToken = table.Column<string>(nullable: true),
Rel = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_HyperLink", x => new { x.HRef, x.Method });
table.ForeignKey(
name: "FK_HyperLink_BrusherProfile_BrusherProfileUserId",
column: x => x.BrusherProfileUserId,
principalTable: "BrusherProfile",
principalColumn: "UserId",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_HyperLink_PayPalPayment_PayPalPaymentCreationToken",
column: x => x.PayPalPaymentCreationToken,
principalTable: "PayPalPayment",
principalColumn: "CreationToken",
onDelete: ReferentialAction.Restrict);
});
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_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);
}
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_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.DropTable("Period");
migrationBuilder.DropTable("HyperLink");
migrationBuilder.CreateTable(
name: "Link",
columns: table => new
{
HRef = table.Column<string>(nullable: false),
Method = table.Column<string>(nullable: false),
PayPalPaymentCreationToken = table.Column<string>(nullable: true),
Rel = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Link", x => new { x.HRef, x.Method });
table.ForeignKey(
name: "FK_Link_PayPalPayment_PayPalPaymentCreationToken",
column: x => x.PayPalPaymentCreationToken,
principalTable: "PayPalPayment",
principalColumn: "CreationToken",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.AddColumn<string>(
name: "Description",
table: "RdvQuery",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "HairMultiCutQuery",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "HairCutQuery",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "EndOfTheDay",
table: "BrusherProfile",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "StartOfTheDay",
table: "BrusherProfile",
nullable: false,
defaultValue: 0);
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);
}
}
}

@ -1,6 +1,8 @@
using System; using System;
using Microsoft.Data.Entity; using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Infrastructure; using Microsoft.Data.Entity.Infrastructure;
using Microsoft.Data.Entity.Metadata;
using Microsoft.Data.Entity.Migrations;
using Yavsc.Models; using Yavsc.Models;
namespace Yavsc.Migrations namespace Yavsc.Migrations
@ -407,6 +409,17 @@ namespace Yavsc.Migrations
b.HasKey("Id"); b.HasKey("Id");
}); });
modelBuilder.Entity("Yavsc.Models.Calendar.Period", b =>
{
b.Property<DateTime>("Start");
b.Property<DateTime>("End");
b.Property<string>("BrusherProfileUserId");
b.HasKey("Start", "End");
});
modelBuilder.Entity("Yavsc.Models.Chat.Connection", b => modelBuilder.Entity("Yavsc.Models.Chat.Connection", b =>
{ {
b.Property<string>("ConnectionId"); b.Property<string>("ConnectionId");
@ -454,8 +467,6 @@ namespace Yavsc.Migrations
b.Property<decimal>("CarePrice"); b.Property<decimal>("CarePrice");
b.Property<int>("EndOfTheDay");
b.Property<decimal>("FlatFeeDiscount"); b.Property<decimal>("FlatFeeDiscount");
b.Property<decimal>("HalfBalayagePrice"); b.Property<decimal>("HalfBalayagePrice");
@ -514,8 +525,6 @@ namespace Yavsc.Migrations
b.Property<decimal>("ShortPermanentPrice"); b.Property<decimal>("ShortPermanentPrice");
b.Property<int>("StartOfTheDay");
b.Property<decimal>("WomenHalfCutPrice"); b.Property<decimal>("WomenHalfCutPrice");
b.Property<decimal>("WomenLongCutPrice"); b.Property<decimal>("WomenLongCutPrice");
@ -545,8 +554,6 @@ namespace Yavsc.Migrations
b.Property<DateTime>("DateModified"); b.Property<DateTime>("DateModified");
b.Property<string>("Description");
b.Property<DateTime?>("EventDate"); b.Property<DateTime?>("EventDate");
b.Property<long?>("LocationId"); b.Property<long?>("LocationId");
@ -590,8 +597,6 @@ namespace Yavsc.Migrations
b.Property<DateTime>("DateModified"); b.Property<DateTime>("DateModified");
b.Property<string>("Description");
b.Property<DateTime>("EventDate"); b.Property<DateTime>("EventDate");
b.Property<long?>("LocationId"); b.Property<long?>("LocationId");
@ -923,12 +928,16 @@ namespace Yavsc.Migrations
b.HasKey("OwnerId", "UserId"); b.HasKey("OwnerId", "UserId");
}); });
modelBuilder.Entity("Yavsc.Models.Relationship.Link", b => modelBuilder.Entity("Yavsc.Models.Relationship.HyperLink", b =>
{ {
b.Property<string>("HRef"); b.Property<string>("HRef");
b.Property<string>("Method"); b.Property<string>("Method");
b.Property<string>("BrusherProfileUserId");
b.Property<string>("ContentType");
b.Property<string>("PayPalPaymentCreationToken"); b.Property<string>("PayPalPaymentCreationToken");
b.Property<string>("Rel"); b.Property<string>("Rel");
@ -1111,8 +1120,6 @@ namespace Yavsc.Migrations
b.Property<DateTime>("DateModified"); b.Property<DateTime>("DateModified");
b.Property<string>("Description");
b.Property<DateTime>("EventDate"); b.Property<DateTime>("EventDate");
b.Property<long?>("LocationId"); b.Property<long?>("LocationId");
@ -1258,6 +1265,13 @@ namespace Yavsc.Migrations
.HasForeignKey("AuthorId"); .HasForeignKey("AuthorId");
}); });
modelBuilder.Entity("Yavsc.Models.Calendar.Period", b =>
{
b.HasOne("Yavsc.Models.Haircut.BrusherProfile")
.WithMany()
.HasForeignKey("BrusherProfileUserId");
});
modelBuilder.Entity("Yavsc.Models.Chat.Connection", b => modelBuilder.Entity("Yavsc.Models.Chat.Connection", b =>
{ {
b.HasOne("Yavsc.Models.ApplicationUser") b.HasOne("Yavsc.Models.ApplicationUser")
@ -1441,8 +1455,12 @@ namespace Yavsc.Migrations
.HasForeignKey("ApplicationUserId"); .HasForeignKey("ApplicationUserId");
}); });
modelBuilder.Entity("Yavsc.Models.Relationship.Link", b => modelBuilder.Entity("Yavsc.Models.Relationship.HyperLink", b =>
{ {
b.HasOne("Yavsc.Models.Haircut.BrusherProfile")
.WithMany()
.HasForeignKey("BrusherProfileUserId");
b.HasOne("Yavsc.Models.Payment.PayPalPayment") b.HasOne("Yavsc.Models.Payment.PayPalPayment")
.WithMany() .WithMany()
.HasForeignKey("PayPalPaymentCreationToken"); .HasForeignKey("PayPalPaymentCreationToken");

@ -7,6 +7,7 @@ using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.Data.Entity; using Microsoft.Data.Entity;
using System.Threading; using System.Threading;
using Yavsc.Models.Haircut; using Yavsc.Models.Haircut;
using Yavsc.Models.Calendar;
namespace Yavsc.Models namespace Yavsc.Models
{ {
@ -29,6 +30,7 @@ namespace Yavsc.Models
using Attributes; using Attributes;
using Bank; using Bank;
using Payment; using Payment;
using Yavsc.Models.Calendar;
public class ApplicationDbContext : IdentityDbContext<ApplicationUser> public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{ {
@ -51,6 +53,7 @@ namespace Yavsc.Models
builder.Entity<DimissClicked>().HasKey(c=>new { uid = c.UserId, notid = c.NotificationId}); builder.Entity<DimissClicked>().HasKey(c=>new { uid = c.UserId, notid = c.NotificationId});
builder.Entity<HairTaintInstance>().HasKey(ti=>new { ti.TaintId, ti.PrestationId } ); builder.Entity<HairTaintInstance>().HasKey(ti=>new { ti.TaintId, ti.PrestationId } );
builder.Entity<HyperLink>().HasKey(l=>new { l.HRef, l.Method }); builder.Entity<HyperLink>().HasKey(l=>new { l.HRef, l.Method });
builder.Entity<Period>().HasKey(l=>new { l.Start, l.End });
foreach (var et in builder.Model.GetEntityTypes()) { foreach (var et in builder.Model.GetEntityTypes()) {
if (et.ClrType.GetInterface("IBaseTrackedEntity")!=null) if (et.ClrType.GetInterface("IBaseTrackedEntity")!=null)
@ -312,5 +315,7 @@ namespace Yavsc.Models
public DbSet<PayPalPayment> PayPalPayments { get; set; } public DbSet<PayPalPayment> PayPalPayments { get; set; }
public DbSet<HyperLink> Links { get; set; } public DbSet<HyperLink> Links { get; set; }
public DbSet<Period> Period { get; set; }
} }
} }

@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace Yavsc.Models.Calendar
{
public class Availability: List<Period>
{
}
}

@ -32,13 +32,13 @@ namespace Yavsc.Models.Calendar
/// Gets or sets the start. /// Gets or sets the start.
/// </summary> /// </summary>
/// <value>The start.</value> /// <value>The start.</value>
[Required] [Required,Display(Name="Début")]
public DateTime Start { get; set; } public DateTime Start { get; set; }
/// <summary> /// <summary>
/// Gets or sets the end. /// Gets or sets the end.
/// </summary> /// </summary>
/// <value>The end.</value> /// <value>The end.</value>
[Required] [Required,Display(Name="Fin")]
public DateTime End { get; set; } public DateTime End { get; set; }
} }

@ -7,6 +7,7 @@ namespace Yavsc.Models.Haircut
{ {
using Workflow; using Workflow;
using Relationship; using Relationship;
using Calendar;
public class BrusherProfile : ISpecializationSettings public class BrusherProfile : ISpecializationSettings
{ {
@ -20,7 +21,6 @@ namespace Yavsc.Models.Haircut
get; set; get; set;
} }
[JsonIgnore,ForeignKey("UserId")] [JsonIgnore,ForeignKey("UserId")]
public virtual PerformerProfile BaseProfile { get; set; } public virtual PerformerProfile BaseProfile { get; set; }
@ -35,14 +35,10 @@ namespace Yavsc.Models.Haircut
/// StartOfTheDay In munutes /// StartOfTheDay In munutes
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Display(Name="Début de la journée")]
public int StartOfTheDay { get; set;} [DisplayFormat(ConvertEmptyStringToNull = true, NullDisplayText = "[Pas de lieu spécifié]")]
/// <summary> [Display(Name="Disponibilités")]
/// End Of The Day, In munutes public virtual Availability Availability { get; set; }
/// </summary>
/// <returns></returns>
[Display(Name="Fin de la journée")]
public int EndOfTheDay { get; set;}
[Display(Name="Coupe femme cheveux longs"),DisplayFormat(DataFormatString="{0:C}")] [Display(Name="Coupe femme cheveux longs"),DisplayFormat(DataFormatString="{0:C}")]

@ -29,14 +29,10 @@
<environment names="Development"> <environment names="Development">
<fieldset><legend>Disponibilité</legend> <fieldset><legend>Disponibilité</legend>
<div class="form-group"> <div class="form-group">
<label asp-for="StartOfTheDay" class="col-md-2 control-label"></label> <label asp-for="Availability" class="col-md-2 control-label"></label>
<label asp-for="EndOfTheDay" class="col-md-2 control-label"></label>
<div class="col-md-10" id="datepair"> <div class="col-md-10" id="datepair">
<input id="StartOfTheDay" name="aStartOfTheDay" class="timepicker form-control" /> @Html.EditorFor(m=>m.Availability)
<span asp-validation-for="StartOfTheDay" class="text-danger" ></span>
<input id="EndOfTheDay" name="aEndOfTheDay" class="timepicker form-control" />
<span asp-validation-for="EndOfTheDay" class="text-danger" ></span>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

@ -15,16 +15,10 @@
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt> <dt>
@Html.DisplayNameFor(model => model.EndOfTheDay) @Html.DisplayNameFor(model => model.Availability)
</dt> </dt>
<dd> <dd>
@Html.Partial("HourFromMinutes", Model.EndOfTheDay) @Html.DisplayFor(model => model.Availability)
</dd>
<dt>
@Html.DisplayNameFor(model => model.StartOfTheDay)
</dt>
<dd>
@Html.Partial("HourFromMinutes", Model.StartOfTheDay)
</dd> </dd>
<dt> <dt>
@Html.DisplayNameFor(model => model.ActionDistance) @Html.DisplayNameFor(model => model.ActionDistance)

@ -0,0 +1,25 @@
@model Yavsc.Models.Calendar.Period
@{
ViewData["Title"] = "Create";
}
<h2>Create</h2>
<form asp-action="Create">
<div class="form-horizontal">
<h4>Period</h4>
<hr />
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Create" class="btn btn-default" />
</div>
</div>
</div>
</form>
<div>
<a asp-action="Index">Back to List</a>
</div>

@ -0,0 +1,22 @@
@model Yavsc.Models.Calendar.Period
@{
ViewData["Title"] = "Delete";
}
<h2>Delete</h2>
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>Period</h4>
<hr />
<dl class="dl-horizontal">
</dl>
<form asp-action="Delete">
<div class="form-actions no-color">
<input type="submit" value="Delete" class="btn btn-default" /> |
<a asp-action="Index">Back to List</a>
</div>
</form>
</div>

@ -0,0 +1,18 @@
@model Yavsc.Models.Calendar.Period
@{
ViewData["Title"] = "Details";
}
<h2>Details</h2>
<div>
<h4>Period</h4>
<hr />
<dl class="dl-horizontal">
</dl>
</div>
<p>
@Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) |
<a asp-action="Index">Back to List</a>
</p>

@ -0,0 +1,27 @@
@model Yavsc.Models.Calendar.Period
@{
ViewData["Title"] = "Edit";
}
<h2>Edit</h2>
<form asp-action="Edit">
<div class="form-horizontal">
<h4>Period</h4>
<hr />
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="Start" />
<input type="hidden" asp-for="End" />
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Save" class="btn btn-default" />
</div>
</div>
</div>
</form>
<div>
<a asp-action="Index">Back to List</a>
</div>

@ -0,0 +1,26 @@
@model IEnumerable<Yavsc.Models.Calendar.Period>
@{
ViewData["Title"] = "Index";
}
<h2>Index</h2>
<p>
<a asp-action="Create">Create New</a>
</p>
<table class="table">
<tr>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
@Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
@Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
</td>
</tr>
}
</table>

@ -0,0 +1,15 @@
@model Availability
@if (Model==null || Model.Count <1) {
<text>Pas de disponibilité renseignée</text>
} else {
<table>
<th><td>@Html.DisplayNameFor(m=>m[0].Start)</td>
<td>@Html.DisplayNameFor(m=>m[0].End)</td></th>
@foreach (var dispo in Model)
{
<tr><td>@Html.DisplayFor(m=>dispo.Start)</td>
<td>@Html.DisplayFor(m=>dispo.End)</td></tr>
}
</table>
}

@ -0,0 +1,3 @@
@model Availability
L'index des periodes ...

@ -23,6 +23,8 @@
@using Yavsc.Models.Drawing; @using Yavsc.Models.Drawing;
@using Yavsc.Models.Haircut; @using Yavsc.Models.Haircut;
@using Yavsc.Models.Payment; @using Yavsc.Models.Payment;
@using Yavsc.Models.Calendar;
@using Yavsc.ViewModels.Account; @using Yavsc.ViewModels.Account;
@using Yavsc.ViewModels.Manage; @using Yavsc.ViewModels.Manage;

Loading…