Comments
This commit is contained in:
22
Yavsc/AuthorizationHandlers/AnnounceHandlers.cs
Normal file
22
Yavsc/AuthorizationHandlers/AnnounceHandlers.cs
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Yavsc.Interfaces;
|
||||
|
||||
namespace Yavsc.ViewModels.Auth.Handlers
|
||||
{
|
||||
public class AnnouceEditHandler : AuthorizationHandler<EditRequirement, IOwned>
|
||||
{
|
||||
protected override void Handle(AuthorizationContext context, EditRequirement requirement,
|
||||
IOwned resource)
|
||||
{
|
||||
if (context.User.IsInRole(Constants.BlogModeratorGroupName)
|
||||
|| context.User.IsInRole(Constants.AdminGroupName))
|
||||
context.Succeed(requirement);
|
||||
if (resource.OwnerId == context.User.GetUserId())
|
||||
context.Succeed(requirement);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -30,6 +30,29 @@ namespace Yavsc.Controllers
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
private async Task<bool> CreateRoles () {
|
||||
// ensure all roles existence
|
||||
foreach (string roleName in new string[] {
|
||||
Constants.AdminGroupName,
|
||||
Constants.StarGroupName,
|
||||
Constants.PerformerGroupName,
|
||||
Constants.FrontOfficeGroupName,
|
||||
Constants.StarHunterGroupName,
|
||||
Constants.BlogModeratorGroupName
|
||||
})
|
||||
if (!await _roleManager.RoleExistsAsync(roleName))
|
||||
{
|
||||
var role = new IdentityRole { Name = roleName };
|
||||
var resultCreate = await _roleManager.CreateAsync(role);
|
||||
if (!resultCreate.Succeeded)
|
||||
{
|
||||
AddErrors(resultCreate);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Gives the (new if was not existing) administrator role
|
||||
/// to current authenticated user, when no existing
|
||||
@ -42,25 +65,18 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
// If some amdin already exists, make this method disapear
|
||||
var admins = await _userManager.GetUsersInRoleAsync(Constants.AdminGroupName);
|
||||
if (admins != null && admins.Count > 0) return HttpNotFound();
|
||||
|
||||
// ensure all roles existence
|
||||
foreach (string roleName in new string[] {Constants.AdminGroupName,
|
||||
Constants.StarGroupName, Constants.PerformerGroupName,
|
||||
Constants.FrontOfficeGroupName,
|
||||
Constants.StarHunterGroupName
|
||||
})
|
||||
if (!await _roleManager.RoleExistsAsync(roleName))
|
||||
if (admins != null && admins.Count > 0)
|
||||
{
|
||||
if (User.IsInRole(Constants.AdminGroupName))
|
||||
{
|
||||
var role = new IdentityRole { Name = roleName };
|
||||
var resultCreate = await _roleManager.CreateAsync(role);
|
||||
if (!resultCreate.Succeeded)
|
||||
{
|
||||
AddErrors(resultCreate);
|
||||
// check all user groups exist
|
||||
if (!await CreateRoles())
|
||||
return new BadRequestObjectResult(ModelState);
|
||||
}
|
||||
return Ok(new { message = "you checked the role list." });
|
||||
}
|
||||
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
var user = await _userManager.FindByIdAsync(User.GetUserId());
|
||||
|
||||
IdentityRole adminRole;
|
||||
|
167
Yavsc/Controllers/AnnouncesController.cs
Normal file
167
Yavsc/Controllers/AnnouncesController.cs
Normal file
@ -0,0 +1,167 @@
|
||||
using System.Threading.Tasks;
|
||||
using Yavsc.ViewModels.Auth;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.Data.Entity;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Messaging;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
public class AnnouncesController : Controller
|
||||
{
|
||||
private ApplicationDbContext _context;
|
||||
IStringLocalizer<AnnouncesController> _localizer;
|
||||
|
||||
IAuthorizationService _authorizationService;
|
||||
|
||||
public AnnouncesController(ApplicationDbContext context,
|
||||
IAuthorizationService authorizationService,
|
||||
IStringLocalizer<AnnouncesController> localizer)
|
||||
{
|
||||
_context = context;
|
||||
_authorizationService = authorizationService;
|
||||
_localizer = localizer;
|
||||
}
|
||||
|
||||
// GET: Announces
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
return View(await _context.Announce.ToListAsync());
|
||||
}
|
||||
|
||||
// GET: Announces/Details/5
|
||||
public async Task<IActionResult> Details(long? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
Announce announce = await _context.Announce.SingleAsync(m => m.Id == id);
|
||||
if (announce == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(announce);
|
||||
}
|
||||
|
||||
// GET: Announces/Create
|
||||
public async Task<IActionResult> Create()
|
||||
{
|
||||
var model = new Announce();
|
||||
await SetupView(model);
|
||||
return View(model);
|
||||
}
|
||||
private async Task SetupView(Announce announce)
|
||||
{
|
||||
ViewBag.IsAdmin = User.IsInRole(Constants.AdminGroupName);
|
||||
ViewBag.IsPerformer = User.IsInRole(Constants.PerformerGroupName);
|
||||
ViewBag.AllowEdit = (announce!=null && announce.Id>0) ?
|
||||
await _authorizationService.AuthorizeAsync(User,announce,new EditRequirement()) :
|
||||
true;
|
||||
List<SelectListItem> dl = new List<SelectListItem>();
|
||||
var rnames = System.Enum.GetNames(typeof(Reason));
|
||||
var rvalues = System.Enum.GetValues(typeof(Reason));
|
||||
|
||||
for (int i = 0; i<rnames.Length; i++) {
|
||||
dl.Add(new SelectListItem { Text =
|
||||
_localizer[rnames[i]],
|
||||
Value= rvalues.GetValue(i).ToString() });
|
||||
}
|
||||
|
||||
ViewBag.For = dl.ToArray();
|
||||
}
|
||||
// POST: Announces/Create
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Create(Announce announce)
|
||||
{
|
||||
await SetupView(announce);
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// Only allow admin to create corporate annonces
|
||||
if (announce.For == Reason.Corporate && ! ViewBag.IsAdmin)
|
||||
{
|
||||
ModelState.AddModelError("For", _localizer["YourNotAdmin"]);
|
||||
return View(announce);
|
||||
}
|
||||
|
||||
// Only allow performers to create ServiceProposal
|
||||
if (announce.For == Reason.ServiceProposal && ! ViewBag.IsAdmin)
|
||||
{
|
||||
ModelState.AddModelError("For", _localizer["YourNotAPerformer"]);
|
||||
return View(announce);
|
||||
}
|
||||
|
||||
_context.Announce.Add(announce);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(announce);
|
||||
}
|
||||
|
||||
// GET: Announces/Edit/5
|
||||
public async Task<IActionResult> Edit(long? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
Announce announce = await _context.Announce.SingleAsync(m => m.Id == id);
|
||||
if (announce == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
return View(announce);
|
||||
}
|
||||
|
||||
// POST: Announces/Edit/5
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Edit(Announce announce)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Update(announce);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(announce);
|
||||
}
|
||||
|
||||
// GET: Announces/Delete/5
|
||||
[ActionName("Delete")]
|
||||
public async Task<IActionResult> Delete(long? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
Announce announce = await _context.Announce.SingleAsync(m => m.Id == id);
|
||||
if (announce == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(announce);
|
||||
}
|
||||
|
||||
// POST: Announces/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(long id)
|
||||
{
|
||||
Announce announce = await _context.Announce.SingleAsync(m => m.Id == id);
|
||||
_context.Announce.Remove(announce);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
}
|
@ -121,6 +121,7 @@ namespace Yavsc.Controllers
|
||||
return new ChallengeResult();
|
||||
}
|
||||
ViewData["apicmtctlr"] = "/api/blogcomments";
|
||||
ViewData["moderatoFlag"] = User.IsInRole(Constants.BlogModeratorGroupName);
|
||||
return View(blog);
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ Le client final: {clientFinal}
|
||||
return await Index();
|
||||
}
|
||||
/// <summary>
|
||||
/// List client's queries
|
||||
/// List client's queries (and only client's ones)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override async Task<IActionResult> Index()
|
||||
@ -192,7 +192,7 @@ Le client final: {clientFinal}
|
||||
.Include(x => x.PerformerProfile)
|
||||
.Include(x => x.PerformerProfile.Performer)
|
||||
.Include(x => x.Location)
|
||||
.Where(x => x.ClientId == uid || x.PerformerId == uid)
|
||||
.Where(x => x.ClientId == uid)
|
||||
.ToListAsync());
|
||||
}
|
||||
|
||||
|
@ -53,15 +53,14 @@ namespace Yavsc.Controllers
|
||||
n=> !clicked.Any(c=>n.Id==c)
|
||||
);
|
||||
this.Notify(notes);
|
||||
ViewData["HasHaircutCommand"] = DbContext.HairCutQueries.Any
|
||||
(q=>q.ClientId == uid && q.Status < QueryStatus.Failed);
|
||||
|
||||
ViewData["HaircutCommandCount"] = DbContext.HairCutQueries.Where(
|
||||
q=>q.ClientId == uid && q.Status < QueryStatus.Failed
|
||||
).Count();
|
||||
if (id==null) {
|
||||
// Workaround
|
||||
// NotImplementedException: Remotion.Linq.Clauses.ResultOperators.ConcatResultOperator
|
||||
//
|
||||
// Use Concat()| whatever to do left outer join on ToArray() or ToList(), not on IQueryable
|
||||
|
||||
var legacy = DbContext.Activities
|
||||
.Include(a=>a.Forms).Include(a=>a.Children)
|
||||
.Where(a=> !a.Hidden)
|
||||
|
7
Yavsc/Interfaces/IOwned.cs
Normal file
7
Yavsc/Interfaces/IOwned.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Yavsc.Interfaces
|
||||
{
|
||||
public interface IOwned
|
||||
{
|
||||
string OwnerId { get; }
|
||||
}
|
||||
}
|
1697
Yavsc/Migrations/20171008184908_annouce.Designer.cs
generated
Normal file
1697
Yavsc/Migrations/20171008184908_annouce.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
767
Yavsc/Migrations/20171008184908_annouce.cs
Normal file
767
Yavsc/Migrations/20171008184908_annouce.cs
Normal file
@ -0,0 +1,767 @@
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
public partial class annouce : 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_BlogPost_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_BlogTag_BlogPost_PostId", table: "BlogTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BlogTag_Tag_TagId", table: "BlogTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Comment_BlogPost_PostId", table: "Comment");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Schedule_ApplicationUser_OwnerId", table: "Schedule");
|
||||
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_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.CreateTable(
|
||||
name: "Announce",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:Serial", true),
|
||||
For = table.Column<int>(nullable: false),
|
||||
Message = table.Column<string>(nullable: true),
|
||||
Sender = table.Column<string>(nullable: true),
|
||||
Topic = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Announce", x => x.Id);
|
||||
});
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "UserCreated",
|
||||
table: "Comment",
|
||||
nullable: false);
|
||||
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_BlogPost_BlogPostId",
|
||||
table: "CircleAuthorizationToBlogPost",
|
||||
column: "BlogPostId",
|
||||
principalTable: "BlogPost",
|
||||
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_BlogTag_BlogPost_PostId",
|
||||
table: "BlogTag",
|
||||
column: "PostId",
|
||||
principalTable: "BlogPost",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BlogTag_Tag_TagId",
|
||||
table: "BlogTag",
|
||||
column: "TagId",
|
||||
principalTable: "Tag",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Comment_BlogPost_PostId",
|
||||
table: "Comment",
|
||||
column: "PostId",
|
||||
principalTable: "BlogPost",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Comment_ApplicationUser_UserCreated",
|
||||
table: "Comment",
|
||||
column: "UserCreated",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Schedule_ApplicationUser_OwnerId",
|
||||
table: "Schedule",
|
||||
column: "OwnerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
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_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_BlogPost_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_BlogTag_BlogPost_PostId", table: "BlogTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BlogTag_Tag_TagId", table: "BlogTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Comment_BlogPost_PostId", table: "Comment");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Comment_ApplicationUser_UserCreated", table: "Comment");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Schedule_ApplicationUser_OwnerId", table: "Schedule");
|
||||
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_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("Announce");
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "UserCreated",
|
||||
table: "Comment",
|
||||
nullable: true);
|
||||
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_BlogPost_BlogPostId",
|
||||
table: "CircleAuthorizationToBlogPost",
|
||||
column: "BlogPostId",
|
||||
principalTable: "BlogPost",
|
||||
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_BlogTag_BlogPost_PostId",
|
||||
table: "BlogTag",
|
||||
column: "PostId",
|
||||
principalTable: "BlogPost",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BlogTag_Tag_TagId",
|
||||
table: "BlogTag",
|
||||
column: "TagId",
|
||||
principalTable: "Tag",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Comment_BlogPost_PostId",
|
||||
table: "Comment",
|
||||
column: "PostId",
|
||||
principalTable: "BlogPost",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Schedule_ApplicationUser_OwnerId",
|
||||
table: "Schedule",
|
||||
column: "OwnerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
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_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);
|
||||
}
|
||||
}
|
||||
}
|
1706
Yavsc/Migrations/20171008190234_announceAnwer.Designer.cs
generated
Normal file
1706
Yavsc/Migrations/20171008190234_announceAnwer.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
764
Yavsc/Migrations/20171008190234_announceAnwer.cs
Normal file
764
Yavsc/Migrations/20171008190234_announceAnwer.cs
Normal file
@ -0,0 +1,764 @@
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
public partial class announceAnwer : 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_BlogPost_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_BlogTag_BlogPost_PostId", table: "BlogTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BlogTag_Tag_TagId", table: "BlogTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Comment_BlogPost_PostId", table: "Comment");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Comment_ApplicationUser_UserCreated", table: "Comment");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Schedule_ApplicationUser_OwnerId", table: "Schedule");
|
||||
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_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.AddColumn<string>(
|
||||
name: "OwnerId",
|
||||
table: "Announce",
|
||||
nullable: true);
|
||||
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_BlogPost_BlogPostId",
|
||||
table: "CircleAuthorizationToBlogPost",
|
||||
column: "BlogPostId",
|
||||
principalTable: "BlogPost",
|
||||
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_BlogTag_BlogPost_PostId",
|
||||
table: "BlogTag",
|
||||
column: "PostId",
|
||||
principalTable: "BlogPost",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BlogTag_Tag_TagId",
|
||||
table: "BlogTag",
|
||||
column: "TagId",
|
||||
principalTable: "Tag",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Comment_BlogPost_PostId",
|
||||
table: "Comment",
|
||||
column: "PostId",
|
||||
principalTable: "BlogPost",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Comment_ApplicationUser_UserCreated",
|
||||
table: "Comment",
|
||||
column: "UserCreated",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Schedule_ApplicationUser_OwnerId",
|
||||
table: "Schedule",
|
||||
column: "OwnerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
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_Announce_ApplicationUser_OwnerId",
|
||||
table: "Announce",
|
||||
column: "OwnerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
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_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_BlogPost_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_BlogTag_BlogPost_PostId", table: "BlogTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BlogTag_Tag_TagId", table: "BlogTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Comment_BlogPost_PostId", table: "Comment");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Comment_ApplicationUser_UserCreated", table: "Comment");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Schedule_ApplicationUser_OwnerId", table: "Schedule");
|
||||
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_Announce_ApplicationUser_OwnerId", table: "Announce");
|
||||
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_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: "OwnerId", table: "Announce");
|
||||
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_BlogPost_BlogPostId",
|
||||
table: "CircleAuthorizationToBlogPost",
|
||||
column: "BlogPostId",
|
||||
principalTable: "BlogPost",
|
||||
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_BlogTag_BlogPost_PostId",
|
||||
table: "BlogTag",
|
||||
column: "PostId",
|
||||
principalTable: "BlogPost",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BlogTag_Tag_TagId",
|
||||
table: "BlogTag",
|
||||
column: "TagId",
|
||||
principalTable: "Tag",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Comment_BlogPost_PostId",
|
||||
table: "Comment",
|
||||
column: "PostId",
|
||||
principalTable: "BlogPost",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Comment_ApplicationUser_UserCreated",
|
||||
table: "Comment",
|
||||
column: "UserCreated",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Schedule_ApplicationUser_OwnerId",
|
||||
table: "Schedule",
|
||||
column: "OwnerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
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_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);
|
||||
}
|
||||
}
|
||||
}
|
@ -387,17 +387,17 @@ namespace Yavsc.Migrations
|
||||
b.Property<string>("AuthorId");
|
||||
|
||||
b.Property<string>("Content")
|
||||
.HasAnnotation("MaxLength", 57344);
|
||||
.HasAnnotation("MaxLength", 56224);
|
||||
|
||||
b.Property<DateTime>("DateCreated");
|
||||
|
||||
b.Property<DateTime>("DateModified");
|
||||
|
||||
b.Property<string>("Photo");
|
||||
|
||||
b.Property<int>("Rate")
|
||||
b.Property<string>("Photo")
|
||||
.HasAnnotation("MaxLength", 1024);
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasAnnotation("MaxLength", 1024);
|
||||
|
||||
@ -424,8 +424,7 @@ namespace Yavsc.Migrations
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Content")
|
||||
.HasAnnotation("MaxLength", 1024);
|
||||
b.Property<string>("Content");
|
||||
|
||||
b.Property<DateTime>("DateCreated");
|
||||
|
||||
@ -433,7 +432,8 @@ namespace Yavsc.Migrations
|
||||
|
||||
b.Property<long>("PostId");
|
||||
|
||||
b.Property<string>("UserCreated");
|
||||
b.Property<string>("UserCreated")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("UserModified");
|
||||
|
||||
@ -837,6 +837,24 @@ namespace Yavsc.Migrations
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Messaging.Announce", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("For");
|
||||
|
||||
b.Property<string>("Message");
|
||||
|
||||
b.Property<string>("OwnerId");
|
||||
|
||||
b.Property<string>("Sender");
|
||||
|
||||
b.Property<string>("Topic");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Messaging.ClientProviderInfo", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
@ -1375,6 +1393,10 @@ namespace Yavsc.Migrations
|
||||
b.HasOne("Yavsc.Models.Blog.BlogPost")
|
||||
.WithMany()
|
||||
.HasForeignKey("PostId");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserCreated");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b =>
|
||||
@ -1510,6 +1532,13 @@ namespace Yavsc.Migrations
|
||||
.HasForeignKey("ContextId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Messaging.Announce", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("OwnerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Messaging.ClientProviderInfo", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Relationship.Location")
|
||||
|
@ -291,5 +291,7 @@ namespace Yavsc.Models
|
||||
public DbSet<Bug> Bug { get; set; }
|
||||
|
||||
public DbSet<Comment> Comment { get; set; }
|
||||
|
||||
public DbSet<Announce> Announce { get; set; }
|
||||
}
|
||||
}
|
||||
|
28
Yavsc/Models/Messaging/Announce.cs
Normal file
28
Yavsc/Models/Messaging/Announce.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Interfaces;
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
public enum Reason {
|
||||
Private,
|
||||
Corporate,
|
||||
SearchingAPro,
|
||||
Selling,
|
||||
Buying,
|
||||
ServiceProposal
|
||||
|
||||
}
|
||||
public class Announce: BaseEvent, IOwned
|
||||
{
|
||||
public Reason For { get; set; }
|
||||
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId")]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
}
|
||||
}
|
73
Yavsc/Resources/Yavsc.Controllers.AnnouncesController.resx
Normal file
73
Yavsc/Resources/Yavsc.Controllers.AnnouncesController.resx
Normal file
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<!--
|
||||
route name for the api controller used to tag the 'BlogPost' entity
|
||||
-->
|
||||
<data name="YourNotAdmin"><value>Vous n'êtes pas administrateur</value></data>
|
||||
<data name="YourNotAPerformer"><value>Vous n'êtes pas prestataire</value></data>
|
||||
<data name="Private"><value>Privée</value></data>
|
||||
<data name="Corporate"><value>Corporate</value></data>
|
||||
<data name="SearchingAPro"><value>Recherche d'un professionnel</value></data>
|
||||
<data name="Selling"><value>Vente</value></data>
|
||||
<data name="Buying"><value>Offre d'achat</value></data>
|
||||
<data name="ServiceProposal">Offre de service<value></value></data>
|
||||
<data name="For"><value>Pour</value></data>
|
||||
</root>
|
@ -6,6 +6,8 @@ namespace Yavsc
|
||||
public string Slogan { get; set; }
|
||||
|
||||
public string Banner { get; set; }
|
||||
public string FavIcon { get; set; }
|
||||
public string Icon { get; set; }
|
||||
/// <summary>
|
||||
/// Conceptually,
|
||||
/// This authorisation server only has this present site as unique audience.
|
||||
|
55
Yavsc/Views/Announces/Create.cshtml
Normal file
55
Yavsc/Views/Announces/Create.cshtml
Normal file
@ -0,0 +1,55 @@
|
||||
@model Yavsc.Models.Messaging.Announce
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h2>Create</h2>
|
||||
|
||||
<form asp-action="Create">
|
||||
<div class="form-horizontal">
|
||||
<h4>Announce</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label asp-for="For" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<select asp-for="For" class="form-control" asp-items="@ViewBag.For"></select>
|
||||
<span asp-validation-for="For" class="text-danger" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label asp-for="Message" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="Message" class="form-control" />
|
||||
<span asp-validation-for="Message" class="text-danger" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Sender" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="Sender" class="form-control" />
|
||||
<span asp-validation-for="Sender" class="text-danger" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Topic" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="Topic" class="form-control" />
|
||||
<span asp-validation-for="Topic" class="text-danger" />
|
||||
</div>
|
||||
</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>
|
||||
|
46
Yavsc/Views/Announces/Delete.cshtml
Normal file
46
Yavsc/Views/Announces/Delete.cshtml
Normal file
@ -0,0 +1,46 @@
|
||||
@model Yavsc.Models.Messaging.Announce
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h2>Delete</h2>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>Announce</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.For)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.For)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Message)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Message)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Sender)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Sender)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Topic)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Topic)
|
||||
</dd>
|
||||
</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>
|
42
Yavsc/Views/Announces/Details.cshtml
Normal file
42
Yavsc/Views/Announces/Details.cshtml
Normal file
@ -0,0 +1,42 @@
|
||||
@model Yavsc.Models.Messaging.Announce
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h2>Details</h2>
|
||||
|
||||
<div>
|
||||
<h4>Announce</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.For)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.For)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Message)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Message)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Sender)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Sender)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Topic)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Topic)
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<p>
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</p>
|
54
Yavsc/Views/Announces/Edit.cshtml
Normal file
54
Yavsc/Views/Announces/Edit.cshtml
Normal file
@ -0,0 +1,54 @@
|
||||
@model Yavsc.Models.Messaging.Announce
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h2>Edit</h2>
|
||||
|
||||
<form asp-action="Edit">
|
||||
<div class="form-horizontal">
|
||||
<h4>Announce</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="For" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<select asp-for="For" class="form-control"></select>
|
||||
<span asp-validation-for="For" class="text-danger" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Message" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="Message" class="form-control" />
|
||||
<span asp-validation-for="Message" class="text-danger" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Sender" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="Sender" class="form-control" />
|
||||
<span asp-validation-for="Sender" class="text-danger" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Topic" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="Topic" class="form-control" />
|
||||
<span asp-validation-for="Topic" class="text-danger" />
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
|
50
Yavsc/Views/Announces/Index.cshtml
Normal file
50
Yavsc/Views/Announces/Index.cshtml
Normal file
@ -0,0 +1,50 @@
|
||||
@model IEnumerable<Yavsc.Models.Messaging.Announce>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h2>Index</h2>
|
||||
|
||||
<p>
|
||||
<a asp-action="Create">Create New</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.For)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Message)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Sender)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Topic)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.For)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Message)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Sender)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Topic)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
@ -1,84 +0,0 @@
|
||||
@model BlogPost
|
||||
@{
|
||||
ViewData["Title"]=Model.Title;
|
||||
}
|
||||
<!--
|
||||
@section scripts {
|
||||
<script src="~/js/comment.js" asp-append-version="true"></script>
|
||||
<script>
|
||||
$(document).ready() {
|
||||
var doComment = new function(ctrlr, receiverid, comment) {
|
||||
console.log('commentting:' + comment);
|
||||
$.post(ctrlr, { Content: comment, Receiver: @Model.Id })
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
}
|
||||
-->
|
||||
<div class="container">
|
||||
<h1 class="blogtitle" ismarkdown>@Model.Title</h1>
|
||||
<img class="blogphoto" alt="" src="@Model.Photo" >
|
||||
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
|
||||
<div class="blogpost">
|
||||
|
||||
<div markdown="@Model.Content" class="blog"></div>
|
||||
<hr/>
|
||||
|
||||
<div class="meta">
|
||||
@Html.DisplayFor(model => model.Author)
|
||||
|
||||
@Html.DisplayNameFor(model => model.DateModified) :
|
||||
|
||||
@Html.DisplayFor(model => model.DateModified)
|
||||
|
||||
@Html.DisplayNameFor(model => model.DateCreated) :
|
||||
|
||||
@Html.DisplayFor(model => model.DateCreated)
|
||||
|
||||
@Component.Invoke("Tagger",Model)
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="comments">
|
||||
<!-- @foreach (var comment in model=>model.Comments) {
|
||||
<div markdown="@Model.Content" class="blogcomment">
|
||||
</div>
|
||||
<div markdown="@Model.Content" class="commentauthor">
|
||||
@Html.Display("ApplicationUser",c.Author)
|
||||
</div>
|
||||
}
|
||||
|
||||
<form>
|
||||
<div class="form-horizontal">
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<div class="input-group" >
|
||||
<input asp-for="Content" class="form-control" placeholder="@SR["DoCommentPlaceHolder"]"/>
|
||||
<span class="input-group-btn">
|
||||
<input type="button" value="@SR["DoComment"]" class="btn btn-secondary"
|
||||
onclick="doComment('@ViewData["apictlr"]',@Model.PostId,$('#Content').val())"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<span asp-validation-for="Content" class="text-danger" >
|
||||
</span>
|
||||
|
||||
<input type="hidden" name="PostId" value="@Model.PostId"/>
|
||||
<input type="hidden" name="Id" value="@Model.Id"/>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
@if (await AuthorizationService.AuthorizeAsync(User, Model, new EditRequirement())) {
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-link">@SR["Edit"]</a>
|
||||
}
|
||||
<a asp-action="Index" class="btn btn-link">@SR["Back to List"]</a>
|
@ -4,10 +4,11 @@
|
||||
}
|
||||
@section header {
|
||||
<script>
|
||||
$.psc.blogcomment.prototype.options.lang = '@System.Globalization.CultureInfo.CurrentUICulture.Name';
|
||||
$.psc.blogcomment.prototype.options.apictrlr = '@ViewData["apicmtctlr"]';
|
||||
$(document).ready(function() {
|
||||
$('#cmtBtn').click(function() {
|
||||
var receiverid = $(this).data('receiverid');
|
||||
|
||||
var comment = $('#Comment').val();
|
||||
var data = {
|
||||
Id:0,
|
||||
@ -16,8 +17,6 @@
|
||||
UserCreated: '@User.GetUserId()',
|
||||
Visible:true
|
||||
};
|
||||
console.log('sending:');
|
||||
console.log(data);
|
||||
|
||||
$.ajax({
|
||||
async: true,
|
||||
@ -29,7 +28,6 @@
|
||||
error: function(xhr,data) {
|
||||
if (xhr.status=400)
|
||||
{
|
||||
console.log(xhr.responseJSON);
|
||||
$('span.field-validation-valid[data-valmsg-for="Content"]').html(
|
||||
xhr.responseJSON.Content);
|
||||
} else {
|
||||
@ -40,15 +38,25 @@ $('span.field-validation-valid[data-valmsg-for="Content"]').html(
|
||||
}
|
||||
|
||||
},
|
||||
success: function () {
|
||||
$('#Comment').val("");
|
||||
success: function (data) {
|
||||
var comment = $('#Comment').val();
|
||||
$('#Comment').val('');
|
||||
$('span.field-validation-valid[data-valmsg-for="Content"]').empty();
|
||||
var htmlcmt = htmlize(comment);
|
||||
var nnode = '<div data-type="blogcomment" data-id="'+data.Id+'" data-allow-edit="True" data-allow-moderate="@ViewData["moderatoFlag"]" data-date="'+data.DateCreated+'" data-username="@User.GetUserName()">'+htmlcmt+'</div>';
|
||||
|
||||
$('#comments').append($(nnode).blogcomment())
|
||||
},
|
||||
url:'@ViewData["apicmtctlr"]'
|
||||
});
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
.avatar, .commentmeta, .blogcomment p , .blogcomment {
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
<div class="container">
|
||||
<h1 class="blogtitle" ismarkdown>@Model.Title</h1>
|
||||
@ -71,21 +79,15 @@ $('span.field-validation-valid[data-valmsg-for="Content"]').html(
|
||||
|
||||
@Component.Invoke("Tagger",Model)
|
||||
</div>
|
||||
@if (Model.Comments.Count>0) {
|
||||
<div class="comments">
|
||||
@foreach (Comment comment in Model.Comments) {
|
||||
<div class="blogcomment" >
|
||||
|
||||
<div class="commentmeta" style="display: inline-block">
|
||||
@Html.DisplayFor(c=>c.Author,"ApplicationUserLink","cmtauth",comment)
|
||||
<div><i>@Html.DisplayFor(c=>c.DateCreated,null,"dteCmt",comment)</i></div>
|
||||
</div>
|
||||
<div markdown="@comment.Content" style="display: inline-block;">
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<form>
|
||||
<div id="comments">
|
||||
@if (Model.Comments.Count>0) { foreach (Comment comment in Model.Comments) {
|
||||
<div data-type="blogcomment" data-id="@comment.Id" data-allow-edit="@(User.GetUserId()==comment.UserCreated?"true":"false")" data-allow-moderate="@ViewData["moderatoFlag"]"
|
||||
data-date="@Html.Raw(comment.DateCreated)" data-username="@comment.Author.UserName" markdown="@comment.Content"
|
||||
>
|
||||
</div>
|
||||
} }
|
||||
</div>
|
||||
<div class="form-horizontal">
|
||||
<div class="input-group" >
|
||||
<input id="Comment" class="form-control" placeholder="@SR["DoCommentPlaceHolder"]"/>
|
||||
@ -95,12 +97,8 @@ $('span.field-validation-valid[data-valmsg-for="Content"]').html(
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<span asp-validation-for="Content" class="text-danger" >
|
||||
</span>
|
||||
<span asp-validation-for="Content" class="text-danger" ></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@if (await AuthorizationService.AuthorizeAsync(User, Model, new EditRequirement())) {
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-link">@SR["Edit"]</a>
|
||||
|
@ -34,9 +34,7 @@
|
||||
</style>
|
||||
<script src="~/js/dropzone.js"></script>
|
||||
<script src="~/js/quill.js"></script>
|
||||
<script src="~/js/showdown.js"></script>
|
||||
<script src="~/js/to-markdown.js"></script>
|
||||
<script src="~/js/md-helpers.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".mdcoding").addClass('hidden');
|
||||
|
@ -10,6 +10,10 @@
|
||||
.collapsed {
|
||||
height: 1em;
|
||||
}
|
||||
.sametitlegrip {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
.sametitle {
|
||||
overflow: hidden;
|
||||
transition: height 1s;
|
||||
@ -17,8 +21,8 @@
|
||||
td {
|
||||
transition: height 1s;
|
||||
}
|
||||
[class*="col-"] {
|
||||
border: solid 1px blue;
|
||||
div.row {
|
||||
border-bottom: dashed black 1px;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
@ -101,7 +105,8 @@
|
||||
long gcount = group.Count();
|
||||
@if (gcount>1) {
|
||||
<div class="sametitle">
|
||||
@(gcount-1) autre@(gcount>2?"s":"") au même titre:
|
||||
<div class="sametitlegrip">@(gcount-1) autre@(gcount>2?"s":"") au même titre:</div>
|
||||
|
||||
|
||||
@foreach (var item in group.Skip(1)) {
|
||||
trclass = ((item.Visible)?"visiblepost":"hiddenpost");
|
||||
|
@ -7,7 +7,7 @@
|
||||
<div class="panel">
|
||||
<em>Salons</em>
|
||||
<ul>
|
||||
<li id="pubChan">Public</li>
|
||||
<li id="pubChan"><button>Public</button></li>
|
||||
</ul>
|
||||
<em>Utilisateurs</em>
|
||||
<ul id="userlist" style="list-style:none;">
|
||||
|
@ -89,8 +89,13 @@
|
||||
}
|
||||
|
||||
@section ctxmenu {
|
||||
@if ((bool)ViewData["HasHaircutCommand"]) {
|
||||
@if (ViewData["Announces"]!=null) {
|
||||
<li><a asp-controller="HairCutCommand" class="badge" >
|
||||
<img src="~/images/shoppingcart.svg" alt="basket" /></a></li>
|
||||
<img src="@SiteSettings.Value.Icon" alt="basket" title="Annonces @SiteSettings.Value.Title" /></a></li>
|
||||
}
|
||||
@if ((int)ViewData["HaircutCommandCount"]>0) {
|
||||
<li><a asp-controller="HairCutCommand" class="badge" >
|
||||
<img src="~/images/shoppingcart.svg" alt="basket" title="Vos commandes en coiffure à domicile" />(@ViewData["HaircutCommandCount"])</a></li>
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
@model ShortUserInfo
|
||||
<div style="display: inline-block;">
|
||||
<img src="@Model.Avatar" alt="@Model.UserName" class="smalltofhol" />
|
||||
<div >@Model.UserName</div>
|
||||
@Model.UserName
|
||||
</div>
|
@ -6,32 +6,38 @@
|
||||
<link rel="icon" href="~/favicon.ico" asp-append-version="true" />
|
||||
<title>@ViewData["Title"] - @SiteSettings.Value.Title</title>
|
||||
|
||||
|
||||
<environment names="Development">
|
||||
<script src="~/js/jquery-2.2.4.js" ></script>
|
||||
<script src="~/js/showdown.js"></script>
|
||||
<script src="~/js/md-helpers.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="~/css/main/bootstrap.css" asp-append-version="true"/>
|
||||
<link rel="stylesheet" href="~/css/main/site.css" asp-append-version="true"/>
|
||||
<link rel="stylesheet" href="~/css/main/jquery-ui.css" asp-append-version="true"/>
|
||||
<link rel="alternate stylesheet" title="Dark" href="~/css/dark/site.css" asp-append-version="true" />
|
||||
<link rel="alternate stylesheet" title="Clear" href="~/css/clear/site.css" asp-append-version="true" />
|
||||
<script src="~/js/jquery.js" asp-append-version="true"></script>
|
||||
<script src="~/js/jquery-ui.js" asp-append-version="true"></script>
|
||||
<script src="~/js/bootstrap.js" asp-append-version="true"></script>
|
||||
<script src="~/js/jquery.signalR-2.2.1.js" asp-append-version="true"></script>
|
||||
<script src="~/js/comment.js" asp-append-version="true"></script>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
</environment>
|
||||
|
||||
<environment names="yavsc,yavscpre,zicmoove,lua,coiffure">
|
||||
<script src="~/js/jquery-2.2.4.min.js" ></script>
|
||||
<script src="~/js/showdown.min.js"></script>
|
||||
<script src="~/js/md-helpers.min.js"></script>
|
||||
<link rel="stylesheet" href="~/css/main/bootstrap.min.css" asp-append-version="true"/>
|
||||
<link rel="stylesheet" href="~/css/main/site.min.css" asp-append-version="true"/>
|
||||
<link rel="stylesheet" href="~/css/main/jquery-ui.min.css" asp-append-version="true"/>
|
||||
<link rel="alternate stylesheet" title="Dark" href="~/css/dark/site.min.css" asp-append-version="true" />
|
||||
<link rel="alternate stylesheet" title="Clear" href="~/css/clear/site.min.css" asp-append-version="true" />
|
||||
|
||||
<script src="~/js/jquery.min.js">
|
||||
</script>
|
||||
<script src="~/js/bootstrap.min.js">
|
||||
</script>
|
||||
<script src="~/js/bootstrap.min.js"></script>
|
||||
<script src="~/js/jquery-ui.min.js" asp-append-version="true"></script>
|
||||
<script src="~/js/jquery.signalR-2.2.1.min.js" asp-append-version="true"></script>
|
||||
<script src="~/js/comment.min.js" asp-append-version="true"></script>
|
||||
<script src="~/js/site.min.js" asp-append-version="true"></script>
|
||||
|
||||
</environment>
|
||||
|
2337
Yavsc/wwwroot/css/font-awesome.css
vendored
Normal file
2337
Yavsc/wwwroot/css/font-awesome.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
Yavsc/wwwroot/css/font-awesome.min.css
vendored
Normal file
4
Yavsc/wwwroot/css/font-awesome.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -50,8 +50,8 @@
|
||||
|
||||
.smalltofhol {
|
||||
align-self: left;
|
||||
padding: .5em;
|
||||
border-radius: 32px;
|
||||
padding: .1em;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.commentmeta {
|
||||
|
2
Yavsc/wwwroot/css/main/site.min.css
vendored
2
Yavsc/wwwroot/css/main/site.min.css
vendored
@ -1 +1 @@
|
||||
.discussion,.notif,.pv{font-family:monospace}#targets,.userinfo{display:block}.blog a:active,.blog a:hover,a:active,a:hover{outline:0}#discussion,.blogphoto{float:left}.navbar-brand,.navbar-link,.navbar-nav .dropdown>a{background-color:rgba(0,0,0,.2);border-radius:2em;vertical-align:center}.navbar-brand:focus,.navbar-brand:hover,.navbar-link:focus,.navbar-link:hover{background-color:rgba(0,0,0,.4)}.ql-editor{border:1em outset #ee903e;padding:1em}.badge{margin:1em}.badge img{height:2em}.userinfo{padding:.8em .8em .8em 2em;margin:.6em;background-repeat:no-repeat;background-attachment:local;background-size:contain;background-image:url(/images/lis.svg);overflow:auto}.performer{border-radius:1.5em;background-color:#f1e4f1;padding:1em}.performer ul{margin-left:2.5em}.smalltofhol{align-self:left;padding:1em}.price,.total{font-weight:700;padding:.2em;margin:.2em}.price{font-size:large}.total{font-size:xx-large;background-color:#f8f;border:3px solid #000;border-radius:1em}.blog,.panel{padding:1em}.blog a{font-weight:900}.discussion{color:#000}.notif{color:#006}.pv{color:#251;font-style:bold}tr.visiblepost,tr.visiblepost img{max-height:3em}tr.hiddenpost{max-height:2em;background-color:#888;font-size:smaller}tr.hiddenpost img{max-height:3em}a.bloglink{font-weight:700;text-shadow:0 0 8px #000}a{font-weight:900}.panel{display:inline-block;margin:1em;color:#000;background-color:inherit;border:1px solid #000}button,input,select,textarea{background-color:#bbb;color:#000}.jumbotron{padding:.5em}.carousel .item .carousel-caption-s{-webkit-transition:-webkit-transform 2s background-color 2s color 2s;-moz-transition:transform 2s background-color 2s color 2s;transition:transform 2s;transform:scale3d(0,0,0);-webkit-transform:scale3d(0,0,0)}.carousel .item.active .carousel-caption-s{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}.disabled{color:#999;background-color:#555}.carousel-caption-s p{-webkit-text-shadow:3px 3px 7px #000;animation:mymove 4s infinite;font-family:Arial;font-weight:800;font-size:x-large;text-shadow:3px 3px 7px #00003c;color:#fff;background-color:rgba(94,24,194,.15);border-radius:.5em}.carousel-caption-s{right:3em;top:1em;left:3em;z-index:10;padding-top:20px;padding-bottom:20px;text-align:center;min-height:16em;overflow:auto}.carousel-inner .item{padding-left:15%;padding-right:15%}.carousel-indicators{position:absolute;z-index:15;padding:0;text-align:center;list-style:none;top:.1em;height:1em}main.container{padding-right:1em;padding-left:1em;margin-left:1em;margin-right:1em}@media (max-width:767px){main.container{padding-right:.3em;padding-left:.3em;margin-left:.3em;margin-right:.3em}.navbar-brand{float:left;height:50px;padding:5px;font-size:16px;line-height:18px}.carousel-caption-s p{margin:.2em;padding:.2em}}@-webkit-keyframes mymove{from,to{text-decoration-color:red}50%{text-decoration-color:#00f}}@keyframes mymove{from,to{text-decoration-color:red}50%{text-decoration-color:#00f}}ul.actiongroup li{display:inline}ul.actiongroup li a:hover{background-color:rgba(200,200,200,.6);color:#400}footer{vertical-align:bottom;padding:1.5em}.display-field{font-kerning:none;display:inline-flex;color:#008}.display-label{font-family:'Lucida Sans','Lucida Sans Regular','Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,sans-serif;font-stretch:condensed;display:inline-flex;color:#ff8;padding:.1em;border-radius:.5em;background-color:#210912}footer{color:grey;font-weight:bolder;font-size:x-small}.meta{color:#444;font-style:italic;font-size:smaller}.activity{font-family:fantasy}.blogtitle{display:inline-block;font-size:x-large}.blogphoto{margin:1em}.dl-horizontal dd{margin-left:20%}
|
||||
.discussion,.notif,.pv{font-family:monospace}#targets,.userinfo{display:block}.blog a:active,.blog a:hover,a:active,a:hover{outline:0}#discussion,.blogphoto{float:left}.navbar-brand,.navbar-link,.navbar-nav .dropdown>a{background-color:rgba(0,0,0,.2);border-radius:2em;vertical-align:center}.navbar-brand:focus,.navbar-brand:hover,.navbar-link:focus,.navbar-link:hover{background-color:rgba(0,0,0,.4)}.ql-editor{border:1em outset #ee903e;padding:1em}.badge{margin:1em}.badge img{height:2em}.userinfo{padding:.8em .8em .8em 2em;margin:.6em;background-repeat:no-repeat;background-attachment:local;background-size:contain;background-image:url(/images/lis.svg);overflow:auto}.performer{border-radius:1.5em;background-color:#f1e4f1;padding:1em}.performer ul{margin-left:2.5em}.smalltofhol{align-self:left;padding:.5em;border-radius:32px}.commentmeta{margin:.5em;padding:.5em;border-right:#444 dashed 1px;border-top:#444 solid 1px}.price,.total{font-weight:700;padding:.2em;margin:.2em}.price{font-size:large}.total{font-size:xx-large;background-color:#f8f;border:3px solid #000;border-radius:1em}.blog,.panel{padding:1em}.blog a{font-weight:900}.discussion{color:#000}.notif{color:#006}.pv{color:#251;font-style:bold}tr.visiblepost,tr.visiblepost img{max-height:3em}tr.hiddenpost{max-height:2em;background-color:#888;font-size:smaller}tr.hiddenpost img{max-height:3em}a.bloglink{font-weight:700;text-shadow:0 0 8px #000}a{font-weight:900}.panel{display:inline-block;margin:1em;color:#000;background-color:inherit;border:1px solid #000}button,input,select,textarea{background-color:#bbb;color:#000}.jumbotron{padding:.5em}.carousel .item .carousel-caption-s{-webkit-transition:-webkit-transform 2s background-color 2s color 2s;-moz-transition:transform 2s background-color 2s color 2s;transition:transform 2s;transform:scale3d(0,0,0);-webkit-transform:scale3d(0,0,0)}.carousel .item.active .carousel-caption-s{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}.disabled{color:#999;background-color:#555}.carousel-caption-s p{-webkit-text-shadow:3px 3px 7px #000;animation:mymove 4s infinite;font-family:Arial;font-weight:800;font-size:x-large;text-shadow:3px 3px 7px #00003c;color:#fff;background-color:rgba(94,24,194,.15);border-radius:.5em}.carousel-caption-s{right:3em;top:1em;left:3em;z-index:10;padding-top:20px;padding-bottom:20px;text-align:center;min-height:16em;overflow:auto}.carousel-inner .item{padding-left:15%;padding-right:15%}.carousel-indicators{position:absolute;z-index:15;padding:0;text-align:center;list-style:none;top:.1em;height:1em}main.container{padding-right:1em;padding-left:1em;margin-left:1em;margin-right:1em}@media (max-width:767px){main.container{padding-right:.3em;padding-left:.3em;margin-left:.3em;margin-right:.3em}.navbar-brand{float:left;height:50px;padding:5px;font-size:16px;line-height:18px}.carousel-caption-s p{margin:.2em;padding:.2em}}@-webkit-keyframes mymove{from,to{text-decoration-color:red}50%{text-decoration-color:#00f}}@keyframes mymove{from,to{text-decoration-color:red}50%{text-decoration-color:#00f}}ul.actiongroup li{display:inline}ul.actiongroup li a:hover{background-color:rgba(200,200,200,.6);color:#400}footer{vertical-align:bottom;padding:1.5em}.display-field{font-kerning:none;display:inline-flex;color:#008}.display-label{font-family:'Lucida Sans','Lucida Sans Regular','Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,sans-serif;font-stretch:condensed;display:inline-flex;color:#ff8;padding:.1em;border-radius:.5em;background-color:#210912}footer{color:grey;font-weight:bolder;font-size:x-small}.meta{color:#444;font-style:italic;font-size:smaller}.activity{font-family:fantasy}.blogtitle{display:inline-block;font-size:x-large}.blogphoto{margin:1em}.dl-horizontal dd{margin-left:20%}
|
80
Yavsc/wwwroot/js/comment.js
Normal file
80
Yavsc/wwwroot/js/comment.js
Normal file
@ -0,0 +1,80 @@
|
||||
if (typeof jQuery === 'undefined') {
|
||||
throw new Error('Bootstrap\'s JavaScript requires jQuery')
|
||||
}
|
||||
|
||||
+
|
||||
(function($) {
|
||||
$.widget("psc.blogcomment", {
|
||||
options: {
|
||||
apictrlr: null,
|
||||
omob: '#ffe08030',
|
||||
omof: '#501208',
|
||||
bgc: '#fff',
|
||||
fgc: '#000',
|
||||
lang: 'fr-FR'
|
||||
},
|
||||
editable: false,
|
||||
editting: false,
|
||||
edctrl: null,
|
||||
_create: function() {
|
||||
var _this = this;
|
||||
this.element.addClass("blogcomment");
|
||||
var date = new Date(this.element.data("date"));
|
||||
var username = this.element.data("username");
|
||||
this.editable = this.element.data("allow-edit");
|
||||
this.element.prepend('<div class="commentmeta"><div class="avatar"><img src="/Avatars/' + username + '.xs.png" class="smalltofhol" />' + username + '</div><div class="cmtdatetime">' +
|
||||
date.toLocaleDateString(this.options.lang) + ' ' + date.toLocaleTimeString(this.options.lang) + '</div></div>')
|
||||
this.element.on("mouseenter", this.onMouseEnter);
|
||||
this.element.on("mouseleave", this.onMouseLeave);
|
||||
if (this.editable) {
|
||||
this.element.on("click", function(ev) { _this.toggleEdit(_this, ev) })
|
||||
}
|
||||
},
|
||||
toggleEdit: function(_this, ev) {
|
||||
if (!_this.edctrl) {
|
||||
// TODO click on button
|
||||
_this.edctrl = $("<button class=\"btn btn-default\">Delete</button>");
|
||||
_this.edctrl.on("click", function(ev) { _this.doDeleteComment(_this, ev) }).appendTo(_this.element);
|
||||
} else {
|
||||
_this.edctrl.remove();
|
||||
_this.edctrl = null;
|
||||
}
|
||||
},
|
||||
onMouseEnter: function() {
|
||||
$(this).animate({
|
||||
backgroundColor: $.psc.blogcomment.prototype.options.omob,
|
||||
color: $.psc.blogcomment.prototype.options.omof
|
||||
}, 400);
|
||||
},
|
||||
onMouseLeave: function() {
|
||||
$(this).animate({
|
||||
backgroundColor: $.psc.blogcomment.prototype.options.bgc,
|
||||
color: $.psc.blogcomment.prototype.options.fgc
|
||||
}, 400);
|
||||
},
|
||||
doDeleteComment: function(_this, ev) {
|
||||
var cmtid = $(_this.element).data("id");
|
||||
var cmtapi = _this.options.apictrlr;
|
||||
$.ajax({
|
||||
async: true,
|
||||
cache: false,
|
||||
type: 'POST',
|
||||
method: 'DELETE',
|
||||
error: function(xhr, data) {
|
||||
$('span.field-validation-valid[data-valmsg-for="Content"]').html(
|
||||
"Une erreur est survenue : " + xhr.status + "<br/>"
|
||||
).focus()
|
||||
},
|
||||
success: function(data) {
|
||||
_this.element.remove()
|
||||
},
|
||||
url: cmtapi + '/' + cmtid
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$("[data-type='blogcomment']").blogcomment();
|
||||
})
|
||||
})(jQuery);
|
9814
Yavsc/wwwroot/js/jquery-2.2.4.js
vendored
Normal file
9814
Yavsc/wwwroot/js/jquery-2.2.4.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
Yavsc/wwwroot/js/jquery-2.2.4.min.js
vendored
Normal file
4
Yavsc/wwwroot/js/jquery-2.2.4.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10253
Yavsc/wwwroot/js/jquery-3.2.1.js
vendored
Normal file
10253
Yavsc/wwwroot/js/jquery-3.2.1.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
Yavsc/wwwroot/js/jquery-3.2.1.min.js
vendored
Normal file
4
Yavsc/wwwroot/js/jquery-3.2.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
Yavsc/wwwroot/js/jquery-migrate-3.0.0.min.js
vendored
Normal file
2
Yavsc/wwwroot/js/jquery-migrate-3.0.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user