colors (ctor)
This commit is contained in:
122
Yavsc/Controllers/ColorsController.cs
Normal file
122
Yavsc/Controllers/ColorsController.cs
Normal file
@ -0,0 +1,122 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
using Microsoft.Data.Entity;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Drawing;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
public class ColorsController : Controller
|
||||
{
|
||||
private ApplicationDbContext _context;
|
||||
|
||||
public ColorsController(ApplicationDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: Colors
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
return View(await _context.Color.ToListAsync());
|
||||
}
|
||||
|
||||
// GET: Colors/Details/5
|
||||
public async Task<IActionResult> Details(byte? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
Color color = await _context.Color.SingleAsync(m => m.Red == id);
|
||||
if (color == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(color);
|
||||
}
|
||||
|
||||
// GET: Colors/Create
|
||||
public IActionResult Create()
|
||||
{
|
||||
return View(new Color());
|
||||
}
|
||||
|
||||
// POST: Colors/Create
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Create(Color color)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Color.Add(color);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(color);
|
||||
}
|
||||
|
||||
// GET: Colors/Edit/5
|
||||
public async Task<IActionResult> Edit(byte? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
Color color = await _context.Color.SingleAsync(m => m.Red == id);
|
||||
if (color == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
return View(color);
|
||||
}
|
||||
|
||||
// POST: Colors/Edit/5
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Edit(Color color)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Update(color);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(color);
|
||||
}
|
||||
|
||||
// GET: Colors/Delete/5
|
||||
[ActionName("Delete")]
|
||||
public async Task<IActionResult> Delete(byte? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
Color color = await _context.Color.SingleAsync(m => m.Red == id);
|
||||
if (color == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(color);
|
||||
}
|
||||
|
||||
// POST: Colors/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(byte id)
|
||||
{
|
||||
Color color = await _context.Color.SingleAsync(m => m.Red == id);
|
||||
_context.Color.Remove(color);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
}
|
124
Yavsc/Controllers/HairTaintsController.cs
Normal file
124
Yavsc/Controllers/HairTaintsController.cs
Normal file
@ -0,0 +1,124 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
using Microsoft.Data.Entity;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
using Models;
|
||||
using Models.Haircut;
|
||||
[Authorize("AdministratorOnly")]
|
||||
public class HairTaintsController : Controller
|
||||
{
|
||||
private ApplicationDbContext _context;
|
||||
|
||||
public HairTaintsController(ApplicationDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: HairTaints
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
return View(await _context.HairTaint.ToListAsync());
|
||||
}
|
||||
|
||||
// GET: HairTaints/Details/5
|
||||
public async Task<IActionResult> Details(long? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
HairTaint hairTaint = await _context.HairTaint.SingleAsync(m => m.Id == id);
|
||||
if (hairTaint == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(hairTaint);
|
||||
}
|
||||
|
||||
// GET: HairTaints/Create
|
||||
public IActionResult Create()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
// POST: HairTaints/Create
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Create(HairTaint hairTaint)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.HairTaint.Add(hairTaint);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(hairTaint);
|
||||
}
|
||||
|
||||
// GET: HairTaints/Edit/5
|
||||
public async Task<IActionResult> Edit(long? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
HairTaint hairTaint = await _context.HairTaint.SingleAsync(m => m.Id == id);
|
||||
if (hairTaint == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
return View(hairTaint);
|
||||
}
|
||||
|
||||
// POST: HairTaints/Edit/5
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Edit(HairTaint hairTaint)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Update(hairTaint);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(hairTaint);
|
||||
}
|
||||
|
||||
// GET: HairTaints/Delete/5
|
||||
[ActionName("Delete")]
|
||||
public async Task<IActionResult> Delete(long? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
HairTaint hairTaint = await _context.HairTaint.SingleAsync(m => m.Id == id);
|
||||
if (hairTaint == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(hairTaint);
|
||||
}
|
||||
|
||||
// POST: HairTaints/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(long id)
|
||||
{
|
||||
HairTaint hairTaint = await _context.HairTaint.SingleAsync(m => m.Id == id);
|
||||
_context.HairTaint.Remove(hairTaint);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
}
|
15
Yavsc/Helpers/HtmlHelpers.cs
Normal file
15
Yavsc/Helpers/HtmlHelpers.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
using Yavsc.Models.Drawing;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
public static class HtmlHelpers
|
||||
{
|
||||
public static HtmlString Color(this Color c)
|
||||
{
|
||||
if (c==null) return new HtmlString("#000");
|
||||
return new HtmlString(String.Format("#{0:X2}{1:X2}{2:X2}", c.Red, c.Green, c.Blue));
|
||||
}
|
||||
}
|
||||
}
|
1150
Yavsc/Migrations/20170212005346_haircut.Designer.cs
generated
Normal file
1150
Yavsc/Migrations/20170212005346_haircut.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
453
Yavsc/Migrations/20170212005346_haircut.cs
Normal file
453
Yavsc/Migrations/20170212005346_haircut.cs
Normal file
@ -0,0 +1,453 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
public partial class haircut : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BlackListed_ApplicationUser_OwnerId", table: "BlackListed");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Blog_BlogPostId", table: "CircleAuthorizationToBlogPost");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId", table: "CircleAuthorizationToBlogPost");
|
||||
migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Estimate_ApplicationUser_ClientId", table: "Estimate");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Estimate_PerformerProfile_OwnerId", table: "Estimate");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_Activity_ActivityCode", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_ApplicationUser_ClientId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_PerformerProfile_PerformerId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CommandForm_Activity_ActivityCode", table: "CommandForm");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_UserActivity_Activity_DoesCode", table: "UserActivity");
|
||||
migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity");
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Color",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:Serial", true),
|
||||
Blue = table.Column<byte>(nullable: false),
|
||||
Green = table.Column<byte>(nullable: false),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Red = table.Column<byte>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Color", x => x.Id);
|
||||
});
|
||||
migrationBuilder.CreateTable(
|
||||
name: "HairTaint",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:Serial", true),
|
||||
Brand = table.Column<string>(nullable: true),
|
||||
ColorId = table.Column<long>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_HairTaint", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_HairTaint_Color_ColorId",
|
||||
column: x => x.ColorId,
|
||||
principalTable: "Color",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserClaims",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserLogins",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BlackListed_ApplicationUser_OwnerId",
|
||||
table: "BlackListed",
|
||||
column: "OwnerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleAuthorizationToBlogPost_Blog_BlogPostId",
|
||||
table: "CircleAuthorizationToBlogPost",
|
||||
column: "BlogPostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId",
|
||||
table: "CircleAuthorizationToBlogPost",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccountBalance_ApplicationUser_UserId",
|
||||
table: "AccountBalance",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BalanceImpact_AccountBalance_BalanceId",
|
||||
table: "BalanceImpact",
|
||||
column: "BalanceId",
|
||||
principalTable: "AccountBalance",
|
||||
principalColumn: "UserId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommandLine_Estimate_EstimateId",
|
||||
table: "CommandLine",
|
||||
column: "EstimateId",
|
||||
principalTable: "Estimate",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Estimate_ApplicationUser_ClientId",
|
||||
table: "Estimate",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Estimate_PerformerProfile_OwnerId",
|
||||
table: "Estimate",
|
||||
column: "OwnerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Instrumentation_Instrument_InstrumentId",
|
||||
table: "Instrumentation",
|
||||
column: "InstrumentId",
|
||||
principalTable: "Instrument",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_Circle_CircleId",
|
||||
table: "CircleMember",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_ApplicationUser_MemberId",
|
||||
table: "CircleMember",
|
||||
column: "MemberId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PostTag_Blog_PostId",
|
||||
table: "PostTag",
|
||||
column: "PostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_Activity_ActivityCode",
|
||||
table: "BookQuery",
|
||||
column: "ActivityCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_ApplicationUser_ClientId",
|
||||
table: "BookQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_PerformerProfile_PerformerId",
|
||||
table: "BookQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_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_UserActivity_Activity_DoesCode",
|
||||
table: "UserActivity",
|
||||
column: "DoesCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserActivity_PerformerProfile_UserId",
|
||||
table: "UserActivity",
|
||||
column: "UserId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BlackListed_ApplicationUser_OwnerId", table: "BlackListed");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Blog_BlogPostId", table: "CircleAuthorizationToBlogPost");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId", table: "CircleAuthorizationToBlogPost");
|
||||
migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Estimate_ApplicationUser_ClientId", table: "Estimate");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Estimate_PerformerProfile_OwnerId", table: "Estimate");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_Activity_ActivityCode", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_ApplicationUser_ClientId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_PerformerProfile_PerformerId", table: "BookQuery");
|
||||
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_UserActivity_Activity_DoesCode", table: "UserActivity");
|
||||
migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity");
|
||||
migrationBuilder.DropTable("HairTaint");
|
||||
migrationBuilder.DropTable("Color");
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserClaims",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserLogins",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BlackListed_ApplicationUser_OwnerId",
|
||||
table: "BlackListed",
|
||||
column: "OwnerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleAuthorizationToBlogPost_Blog_BlogPostId",
|
||||
table: "CircleAuthorizationToBlogPost",
|
||||
column: "BlogPostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId",
|
||||
table: "CircleAuthorizationToBlogPost",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccountBalance_ApplicationUser_UserId",
|
||||
table: "AccountBalance",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BalanceImpact_AccountBalance_BalanceId",
|
||||
table: "BalanceImpact",
|
||||
column: "BalanceId",
|
||||
principalTable: "AccountBalance",
|
||||
principalColumn: "UserId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommandLine_Estimate_EstimateId",
|
||||
table: "CommandLine",
|
||||
column: "EstimateId",
|
||||
principalTable: "Estimate",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Estimate_ApplicationUser_ClientId",
|
||||
table: "Estimate",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Estimate_PerformerProfile_OwnerId",
|
||||
table: "Estimate",
|
||||
column: "OwnerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_Activity_ActivityCode",
|
||||
table: "BookQuery",
|
||||
column: "ActivityCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_ApplicationUser_ClientId",
|
||||
table: "BookQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_PerformerProfile_PerformerId",
|
||||
table: "BookQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Instrumentation_Instrument_InstrumentId",
|
||||
table: "Instrumentation",
|
||||
column: "InstrumentId",
|
||||
principalTable: "Instrument",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_Circle_CircleId",
|
||||
table: "CircleMember",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_ApplicationUser_MemberId",
|
||||
table: "CircleMember",
|
||||
column: "MemberId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PostTag_Blog_PostId",
|
||||
table: "PostTag",
|
||||
column: "PostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommandForm_Activity_ActivityCode",
|
||||
table: "CommandForm",
|
||||
column: "ActivityCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_Location_OrganizationAddressId",
|
||||
table: "PerformerProfile",
|
||||
column: "OrganizationAddressId",
|
||||
principalTable: "Location",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_ApplicationUser_PerformerId",
|
||||
table: "PerformerProfile",
|
||||
column: "PerformerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserActivity_Activity_DoesCode",
|
||||
table: "UserActivity",
|
||||
column: "DoesCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserActivity_PerformerProfile_UserId",
|
||||
table: "UserActivity",
|
||||
column: "UserId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.Data.Entity.Infrastructure;
|
||||
using Microsoft.Data.Entity.Metadata;
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
using Yavsc.Models;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
@ -403,43 +405,6 @@ namespace Yavsc.Migrations
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ActivityCode")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("DateCreated");
|
||||
|
||||
b.Property<DateTime>("DateModified");
|
||||
|
||||
b.Property<DateTime>("EventDate");
|
||||
|
||||
b.Property<long?>("LocationId");
|
||||
|
||||
b.Property<long?>("LocationTypeId");
|
||||
|
||||
b.Property<string>("PerformerId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<decimal?>("Previsional");
|
||||
|
||||
b.Property<string>("Reason");
|
||||
|
||||
b.Property<string>("UserCreated");
|
||||
|
||||
b.Property<string>("UserModified");
|
||||
|
||||
b.Property<DateTime?>("ValidationDate");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.Instrument", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
@ -488,13 +453,6 @@ namespace Yavsc.Migrations
|
||||
b.HasKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.Profiles.FormationSettings", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.HasKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.Profiles.GeneralSettings", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
@ -524,6 +482,22 @@ namespace Yavsc.Migrations
|
||||
b.HasKey("ConnectionId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Drawing.Color", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<byte>("Blue");
|
||||
|
||||
b.Property<byte>("Green");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<byte>("Red");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Forms.Form", b =>
|
||||
{
|
||||
b.Property<string>("Id");
|
||||
@ -533,6 +507,19 @@ namespace Yavsc.Migrations
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Brand");
|
||||
|
||||
b.Property<long?>("ColorId")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b =>
|
||||
{
|
||||
b.Property<string>("DeviceId");
|
||||
@ -753,6 +740,43 @@ namespace Yavsc.Migrations
|
||||
b.HasKey("Code");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.BookQuery", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ActivityCode")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("DateCreated");
|
||||
|
||||
b.Property<DateTime>("DateModified");
|
||||
|
||||
b.Property<DateTime>("EventDate");
|
||||
|
||||
b.Property<long?>("LocationId");
|
||||
|
||||
b.Property<long?>("LocationTypeId");
|
||||
|
||||
b.Property<string>("PerformerId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<decimal?>("Previsional");
|
||||
|
||||
b.Property<string>("Reason");
|
||||
|
||||
b.Property<string>("UserCreated");
|
||||
|
||||
b.Property<string>("UserModified");
|
||||
|
||||
b.Property<DateTime?>("ValidationDate");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.CommandForm", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
@ -811,6 +835,13 @@ namespace Yavsc.Migrations
|
||||
b.HasKey("PerformerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.Profiles.FormationSettings", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.HasKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b =>
|
||||
{
|
||||
b.Property<string>("DoesCode");
|
||||
@ -935,7 +966,7 @@ namespace Yavsc.Migrations
|
||||
.WithMany()
|
||||
.HasForeignKey("ClientId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Booking.BookQuery")
|
||||
b.HasOne("Yavsc.Models.Workflow.BookQuery")
|
||||
.WithMany()
|
||||
.HasForeignKey("CommandId");
|
||||
|
||||
@ -951,29 +982,6 @@ namespace Yavsc.Migrations
|
||||
.HasForeignKey("AuthorId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Workflow.Activity")
|
||||
.WithMany()
|
||||
.HasForeignKey("ActivityCode");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClientId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Relationship.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Relationship.LocationType")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationTypeId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Workflow.PerformerProfile")
|
||||
.WithMany()
|
||||
.HasForeignKey("PerformerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.MusicalPreference", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Booking.Profiles.DjSettings")
|
||||
@ -1003,6 +1011,13 @@ namespace Yavsc.Migrations
|
||||
.HasForeignKey("ApplicationUserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Drawing.Color")
|
||||
.WithMany()
|
||||
.HasForeignKey("ColorId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
@ -1063,6 +1078,29 @@ namespace Yavsc.Migrations
|
||||
.HasForeignKey("ParentCode");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.BookQuery", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Workflow.Activity")
|
||||
.WithMany()
|
||||
.HasForeignKey("ActivityCode");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClientId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Relationship.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Relationship.LocationType")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationTypeId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Workflow.PerformerProfile")
|
||||
.WithMany()
|
||||
.HasForeignKey("PerformerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.CommandForm", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Workflow.Activity")
|
||||
@ -1072,7 +1110,7 @@ namespace Yavsc.Migrations
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.CoWorking", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Booking.Profiles.FormationSettings")
|
||||
b.HasOne("Yavsc.Models.Workflow.Profiles.FormationSettings")
|
||||
.WithMany()
|
||||
.HasForeignKey("FormationSettingsUserId");
|
||||
|
||||
|
@ -7,6 +7,8 @@ using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using Microsoft.Data.Entity;
|
||||
using System.Web;
|
||||
using System.Threading;
|
||||
using Yavsc.Models.Haircut;
|
||||
using Yavsc.Models.Drawing;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
@ -24,8 +26,8 @@ namespace Yavsc.Models
|
||||
using Messaging;
|
||||
using Access;
|
||||
using Booking.Profiles;
|
||||
using Yavsc.Models.Workflow.Profiles;
|
||||
|
||||
using Workflow.Profiles;
|
||||
using Drawing;
|
||||
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
||||
{
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
@ -263,6 +265,10 @@ namespace Yavsc.Models
|
||||
public DbSet<Form> Form { get; set; }
|
||||
|
||||
public DbSet<Ban> Banlist { get ; set; }
|
||||
|
||||
public DbSet<HairTaint> HairTaint { get; set; }
|
||||
|
||||
public DbSet<Color> Color { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
25
Yavsc/Models/Drawing/Color.cs
Normal file
25
Yavsc/Models/Drawing/Color.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Drawing
|
||||
{
|
||||
public class Color
|
||||
{
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
public Color(){
|
||||
|
||||
}
|
||||
public Color(Color c)
|
||||
{
|
||||
Red=c.Red;
|
||||
Green=c.Green;
|
||||
Blue=c.Blue;
|
||||
Name=c.Name;
|
||||
}
|
||||
public byte Red {get;set;}
|
||||
public byte Green {get;set;}
|
||||
public byte Blue {get;set;}
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace Yavsc.Models.haircut
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
public enum HairCutGenders : int
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Yavsc.Models.haircut
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
public enum HairDressings {
|
||||
Brushing,
|
@ -1,4 +1,4 @@
|
||||
namespace Yavsc.Models.haircut
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
public enum HairLength : int
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.haircut
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
public class HairPrestation
|
||||
{
|
@ -1,16 +1,18 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Yavsc.Models.haircut
|
||||
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
using Drawing;
|
||||
public class HairTaint
|
||||
{
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set;}
|
||||
|
||||
public long Name { get; set; }
|
||||
public string Brand { get; set; }
|
||||
|
||||
[Required]
|
||||
public Color Color {get; set;}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace Yavsc.Models.haircut
|
||||
namespace Yavsc.Models.Haircut
|
||||
{
|
||||
|
||||
public enum HairTechnos
|
41
Yavsc/Views/Colors/Create.cshtml
Normal file
41
Yavsc/Views/Colors/Create.cshtml
Normal file
@ -0,0 +1,41 @@
|
||||
@model Color
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
<h2>Create</h2>
|
||||
|
||||
<form asp-action="Create">
|
||||
<div class="form-horizontal">
|
||||
<h4>Color</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Name" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="Name" class="form-control" />
|
||||
<span asp-validation-for="Name" class="text-danger" >
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">
|
||||
Indication de couleur
|
||||
</label>
|
||||
<div class="col-md-10">
|
||||
@await Html.PartialAsync("ColorEditor",Model)
|
||||
</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>
|
28
Yavsc/Views/Colors/Delete.cshtml
Normal file
28
Yavsc/Views/Colors/Delete.cshtml
Normal file
@ -0,0 +1,28 @@
|
||||
@model Yavsc.Models.Drawing.Color
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h2>Delete</h2>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>Color</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Name)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Name)
|
||||
</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>
|
26
Yavsc/Views/Colors/Details.cshtml
Normal file
26
Yavsc/Views/Colors/Details.cshtml
Normal file
@ -0,0 +1,26 @@
|
||||
@model Yavsc.Models.Drawing.Color
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h2>Details</h2>
|
||||
|
||||
<div>
|
||||
<h4>Color</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Name)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Color)
|
||||
@Html.DisplayFor(model => model.Name)
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<p>
|
||||
@Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</p>
|
35
Yavsc/Views/Colors/Edit.cshtml
Normal file
35
Yavsc/Views/Colors/Edit.cshtml
Normal file
@ -0,0 +1,35 @@
|
||||
@model Yavsc.Models.Drawing.Color
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h2>Edit</h2>
|
||||
|
||||
<form asp-action="Edit">
|
||||
<div class="form-horizontal">
|
||||
<h4>Color</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="Red" />
|
||||
<input type="hidden" asp-for="Green" />
|
||||
<input type="hidden" asp-for="Blue" />
|
||||
<div class="form-group">
|
||||
<label asp-for="Name" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="Name" class="form-control" />
|
||||
<span asp-validation-for="Name" 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>
|
||||
|
33
Yavsc/Views/Colors/Index.cshtml
Normal file
33
Yavsc/Views/Colors/Index.cshtml
Normal file
@ -0,0 +1,33 @@
|
||||
@model IEnumerable<Color>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h2>Index</h2>
|
||||
|
||||
<p>
|
||||
<a asp-action="Create">Create New</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>
|
||||
@SR["Les couleurs"]
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(l => item)
|
||||
@Html.DisplayFor(l => item.Name)
|
||||
</td>
|
||||
<td>
|
||||
@Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
|
||||
@Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
|
||||
@Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
32
Yavsc/Views/HairTaints/Create.cshtml
Normal file
32
Yavsc/Views/HairTaints/Create.cshtml
Normal file
@ -0,0 +1,32 @@
|
||||
@model Yavsc.Models.Haircut.HairTaint
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h2>Create</h2>
|
||||
|
||||
<form asp-action="Create">
|
||||
<div class="form-horizontal">
|
||||
<h4>HairTaint</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Brand" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="Brand" class="form-control" />
|
||||
<span asp-validation-for="Brand" 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>
|
||||
|
28
Yavsc/Views/HairTaints/Delete.cshtml
Normal file
28
Yavsc/Views/HairTaints/Delete.cshtml
Normal file
@ -0,0 +1,28 @@
|
||||
@model Yavsc.Models.Haircut.HairTaint
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h2>Delete</h2>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>HairTaint</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Brand)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Brand)
|
||||
</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>
|
24
Yavsc/Views/HairTaints/Details.cshtml
Normal file
24
Yavsc/Views/HairTaints/Details.cshtml
Normal file
@ -0,0 +1,24 @@
|
||||
@model Yavsc.Models.Haircut.HairTaint
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h2>Details</h2>
|
||||
|
||||
<div>
|
||||
<h4>HairTaint</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Brand)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Brand)
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<p>
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</p>
|
33
Yavsc/Views/HairTaints/Edit.cshtml
Normal file
33
Yavsc/Views/HairTaints/Edit.cshtml
Normal file
@ -0,0 +1,33 @@
|
||||
@model Yavsc.Models.Haircut.HairTaint
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h2>Edit</h2>
|
||||
|
||||
<form asp-action="Edit">
|
||||
<div class="form-horizontal">
|
||||
<h4>HairTaint</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="Brand" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="Brand" class="form-control" />
|
||||
<span asp-validation-for="Brand" 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>
|
||||
|
32
Yavsc/Views/HairTaints/Index.cshtml
Normal file
32
Yavsc/Views/HairTaints/Index.cshtml
Normal file
@ -0,0 +1,32 @@
|
||||
@model IEnumerable<Yavsc.Models.Haircut.HairTaint>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h2>Index</h2>
|
||||
|
||||
<p>
|
||||
<a asp-action="Create">Create New</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Brand)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Brand)
|
||||
</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>
|
48
Yavsc/Views/Shared/ColorEditor.cshtml
Normal file
48
Yavsc/Views/Shared/ColorEditor.cshtml
Normal file
@ -0,0 +1,48 @@
|
||||
@model Color
|
||||
<div>
|
||||
|
||||
<div id="clrprv" style="border:solid grey 1px; width:1em; height:1em; display: inline-block; height:3em; width:5em;"></div>
|
||||
|
||||
<div style="display: inline-block; width:15em; margin:.3em;">
|
||||
<div id="sred" class="slider" style="background-color:red;"></div>
|
||||
<div id="sgreen" class="slider" style="background-color:green;"></div>
|
||||
<div id="sblue" class="slider" style="background-color:blue;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="Red" name="Red" />
|
||||
<input type="hidden" id="Green" name="Green" />
|
||||
<input type="hidden" id="Blue" name="Blue" />
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
var red = @Model.Red;
|
||||
var green = @Model.Green;
|
||||
var blue = @Model.Blue;
|
||||
|
||||
$(".slider").slider(
|
||||
{
|
||||
min: 0,
|
||||
max: 255,
|
||||
animate: "fast"
|
||||
});
|
||||
var updateColor = function() {
|
||||
$("#clrprv").css("background-color","rgb("+red+","+green+","+blue+")");
|
||||
$("#Red").val(red);
|
||||
$("#Green").val(green);
|
||||
$("#Blue").val(blue);
|
||||
console.log($("#Blue").val());
|
||||
};
|
||||
$("#sred").on("slide",function(event, ui){
|
||||
red=ui.value;
|
||||
updateColor();
|
||||
});
|
||||
$("#sgreen").on("slide",function(event, ui){
|
||||
green=ui.value;
|
||||
updateColor();
|
||||
});
|
||||
$("#sblue").on("slide",function(event, ui){
|
||||
blue=ui.value;
|
||||
updateColor();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
2
Yavsc/Views/Shared/DisplayTemplates/Color.cshtml
Normal file
2
Yavsc/Views/Shared/DisplayTemplates/Color.cshtml
Normal file
@ -0,0 +1,2 @@
|
||||
@model Color
|
||||
<div style="background-color:@Model.Color(); border:solid grey 1px; width:1em; height:1em; display: inline-block;"></div>
|
@ -8,13 +8,14 @@
|
||||
<environment names="Development">
|
||||
<link rel="stylesheet" href="~/css/bootstrap.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" />
|
||||
<link rel="stylesheet" href="~/css/jquery-ui.css" />
|
||||
</environment>
|
||||
<environment names="Staging,Production,yavsc,yavscpre,zicmoove,lua">
|
||||
<link rel="stylesheet" href="~/css/bootstrap.min.css" asp-append-version="true"/>
|
||||
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
|
||||
</environment>
|
||||
<environment names="Development">
|
||||
<script src="~/js/jquery.js"></script>
|
||||
<script src="~/js/jquery-ui.js"></script>
|
||||
<script src="~/js/bootstrap.js"></script>
|
||||
<script src="~/js/site.js"></script>
|
||||
<script src="~/js/jquery.signalR-2.2.1.js"></script>
|
||||
@ -29,6 +30,7 @@
|
||||
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal">
|
||||
</script>
|
||||
<script src="~/js/site.js"></script>
|
||||
<script src="~/js/jquery-ui.js"></script>
|
||||
<script src="~/js/jquery.signalR-2.2.1.js"></script>
|
||||
</environment>
|
||||
@RenderSection("header", required: false)
|
||||
|
@ -18,6 +18,7 @@
|
||||
@using Yavsc.Models.Billing;
|
||||
@using Yavsc.Models.Workflow;
|
||||
@using Yavsc.Models.Relationship
|
||||
@using Yavsc.Models.Drawing;
|
||||
|
||||
@using Yavsc.ViewModels.Account;
|
||||
@using Yavsc.ViewModels.Manage;
|
||||
@ -25,7 +26,6 @@
|
||||
@using Yavsc.ViewModels.Auth;
|
||||
@using Yavsc.ViewModels.Administration;
|
||||
@using Yavsc.ViewModels.Relationship;
|
||||
|
||||
|
||||
@inject IViewLocalizer LocString
|
||||
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
|
||||
|
1311
Yavsc/wwwroot/css/jquery-ui.css
vendored
Normal file
1311
Yavsc/wwwroot/css/jquery-ui.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
15791
Yavsc/wwwroot/js/jquery-ui.js
vendored
15791
Yavsc/wwwroot/js/jquery-ui.js
vendored
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user