diff --git a/Yavsc/ApiControllers/BookQueryApiController.cs b/Yavsc/ApiControllers/BookQueryApiController.cs index efb52b01..9a8d9367 100644 --- a/Yavsc/ApiControllers/BookQueryApiController.cs +++ b/Yavsc/ApiControllers/BookQueryApiController.cs @@ -12,7 +12,7 @@ namespace Yavsc.Controllers using System; using Yavsc.Models.Messaging; using Yavsc.Models; - using Yavsc.Models.Booking; + using Yavsc.Models.Workflow; [Produces("application/json")] [Route("api/bookquery"), Authorize(Roles = "Performer,Administrator")] diff --git a/Yavsc/ApiControllers/DjProfileApiController.cs b/Yavsc/ApiControllers/DjProfileApiController.cs index 92b95e78..28559844 100644 --- a/Yavsc/ApiControllers/DjProfileApiController.cs +++ b/Yavsc/ApiControllers/DjProfileApiController.cs @@ -1,7 +1,7 @@ namespace Yavsc.ApiControllers { using Models; - using Models.Booking.Profiles; + using Models.Musical.Profiles; public class DjProfileApiController : ProfileApiController { diff --git a/Yavsc/ApiControllers/MusicalPreferencesApiController.cs b/Yavsc/ApiControllers/MusicalPreferencesApiController.cs index 60c3a5b3..35bf5f08 100644 --- a/Yavsc/ApiControllers/MusicalPreferencesApiController.cs +++ b/Yavsc/ApiControllers/MusicalPreferencesApiController.cs @@ -4,7 +4,7 @@ using Microsoft.AspNet.Http; using Microsoft.AspNet.Mvc; using Microsoft.Data.Entity; using Yavsc.Models; -using Yavsc.Models.Booking; +using Yavsc.Models.Musical; namespace Yavsc.Controllers { diff --git a/Yavsc/ApiControllers/MusicalTendenciesApiController.cs b/Yavsc/ApiControllers/MusicalTendenciesApiController.cs index 701c8490..9dcb81d1 100644 --- a/Yavsc/ApiControllers/MusicalTendenciesApiController.cs +++ b/Yavsc/ApiControllers/MusicalTendenciesApiController.cs @@ -4,7 +4,7 @@ using Microsoft.AspNet.Http; using Microsoft.AspNet.Mvc; using Microsoft.Data.Entity; using Yavsc.Models; -using Yavsc.Models.Booking; +using Yavsc.Models.Musical; namespace Yavsc.Controllers { diff --git a/Yavsc/Controllers/BlogspotController.cs b/Yavsc/Controllers/BlogspotController.cs index b25504f0..be942c25 100644 --- a/Yavsc/Controllers/BlogspotController.cs +++ b/Yavsc/Controllers/BlogspotController.cs @@ -42,7 +42,6 @@ namespace Yavsc.Controllers [AllowAnonymous] public IActionResult Index(string id, int skip=0, int maxLen=25) { - if (!string.IsNullOrEmpty(id)) return UserPosts(id); string uid = User.GetUserId(); @@ -52,7 +51,7 @@ namespace Yavsc.Controllers if (usercircles != null) { posts = _context.Blogspot.Include( b => b.Author - ).Include(p=>p.ACL).Where(p=>p.Visible && (p.ACL.Count == 0 || p.ACL.Any(a=> usercircles.Contains(a.CircleId)))); + ).Include(p=>p.ACL).Where(p=> p.AuthorId == uid || p.Visible && (p.ACL.Count == 0 || p.ACL.Any(a=> usercircles.Contains(a.CircleId)))); /* posts = _context.Blogspot.Include( b => b.Author ).Include(p=>p.ACL).Where(p=>p.Visible || p.ACL.Any(a => usercircles.Contains(a.Allowed) @@ -61,7 +60,7 @@ namespace Yavsc.Controllers else { posts = _context.Blogspot.Include( b => b.Author - ).Include(p=>p.ACL).Where(p=>p.Visible && p.ACL.Count == 0); + ).Include(p=>p.ACL).Where(p=>p.AuthorId == uid || p.Visible && p.ACL.Count == 0); } return View(posts @@ -106,7 +105,7 @@ namespace Yavsc.Controllers Blog blog = _context.Blogspot.Include( b => b.Author - ).Single(m => m.Id == id); + ).Include(p => p.ACL).Single(m => m.Id == id); if (blog == null) { return HttpNotFound(); diff --git a/Yavsc/Controllers/ColorsController.cs b/Yavsc/Controllers/ColorsController.cs new file mode 100644 index 00000000..a01b1a10 --- /dev/null +++ b/Yavsc/Controllers/ColorsController.cs @@ -0,0 +1,120 @@ +using System.Threading.Tasks; +using Microsoft.AspNet.Mvc; +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 Index() + { + return View(await _context.Color.ToListAsync()); + } + + // GET: Colors/Details/5 + public async Task Details(long? id) + { + if (id == null) + { + return HttpNotFound(); + } + + Color color = await _context.Color.SingleAsync(m => m.Id == 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 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 Edit(long? id) + { + if (id == null) + { + return HttpNotFound(); + } + + Color color = await _context.Color.SingleAsync(m => m.Id == id); + if (color == null) + { + return HttpNotFound(); + } + return View(color); + } + + // POST: Colors/Edit/5 + [HttpPost] + [ValidateAntiForgeryToken] + public async Task 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 Delete(long? id) + { + if (id == null) + { + return HttpNotFound(); + } + + Color color = await _context.Color.SingleAsync(m => m.Id == id); + if (color == null) + { + return HttpNotFound(); + } + + return View(color); + } + + // POST: Colors/Delete/5 + [HttpPost, ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(long id) + { + Color color = await _context.Color.SingleAsync(m => m.Id == id); + _context.Color.Remove(color); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + } +} diff --git a/Yavsc/Controllers/CommandController.cs b/Yavsc/Controllers/CommandController.cs index 3a4bfbd5..a13069ef 100644 --- a/Yavsc/Controllers/CommandController.cs +++ b/Yavsc/Controllers/CommandController.cs @@ -9,15 +9,15 @@ using Microsoft.Data.Entity; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; using Microsoft.Extensions.OptionsModel; -using Yavsc.Helpers; -using Yavsc.Models; -using Yavsc.Models.Booking; -using Yavsc.Models.Google.Messaging; -using Yavsc.Services; namespace Yavsc.Controllers { + using Helpers; + using Models; + using Models.Google.Messaging; using Models.Relationship; + using Models.Workflow; + using Services; [ServiceFilter(typeof(LanguageActionFilter))] public class CommandController : Controller @@ -185,7 +185,7 @@ namespace Yavsc.Controllers await _emailSender.SendEmailAsync( _siteSettings, _smtpSettings, command.PerformerProfile.Performer.Email, - yaev.Topic+" "+yaev.Client.UserName, + yaev.Topic+" "+yaev.Sender, $"{yaev.Message}\r\n-- \r\n{yaev.Previsional}\r\n{yaev.EventDate}\r\n" ); } diff --git a/Yavsc/Controllers/CommandFormsController.cs b/Yavsc/Controllers/CommandFormsController.cs index f9373536..9c3c9720 100644 --- a/Yavsc/Controllers/CommandFormsController.cs +++ b/Yavsc/Controllers/CommandFormsController.cs @@ -49,7 +49,7 @@ namespace Yavsc.Controllers } private void SetViewBag(CommandForm commandForm=null) { ViewBag.ActivityCode = new SelectList(_context.Activities, "Code", "Name", commandForm?.ActivityCode); - ViewBag.Action = YavscLib.YavscConstants.Forms.Select( c => new SelectListItem { Text = c, Selected = commandForm?.Action == c } ); + ViewBag.Action = Startup.Forms.Select( c => new SelectListItem { Text = c, Selected = commandForm?.Action == c } ); } // POST: CommandForms/Create [HttpPost] diff --git a/Yavsc/Controllers/EstimateController.cs b/Yavsc/Controllers/EstimateController.cs index 0a45422a..694f7420 100644 --- a/Yavsc/Controllers/EstimateController.cs +++ b/Yavsc/Controllers/EstimateController.cs @@ -9,14 +9,14 @@ using Microsoft.AspNet.Http; using Microsoft.AspNet.Mvc; using Microsoft.Data.Entity; using Microsoft.Extensions.OptionsModel; -using Yavsc.Helpers; -using Yavsc.Models; -using Yavsc.Models.Billing; -using Yavsc.Models.Booking; -using Yavsc.ViewModels; namespace Yavsc.Controllers { + using Helpers; + using Models; + using Models.Billing; + using Models.Workflow; + using ViewModels; [Authorize] public class EstimateController : Controller { diff --git a/Yavsc/Controllers/FrontOfficeController.cs b/Yavsc/Controllers/FrontOfficeController.cs index af9976f8..282d64bb 100644 --- a/Yavsc/Controllers/FrontOfficeController.cs +++ b/Yavsc/Controllers/FrontOfficeController.cs @@ -11,7 +11,7 @@ namespace Yavsc.Controllers { using Helpers; using Models; - using Models.Booking; + using Models.Workflow; using ViewModels.FrontOffice; public class FrontOfficeController : Controller { @@ -46,8 +46,8 @@ namespace Yavsc.Controllers return View(model); } - [Route("Book/{id?}"), HttpGet, AllowAnonymous] - public ActionResult Book(string id) + [Route("Profiles/{id?}"), HttpGet, AllowAnonymous] + public ActionResult Profiles(string id) { if (id == null) { @@ -58,8 +58,8 @@ namespace Yavsc.Controllers return View(result); } - [Route("Book/{id}"), HttpPost, AllowAnonymous] - public ActionResult Book(BookQuery bookQuery) + [Route("Profiles/{id}"), HttpPost, AllowAnonymous] + public ActionResult Profiles(BookQuery bookQuery) { if (ModelState.IsValid) { @@ -85,7 +85,7 @@ namespace Yavsc.Controllers return View("Index"); } ViewBag.Activities = _context.ActivityItems(null); - return View("Book", _context.Performers.Include(p => p.Performer).Where + return View("Profiles", _context.Performers.Include(p => p.Performer).Where (p => p.Active).OrderBy( x => x.MinDailyCost )); diff --git a/Yavsc/Controllers/HairTaintsController.cs b/Yavsc/Controllers/HairTaintsController.cs new file mode 100644 index 00000000..49bf9502 --- /dev/null +++ b/Yavsc/Controllers/HairTaintsController.cs @@ -0,0 +1,128 @@ +using System.Threading.Tasks; +using Microsoft.AspNet.Authorization; +using Microsoft.AspNet.Mvc; +using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.Data.Entity; +using Yavsc.Models; +using Yavsc.Models.Haircut; + +namespace Yavsc.Controllers +{ + [Authorize("AdministratorOnly")] + public class HairTaintsController : Controller + { + private ApplicationDbContext _context; + + public HairTaintsController(ApplicationDbContext context) + { + _context = context; + } + + // GET: HairTaints + public async Task Index() + { + var applicationDbContext = _context.HairTaint.Include(h => h.Color); + return View(await applicationDbContext.ToListAsync()); + } + + // GET: HairTaints/Details/5 + public async Task 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() + { + ViewBag.ColorId = new SelectList(_context.Color, "Id", "Name"); + return View(); + } + + // POST: HairTaints/Create + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Create(HairTaint hairTaint) + { + if (ModelState.IsValid) + { + _context.HairTaint.Add(hairTaint); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + ViewBag.ColorId = new SelectList(_context.Color, "Id", "Name", hairTaint.ColorId); + return View(hairTaint); + } + + // GET: HairTaints/Edit/5 + public async Task Edit(long? id) + { + if (id == null) + { + return HttpNotFound(); + } + + HairTaint hairTaint = await _context.HairTaint.SingleAsync(m => m.Id == id); + if (hairTaint == null) + { + return HttpNotFound(); + } + ViewBag.ColorId = new SelectList(_context.Color, "Id", "Name",hairTaint.ColorId); + return View(hairTaint); + } + + // POST: HairTaints/Edit/5 + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Edit(HairTaint hairTaint) + { + if (ModelState.IsValid) + { + _context.Update(hairTaint); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + ViewBag.ColorId = new SelectList(_context.Color, "Id", "Name", hairTaint.ColorId); + return View(hairTaint); + } + + // GET: HairTaints/Delete/5 + [ActionName("Delete")] + public async Task 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 DeleteConfirmed(long id) + { + HairTaint hairTaint = await _context.HairTaint.SingleAsync(m => m.Id == id); + _context.HairTaint.Remove(hairTaint); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + } +} diff --git a/Yavsc/Controllers/InstrumentationController.cs b/Yavsc/Controllers/InstrumentationController.cs index c7f2ccd1..e9e7a2c5 100644 --- a/Yavsc/Controllers/InstrumentationController.cs +++ b/Yavsc/Controllers/InstrumentationController.cs @@ -6,7 +6,7 @@ using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc.Rendering; using Microsoft.Data.Entity; using Yavsc.Models; -using Yavsc.Models.Booking.Profiles; +using Yavsc.Models.Musical.Profiles; namespace Yavsc.Controllers { diff --git a/Yavsc/Controllers/InstrumentsController.cs b/Yavsc/Controllers/InstrumentsController.cs index b63ce9d9..4ad6b778 100644 --- a/Yavsc/Controllers/InstrumentsController.cs +++ b/Yavsc/Controllers/InstrumentsController.cs @@ -4,7 +4,7 @@ using Microsoft.AspNet.Mvc; namespace Yavsc.Controllers { using Models; - using Models.Booking; + using Models.Musical; public class InstrumentsController : Controller { private ApplicationDbContext _context; diff --git a/Yavsc/Controllers/MusicalTendenciesController.cs b/Yavsc/Controllers/MusicalTendenciesController.cs index 61d7c5e4..df35e49e 100644 --- a/Yavsc/Controllers/MusicalTendenciesController.cs +++ b/Yavsc/Controllers/MusicalTendenciesController.cs @@ -4,7 +4,7 @@ using Microsoft.AspNet.Mvc; namespace Yavsc.Controllers { using Models; - using Models.Booking; + using Models.Musical; public class MusicalTendenciesController : Controller { private ApplicationDbContext _context; diff --git a/Yavsc/Helpers/EventHelpers.cs b/Yavsc/Helpers/EventHelpers.cs index d50970e6..67c180e7 100644 --- a/Yavsc/Helpers/EventHelpers.cs +++ b/Yavsc/Helpers/EventHelpers.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.Localization; -using Yavsc.Models.Booking; -using Yavsc.Models.Messaging; namespace Yavsc.Helpers { + using Models.Workflow; + using Models.Messaging; public static class EventHelpers { public static BookQueryEvent CreateEvent(this BookQuery query, diff --git a/Yavsc/Helpers/HtmlHelpers.cs b/Yavsc/Helpers/HtmlHelpers.cs new file mode 100644 index 00000000..5e6ebe4c --- /dev/null +++ b/Yavsc/Helpers/HtmlHelpers.cs @@ -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)); + } + } +} \ No newline at end of file diff --git a/Yavsc/Migrations/20170212005346_haircut.Designer.cs b/Yavsc/Migrations/20170212005346_haircut.Designer.cs new file mode 100644 index 00000000..24c996c0 --- /dev/null +++ b/Yavsc/Migrations/20170212005346_haircut.Designer.cs @@ -0,0 +1,1149 @@ +using System; +using Microsoft.Data.Entity; +using Microsoft.Data.Entity.Infrastructure; +using Microsoft.Data.Entity.Migrations; +using Yavsc.Models; + +namespace Yavsc.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20170212005346_haircut")] + partial class haircut + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "7.0.0-rc1-16348"); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRole", b => + { + b.Property("Id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Name") + .HasAnnotation("MaxLength", 256); + + b.Property("NormalizedName") + .HasAnnotation("MaxLength", 256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .HasAnnotation("Relational:Name", "RoleNameIndex"); + + b.HasAnnotation("Relational:TableName", "AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("RoleId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasAnnotation("Relational:TableName", "AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasAnnotation("Relational:TableName", "AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin", b => + { + b.Property("LoginProvider"); + + b.Property("ProviderKey"); + + b.Property("ProviderDisplayName"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasAnnotation("Relational:TableName", "AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole", b => + { + b.Property("UserId"); + + b.Property("RoleId"); + + b.HasKey("UserId", "RoleId"); + + b.HasAnnotation("Relational:TableName", "AspNetUserRoles"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.Ban", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("DateCreated"); + + b.Property("DateModified"); + + b.Property("UserCreated"); + + b.Property("UserModified"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("OwnerId") + .IsRequired(); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.CircleAuthorizationToBlogPost", b => + { + b.Property("CircleId"); + + b.Property("BlogPostId"); + + b.HasKey("CircleId", "BlogPostId"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.Property("UserId"); + + b.Property("ContactCredits"); + + b.Property("Credits"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.Property("Id"); + + b.Property("AccessFailedCount"); + + b.Property("Avatar") + .IsRequired() + .HasAnnotation("MaxLength", 512) + .HasAnnotation("Relational:DefaultValue", "/images/Users/icon_user.png") + .HasAnnotation("Relational:DefaultValueType", "System.String"); + + b.Property("BankInfoId"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("DedicatedGoogleCalendar"); + + b.Property("DiskQuota") + .HasAnnotation("Relational:DefaultValue", "524288000") + .HasAnnotation("Relational:DefaultValueType", "System.Int64"); + + b.Property("DiskUsage"); + + b.Property("Email") + .HasAnnotation("MaxLength", 256); + + b.Property("EmailConfirmed"); + + b.Property("FullName") + .HasAnnotation("MaxLength", 512); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("NormalizedEmail") + .HasAnnotation("MaxLength", 256); + + b.Property("NormalizedUserName") + .HasAnnotation("MaxLength", 256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("PostalAddressId"); + + b.Property("SecurityStamp"); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasAnnotation("MaxLength", 256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasAnnotation("Relational:Name", "EmailIndex"); + + b.HasIndex("NormalizedUserName") + .HasAnnotation("Relational:Name", "UserNameIndex"); + + b.HasAnnotation("Relational:TableName", "AspNetUsers"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.Client", b => + { + b.Property("Id"); + + b.Property("Active"); + + b.Property("DisplayName"); + + b.Property("LogoutRedirectUri") + .HasAnnotation("MaxLength", 100); + + b.Property("RedirectUri"); + + b.Property("RefreshTokenLifeTime"); + + b.Property("Secret"); + + b.Property("Type"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.RefreshToken", b => + { + b.Property("Id"); + + b.Property("ClientId") + .IsRequired() + .HasAnnotation("MaxLength", 50); + + b.Property("ExpiresUtc"); + + b.Property("IssuedUtc"); + + b.Property("ProtectedTicket") + .IsRequired(); + + b.Property("Subject") + .IsRequired() + .HasAnnotation("MaxLength", 50); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BalanceId") + .IsRequired(); + + b.Property("ExecDate"); + + b.Property("Impact"); + + b.Property("Reason") + .IsRequired(); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Bank.BankIdentity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccountNumber") + .HasAnnotation("MaxLength", 15); + + b.Property("BIC") + .HasAnnotation("MaxLength", 15); + + b.Property("BankCode") + .HasAnnotation("MaxLength", 5); + + b.Property("BankedKey"); + + b.Property("IBAN") + .HasAnnotation("MaxLength", 33); + + b.Property("WicketCode") + .HasAnnotation("MaxLength", 5); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ArticleId"); + + b.Property("Count"); + + b.Property("Description") + .IsRequired() + .HasAnnotation("MaxLength", 512); + + b.Property("EstimateId"); + + b.Property("EstimateTemplateId"); + + b.Property("UnitaryCost"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AttachedFilesString"); + + b.Property("AttachedGraphicsString"); + + b.Property("ClientId") + .IsRequired(); + + b.Property("ClientValidationDate"); + + b.Property("CommandId"); + + b.Property("CommandType"); + + b.Property("Description"); + + b.Property("OwnerId") + .IsRequired(); + + b.Property("ProviderValidationDate"); + + b.Property("Title"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.EstimateTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Description"); + + b.Property("OwnerId") + .IsRequired(); + + b.Property("Title"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.ExceptionSIREN", b => + { + b.Property("SIREN"); + + b.HasKey("SIREN"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AuthorId"); + + b.Property("Content"); + + b.Property("DateCreated"); + + b.Property("DateModified"); + + b.Property("Photo"); + + b.Property("Rate"); + + b.Property("Title"); + + b.Property("UserCreated"); + + b.Property("UserModified"); + + b.Property("Visible"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.Instrument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name") + .IsRequired() + .HasAnnotation("MaxLength", 255); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.MusicalPreference", b => + { + b.Property("OwnerProfileId"); + + b.Property("DjSettingsUserId"); + + b.Property("GeneralSettingsUserId"); + + b.Property("Rate"); + + b.Property("TendencyId"); + + b.HasKey("OwnerProfileId"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.MusicalTendency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name") + .IsRequired() + .HasAnnotation("MaxLength", 255); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.Profiles.DjSettings", b => + { + b.Property("UserId"); + + b.Property("SoundCloudId"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.Profiles.GeneralSettings", b => + { + b.Property("UserId"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.Profiles.Instrumentation", b => + { + b.Property("InstrumentId"); + + b.Property("UserId"); + + b.HasKey("InstrumentId", "UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.Connection", b => + { + b.Property("ConnectionId"); + + b.Property("ApplicationUserId"); + + b.Property("Connected"); + + b.Property("UserAgent"); + + b.HasKey("ConnectionId"); + }); + + modelBuilder.Entity("Yavsc.Models.Drawing.Color", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Blue"); + + b.Property("Green"); + + b.Property("Name"); + + b.Property("Red"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Forms.Form", b => + { + b.Property("Id"); + + b.Property("Summary"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Brand"); + + b.Property("ColorId") + .IsRequired(); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b => + { + b.Property("DeviceId"); + + b.Property("DeclarationDate") + .ValueGeneratedOnAdd() + .HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP"); + + b.Property("DeviceOwnerId"); + + b.Property("GCMRegistrationId") + .IsRequired(); + + b.Property("Model"); + + b.Property("Platform"); + + b.Property("Version"); + + b.HasKey("DeviceId"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.BaseProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Description"); + + b.Property("Discriminator") + .IsRequired(); + + b.Property("Name"); + + b.Property("Public"); + + b.HasKey("Id"); + + b.HasAnnotation("Relational:DiscriminatorProperty", "Discriminator"); + + b.HasAnnotation("Relational:DiscriminatorValue", "BaseProduct"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ContextId"); + + b.Property("Description"); + + b.Property("Name"); + + b.Property("Public"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.ClientProviderInfo", b => + { + b.Property("UserId"); + + b.Property("Avatar"); + + b.Property("BillingAddressId"); + + b.Property("EMail"); + + b.Property("Phone"); + + b.Property("UserName"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.OAuth.OAuth2Tokens", b => + { + b.Property("UserId"); + + b.Property("AccessToken"); + + b.Property("Expiration"); + + b.Property("ExpiresIn"); + + b.Property("RefreshToken"); + + b.Property("TokenType"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ApplicationUserId"); + + b.Property("Name"); + + b.Property("OwnerId"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.CircleMember", b => + { + b.Property("MemberId"); + + b.Property("CircleId"); + + b.HasKey("MemberId", "CircleId"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Contact", b => + { + b.Property("OwnerId"); + + b.Property("UserId"); + + b.Property("ApplicationUserId"); + + b.HasKey("OwnerId", "UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Address") + .IsRequired() + .HasAnnotation("MaxLength", 512); + + b.Property("Latitude"); + + b.Property("Longitude"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.LocationType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.PostTag", b => + { + b.Property("PostId"); + + b.Property("TagId"); + + b.HasKey("PostId", "TagId"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name") + .IsRequired(); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Skill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.Property("Rate"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => + { + b.Property("Code") + .HasAnnotation("MaxLength", 512); + + b.Property("ActorDenomination"); + + b.Property("DateCreated"); + + b.Property("DateModified"); + + b.Property("Description"); + + b.Property("ModeratorGroupName"); + + b.Property("Name") + .IsRequired() + .HasAnnotation("MaxLength", 512); + + b.Property("ParentCode") + .HasAnnotation("MaxLength", 512); + + b.Property("Photo"); + + b.Property("Rate"); + + b.Property("SettingsClassName"); + + b.Property("UserCreated"); + + b.Property("UserModified"); + + b.HasKey("Code"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.BookQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ActivityCode") + .IsRequired(); + + b.Property("ClientId") + .IsRequired(); + + b.Property("DateCreated"); + + b.Property("DateModified"); + + b.Property("EventDate"); + + b.Property("LocationId"); + + b.Property("LocationTypeId"); + + b.Property("PerformerId") + .IsRequired(); + + b.Property("Previsional"); + + b.Property("Reason"); + + b.Property("UserCreated"); + + b.Property("UserModified"); + + b.Property("ValidationDate"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CommandForm", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Action"); + + b.Property("ActivityCode") + .IsRequired(); + + b.Property("Title"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CoWorking", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("FormationSettingsUserId"); + + b.Property("PerformerId"); + + b.Property("WorkingForId"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.Property("PerformerId"); + + b.Property("AcceptNotifications"); + + b.Property("AcceptPublicContact"); + + b.Property("Active"); + + b.Property("MaxDailyCost"); + + b.Property("MinDailyCost"); + + b.Property("OrganizationAddressId"); + + b.Property("Rate"); + + b.Property("SIREN") + .IsRequired() + .HasAnnotation("MaxLength", 14); + + b.Property("UseGeoLocalizationToReduceDistanceWithClients"); + + b.Property("WebSite"); + + b.HasKey("PerformerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Profiles.FormationSettings", b => + { + b.Property("UserId"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => + { + b.Property("DoesCode"); + + b.Property("UserId"); + + b.Property("Weight"); + + b.HasKey("DoesCode", "UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Product", b => + { + b.HasBaseType("Yavsc.Models.Market.BaseProduct"); + + b.Property("Depth"); + + b.Property("Height"); + + b.Property("Price"); + + b.Property("Weight"); + + b.Property("Width"); + + b.HasAnnotation("Relational:DiscriminatorValue", "Product"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole") + .WithMany() + .HasForeignKey("RoleId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole") + .WithMany() + .HasForeignKey("RoleId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("OwnerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.CircleAuthorizationToBlogPost", b => + { + b.HasOne("Yavsc.Models.Blog") + .WithMany() + .HasForeignKey("BlogPostId"); + + b.HasOne("Yavsc.Models.Relationship.Circle") + .WithMany() + .HasForeignKey("CircleId"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithOne() + .HasForeignKey("Yavsc.Models.AccountBalance", "UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.HasOne("Yavsc.Models.Bank.BankIdentity") + .WithMany() + .HasForeignKey("BankInfoId"); + + b.HasOne("Yavsc.Models.Relationship.Location") + .WithMany() + .HasForeignKey("PostalAddressId"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.HasOne("Yavsc.Models.AccountBalance") + .WithMany() + .HasForeignKey("BalanceId"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.HasOne("Yavsc.Models.Market.BaseProduct") + .WithMany() + .HasForeignKey("ArticleId"); + + b.HasOne("Yavsc.Models.Billing.Estimate") + .WithMany() + .HasForeignKey("EstimateId"); + + b.HasOne("Yavsc.Models.Billing.EstimateTemplate") + .WithMany() + .HasForeignKey("EstimateTemplateId"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("ClientId"); + + b.HasOne("Yavsc.Models.Workflow.BookQuery") + .WithMany() + .HasForeignKey("CommandId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile") + .WithMany() + .HasForeignKey("OwnerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("AuthorId"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.MusicalPreference", b => + { + b.HasOne("Yavsc.Models.Booking.Profiles.DjSettings") + .WithMany() + .HasForeignKey("DjSettingsUserId"); + + b.HasOne("Yavsc.Models.Booking.Profiles.GeneralSettings") + .WithMany() + .HasForeignKey("GeneralSettingsUserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.Profiles.Instrumentation", b => + { + b.HasOne("Yavsc.Models.Booking.Instrument") + .WithMany() + .HasForeignKey("InstrumentId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.Connection", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .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") + .WithMany() + .HasForeignKey("DeviceOwnerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity") + .WithMany() + .HasForeignKey("ContextId"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.ClientProviderInfo", b => + { + b.HasOne("Yavsc.Models.Relationship.Location") + .WithMany() + .HasForeignKey("BillingAddressId"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.CircleMember", b => + { + b.HasOne("Yavsc.Models.Relationship.Circle") + .WithMany() + .HasForeignKey("CircleId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("MemberId"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Contact", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.PostTag", b => + { + b.HasOne("Yavsc.Models.Blog") + .WithMany() + .HasForeignKey("PostId"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity") + .WithMany() + .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") + .WithMany() + .HasForeignKey("ActivityCode"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CoWorking", b => + { + b.HasOne("Yavsc.Models.Workflow.Profiles.FormationSettings") + .WithMany() + .HasForeignKey("FormationSettingsUserId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("WorkingForId"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.HasOne("Yavsc.Models.Relationship.Location") + .WithMany() + .HasForeignKey("OrganizationAddressId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("PerformerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity") + .WithMany() + .HasForeignKey("DoesCode"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile") + .WithMany() + .HasForeignKey("UserId"); + }); + } + } +} diff --git a/Yavsc/Migrations/20170212005346_haircut.cs b/Yavsc/Migrations/20170212005346_haircut.cs new file mode 100644 index 00000000..05585cd6 --- /dev/null +++ b/Yavsc/Migrations/20170212005346_haircut.cs @@ -0,0 +1,451 @@ +using Microsoft.Data.Entity.Migrations; + +namespace Yavsc.Migrations +{ + public partial class haircut : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim_IdentityRole_RoleId", table: "AspNetRoleClaims"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim_ApplicationUser_UserId", table: "AspNetUserClaims"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin_ApplicationUser_UserId", table: "AspNetUserLogins"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole_IdentityRole_RoleId", table: "AspNetUserRoles"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole_ApplicationUser_UserId", table: "AspNetUserRoles"); + migrationBuilder.DropForeignKey(name: "FK_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(nullable: false) + .Annotation("Npgsql:Serial", true), + Blue = table.Column(nullable: false), + Green = table.Column(nullable: false), + Name = table.Column(nullable: true), + Red = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Color", x => x.Id); + }); + migrationBuilder.CreateTable( + name: "HairTaint", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:Serial", true), + Brand = table.Column(nullable: true), + ColorId = table.Column(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_IdentityRole_RoleId", + table: "AspNetRoleClaims", + column: "RoleId", + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserClaim_ApplicationUser_UserId", + table: "AspNetUserClaims", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserLogin_ApplicationUser_UserId", + table: "AspNetUserLogins", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserRole_IdentityRole_RoleId", + table: "AspNetUserRoles", + column: "RoleId", + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserRole_ApplicationUser_UserId", + table: "AspNetUserRoles", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_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_IdentityRole_RoleId", table: "AspNetRoleClaims"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim_ApplicationUser_UserId", table: "AspNetUserClaims"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin_ApplicationUser_UserId", table: "AspNetUserLogins"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole_IdentityRole_RoleId", table: "AspNetUserRoles"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole_ApplicationUser_UserId", table: "AspNetUserRoles"); + migrationBuilder.DropForeignKey(name: "FK_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_IdentityRole_RoleId", + table: "AspNetRoleClaims", + column: "RoleId", + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserClaim_ApplicationUser_UserId", + table: "AspNetUserClaims", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserLogin_ApplicationUser_UserId", + table: "AspNetUserLogins", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserRole_IdentityRole_RoleId", + table: "AspNetUserRoles", + column: "RoleId", + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserRole_ApplicationUser_UserId", + table: "AspNetUserRoles", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_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); + } + } +} diff --git a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs index 9bb95e39..ca2d84b0 100644 --- a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs @@ -403,43 +403,6 @@ namespace Yavsc.Migrations b.HasKey("Id"); }); - modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ActivityCode") - .IsRequired(); - - b.Property("ClientId") - .IsRequired(); - - b.Property("DateCreated"); - - b.Property("DateModified"); - - b.Property("EventDate"); - - b.Property("LocationId"); - - b.Property("LocationTypeId"); - - b.Property("PerformerId") - .IsRequired(); - - b.Property("Previsional"); - - b.Property("Reason"); - - b.Property("UserCreated"); - - b.Property("UserModified"); - - b.Property("ValidationDate"); - - b.HasKey("Id"); - }); - modelBuilder.Entity("Yavsc.Models.Booking.Instrument", b => { b.Property("Id") @@ -488,13 +451,6 @@ namespace Yavsc.Migrations b.HasKey("UserId"); }); - modelBuilder.Entity("Yavsc.Models.Booking.Profiles.FormationSettings", b => - { - b.Property("UserId"); - - b.HasKey("UserId"); - }); - modelBuilder.Entity("Yavsc.Models.Booking.Profiles.GeneralSettings", b => { b.Property("UserId"); @@ -524,6 +480,22 @@ namespace Yavsc.Migrations b.HasKey("ConnectionId"); }); + modelBuilder.Entity("Yavsc.Models.Drawing.Color", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Blue"); + + b.Property("Green"); + + b.Property("Name"); + + b.Property("Red"); + + b.HasKey("Id"); + }); + modelBuilder.Entity("Yavsc.Models.Forms.Form", b => { b.Property("Id"); @@ -533,6 +505,19 @@ namespace Yavsc.Migrations b.HasKey("Id"); }); + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Brand"); + + b.Property("ColorId") + .IsRequired(); + + b.HasKey("Id"); + }); + modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b => { b.Property("DeviceId"); @@ -753,6 +738,43 @@ namespace Yavsc.Migrations b.HasKey("Code"); }); + modelBuilder.Entity("Yavsc.Models.Workflow.BookQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ActivityCode") + .IsRequired(); + + b.Property("ClientId") + .IsRequired(); + + b.Property("DateCreated"); + + b.Property("DateModified"); + + b.Property("EventDate"); + + b.Property("LocationId"); + + b.Property("LocationTypeId"); + + b.Property("PerformerId") + .IsRequired(); + + b.Property("Previsional"); + + b.Property("Reason"); + + b.Property("UserCreated"); + + b.Property("UserModified"); + + b.Property("ValidationDate"); + + b.HasKey("Id"); + }); + modelBuilder.Entity("Yavsc.Models.Workflow.CommandForm", b => { b.Property("Id") @@ -811,6 +833,13 @@ namespace Yavsc.Migrations b.HasKey("PerformerId"); }); + modelBuilder.Entity("Yavsc.Models.Workflow.Profiles.FormationSettings", b => + { + b.Property("UserId"); + + b.HasKey("UserId"); + }); + modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => { b.Property("DoesCode"); @@ -935,7 +964,7 @@ namespace Yavsc.Migrations .WithMany() .HasForeignKey("ClientId"); - b.HasOne("Yavsc.Models.Booking.BookQuery") + b.HasOne("Yavsc.Models.Workflow.BookQuery") .WithMany() .HasForeignKey("CommandId"); @@ -951,29 +980,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 +1009,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 +1076,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 +1108,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"); diff --git a/Yavsc/Models/ApplicationDbContext.cs b/Yavsc/Models/ApplicationDbContext.cs index 2264264f..f168b1b8 100644 --- a/Yavsc/Models/ApplicationDbContext.cs +++ b/Yavsc/Models/ApplicationDbContext.cs @@ -7,15 +7,16 @@ using Microsoft.AspNet.Identity.EntityFramework; using Microsoft.Data.Entity; using System.Web; using System.Threading; +using Yavsc.Models.Haircut; namespace Yavsc.Models { - using Relationship; - using Forms; + using Relationship; + using Forms; using YavscLib; using Auth; using Billing; - using Booking; + using Musical; using OAuth; using Workflow; using Identity; @@ -23,8 +24,9 @@ namespace Yavsc.Models using Chat; using Messaging; using Access; - using Booking.Profiles; - + using Musical.Profiles; + using Workflow.Profiles; + using Drawing; public class ApplicationDbContext : IdentityDbContext { protected override void OnModelCreating(ModelBuilder builder) @@ -262,6 +264,10 @@ namespace Yavsc.Models public DbSet
Form { get; set; } public DbSet Banlist { get ; set; } + + public DbSet HairTaint { get; set; } + + public DbSet Color { get; set; } } diff --git a/Yavsc/Models/Billing/Estimate.cs b/Yavsc/Models/Billing/Estimate.cs index de70da41..64031b75 100644 --- a/Yavsc/Models/Billing/Estimate.cs +++ b/Yavsc/Models/Billing/Estimate.cs @@ -8,8 +8,7 @@ using System.Linq; namespace Yavsc.Models.Billing { using Interfaces; - using Models.Booking; - using Yavsc.Models.Workflow; + using Models.Workflow; public partial class Estimate : IEstimate { diff --git a/Yavsc/Models/Billing/NominatvieCommand.cs b/Yavsc/Models/Billing/NominativeServiceCommand.cs similarity index 62% rename from Yavsc/Models/Billing/NominatvieCommand.cs rename to Yavsc/Models/Billing/NominativeServiceCommand.cs index 8c2bb031..e824acf6 100644 --- a/Yavsc/Models/Billing/NominatvieCommand.cs +++ b/Yavsc/Models/Billing/NominativeServiceCommand.cs @@ -2,14 +2,38 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Yavsc.Interfaces.Workflow; using Yavsc.Models.Market; using Yavsc.Models.Workflow; +using YavscLib; namespace Yavsc.Models.Billing { - public class NominativeServiceCommand : Query where T:Service + public abstract class NominativeServiceCommand : IBaseTrackedEntity, IQuery { + public DateTime DateCreated + { + get; set; + } + + public DateTime DateModified + { + get; set; + } + + public string UserCreated + { + get; set; + } + + public string UserModified + { + get; set; + } + + public QueryStatus Status { get; set; } + [Required] public string ClientId { get; set; } diff --git a/Yavsc/Models/Calendar/ICalendarManager.cs b/Yavsc/Models/Calendar/ICalendarManager.cs index e3277cf3..5a5f2799 100644 --- a/Yavsc/Models/Calendar/ICalendarManager.cs +++ b/Yavsc/Models/Calendar/ICalendarManager.cs @@ -20,11 +20,11 @@ // along with this program. If not, see . -using Yavsc.Models.Booking; -using Yavsc.Models.Messaging; namespace Yavsc.Models.Calendar { + using Models.Workflow; + using Models.Messaging; /// /// I calendar manager. /// diff --git a/Yavsc/Models/Drawing/Color.cs b/Yavsc/Models/Drawing/Color.cs new file mode 100644 index 00000000..cb00ee91 --- /dev/null +++ b/Yavsc/Models/Drawing/Color.cs @@ -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; } + } +} \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairCutGenders.cs b/Yavsc/Models/Haircut/HairCutGenders.cs new file mode 100644 index 00000000..9e6fb2a6 --- /dev/null +++ b/Yavsc/Models/Haircut/HairCutGenders.cs @@ -0,0 +1,9 @@ +namespace Yavsc.Models.Haircut +{ + public enum HairCutGenders : int + { + Kid = 1, + Man, + Women + } +} \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairCutQuery.cs b/Yavsc/Models/Haircut/HairCutQuery.cs new file mode 100644 index 00000000..1464f0ee --- /dev/null +++ b/Yavsc/Models/Haircut/HairCutQuery.cs @@ -0,0 +1,14 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Yavsc.Models.Billing; + +namespace Yavsc.Models.Haircut +{ + public class HairCutQuery : NominativeServiceCommand + { + [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long Id { get; set; } + HairPrestation [] Prestations { get; set; } + } +} \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairCutQueryEvent.cs b/Yavsc/Models/Haircut/HairCutQueryEvent.cs new file mode 100644 index 00000000..900b7b6e --- /dev/null +++ b/Yavsc/Models/Haircut/HairCutQueryEvent.cs @@ -0,0 +1,33 @@ +namespace Yavsc.Models.Haircut +{ + public class HairCutQueryEvent : BookQueryProviderInfo, IEvent + { + public HairCutQueryEvent() + { + Topic = "HairCutQuery"; + } + + public string Message + { + get; + + set; + } + + public string Sender + { + get; + + set; + } + + public string Topic + { + get; + + set; + } + + HairCutQuery Data { get; set; } + } +} \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairDressings.cs b/Yavsc/Models/Haircut/HairDressings.cs new file mode 100644 index 00000000..7f3369a4 --- /dev/null +++ b/Yavsc/Models/Haircut/HairDressings.cs @@ -0,0 +1,7 @@ +namespace Yavsc.Models.Haircut +{ + public enum HairDressings { + Brushing, + Folding + } +} \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairLength.cs b/Yavsc/Models/Haircut/HairLength.cs new file mode 100644 index 00000000..c187540f --- /dev/null +++ b/Yavsc/Models/Haircut/HairLength.cs @@ -0,0 +1,9 @@ +namespace Yavsc.Models.Haircut +{ + public enum HairLength : int + { + Short = 1, + HalfLong, + Long + } +} \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairPrestation.cs b/Yavsc/Models/Haircut/HairPrestation.cs new file mode 100644 index 00000000..e3825420 --- /dev/null +++ b/Yavsc/Models/Haircut/HairPrestation.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Yavsc.Models.Market; + +namespace Yavsc.Models.Haircut +{ + public class HairPrestation : Service + { + public HairLength Length { get; set; } + public HairCutGenders Gender { get; set; } + public bool Cut { get; set; } + + public HairDressings Dressing { get; set; } + public HairTechnos Tech { get; set; } + public bool Shampoo { get; set; } + public HairTaint[] Taints { get; set; } + public bool Cares { get; set; } + + } +} \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairTaint.cs b/Yavsc/Models/Haircut/HairTaint.cs new file mode 100644 index 00000000..09c1cec0 --- /dev/null +++ b/Yavsc/Models/Haircut/HairTaint.cs @@ -0,0 +1,21 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + + +namespace Yavsc.Models.Haircut +{ + using Drawing; + public class HairTaint + { + [Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long Id { get; set;} + + public string Brand { get; set; } + + [Required] + public long ColorId { get; set; } + + [ForeignKeyAttribute("ColorId")] + public virtual Color Color {get; set;} + } +} \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairTechnos.cs b/Yavsc/Models/Haircut/HairTechnos.cs new file mode 100644 index 00000000..39af80d7 --- /dev/null +++ b/Yavsc/Models/Haircut/HairTechnos.cs @@ -0,0 +1,13 @@ +namespace Yavsc.Models.Haircut +{ + + public enum HairTechnos + { + Color, + Permanent, + Defris, + Mech, + Balayage, + TyAndDie + } +} \ No newline at end of file diff --git a/Yavsc/Models/Booking/Instrument.cs b/Yavsc/Models/Musical/Instrument.cs similarity index 91% rename from Yavsc/Models/Booking/Instrument.cs rename to Yavsc/Models/Musical/Instrument.cs index 694cbde7..ae93c9c4 100644 --- a/Yavsc/Models/Booking/Instrument.cs +++ b/Yavsc/Models/Musical/Instrument.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Yavsc.Models.Booking +namespace Yavsc.Models.Musical { public class Instrument { diff --git a/Yavsc/Models/Booking/InstrumentRating.cs b/Yavsc/Models/Musical/InstrumentRating.cs similarity index 94% rename from Yavsc/Models/Booking/InstrumentRating.cs rename to Yavsc/Models/Musical/InstrumentRating.cs index cd5a6f77..977f5086 100644 --- a/Yavsc/Models/Booking/InstrumentRating.cs +++ b/Yavsc/Models/Musical/InstrumentRating.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Yavsc.Models.Workflow; -namespace Yavsc.Models.Booking +namespace Yavsc.Models.Musical { public class InstrumentRating { diff --git a/Yavsc/Models/Booking/MusicalPreference.cs b/Yavsc/Models/Musical/MusicalPreference.cs similarity index 89% rename from Yavsc/Models/Booking/MusicalPreference.cs rename to Yavsc/Models/Musical/MusicalPreference.cs index 97e491a6..4cb3b924 100644 --- a/Yavsc/Models/Booking/MusicalPreference.cs +++ b/Yavsc/Models/Musical/MusicalPreference.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; -namespace Yavsc.Models.Booking +namespace Yavsc.Models.Musical { public class MusicalPreference { diff --git a/Yavsc/Models/Booking/MusicalTendency.cs b/Yavsc/Models/Musical/MusicalTendency.cs similarity index 90% rename from Yavsc/Models/Booking/MusicalTendency.cs rename to Yavsc/Models/Musical/MusicalTendency.cs index 3afda65c..aeb9e06e 100644 --- a/Yavsc/Models/Booking/MusicalTendency.cs +++ b/Yavsc/Models/Musical/MusicalTendency.cs @@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Yavsc.Models.Booking { +namespace Yavsc.Models.Musical { diff --git a/Yavsc/Models/Booking/Profiles/DjPerformerProfile.cs b/Yavsc/Models/Musical/Profiles/DjPerformerProfile.cs similarity index 92% rename from Yavsc/Models/Booking/Profiles/DjPerformerProfile.cs rename to Yavsc/Models/Musical/Profiles/DjPerformerProfile.cs index 18613e15..863e8263 100644 --- a/Yavsc/Models/Booking/Profiles/DjPerformerProfile.cs +++ b/Yavsc/Models/Musical/Profiles/DjPerformerProfile.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using Yavsc.Models.Workflow; -namespace Yavsc.Models.Booking +namespace Yavsc.Models.Musical { public class DjPerformerProfile : SpecializationSettings { diff --git a/Yavsc/Models/Booking/Profiles/DjSettings.cs b/Yavsc/Models/Musical/Profiles/DjSettings.cs similarity index 90% rename from Yavsc/Models/Booking/Profiles/DjSettings.cs rename to Yavsc/Models/Musical/Profiles/DjSettings.cs index 8df23225..8ca70a7e 100644 --- a/Yavsc/Models/Booking/Profiles/DjSettings.cs +++ b/Yavsc/Models/Musical/Profiles/DjSettings.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using YavscLib; -namespace Yavsc.Models.Booking.Profiles +namespace Yavsc.Models.Musical.Profiles { public class DjSettings : ISpecializationSettings { diff --git a/Yavsc/Models/Booking/Profiles/FormationPerformerProfile.cs b/Yavsc/Models/Musical/Profiles/FormationPerformerProfile.cs similarity index 87% rename from Yavsc/Models/Booking/Profiles/FormationPerformerProfile.cs rename to Yavsc/Models/Musical/Profiles/FormationPerformerProfile.cs index 66b86c49..b0f9761e 100644 --- a/Yavsc/Models/Booking/Profiles/FormationPerformerProfile.cs +++ b/Yavsc/Models/Musical/Profiles/FormationPerformerProfile.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using Yavsc.Models.Workflow; -namespace Yavsc.Models.Booking.Profiles +namespace Yavsc.Models.Musical.Profiles { public class FormationPerformerProfile { diff --git a/Yavsc/Models/Booking/Profiles/GeneralSettings.cs b/Yavsc/Models/Musical/Profiles/GeneralSettings.cs similarity index 89% rename from Yavsc/Models/Booking/Profiles/GeneralSettings.cs rename to Yavsc/Models/Musical/Profiles/GeneralSettings.cs index 860af32f..11fa903a 100644 --- a/Yavsc/Models/Booking/Profiles/GeneralSettings.cs +++ b/Yavsc/Models/Musical/Profiles/GeneralSettings.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using YavscLib; -namespace Yavsc.Models.Booking.Profiles +namespace Yavsc.Models.Musical.Profiles { public class GeneralSettings : ISpecializationSettings { diff --git a/Yavsc/Models/Booking/Profiles/Instrumentation.cs b/Yavsc/Models/Musical/Profiles/Instrumentation.cs similarity index 92% rename from Yavsc/Models/Booking/Profiles/Instrumentation.cs rename to Yavsc/Models/Musical/Profiles/Instrumentation.cs index f2f7c0ff..6ce48bbe 100644 --- a/Yavsc/Models/Booking/Profiles/Instrumentation.cs +++ b/Yavsc/Models/Musical/Profiles/Instrumentation.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations.Schema; using Yavsc.Models.Workflow; using YavscLib; -namespace Yavsc.Models.Booking.Profiles +namespace Yavsc.Models.Musical.Profiles { public class Instrumentation : ISpecializationSettings { diff --git a/Yavsc/Models/Booking/Profiles/MusicianPerformerProfile.cs b/Yavsc/Models/Musical/Profiles/MusicianPerformerProfile.cs similarity index 91% rename from Yavsc/Models/Booking/Profiles/MusicianPerformerProfile.cs rename to Yavsc/Models/Musical/Profiles/MusicianPerformerProfile.cs index 191344ea..62719963 100644 --- a/Yavsc/Models/Booking/Profiles/MusicianPerformerProfile.cs +++ b/Yavsc/Models/Musical/Profiles/MusicianPerformerProfile.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using Yavsc.Models.Workflow; -namespace Yavsc.Models.Booking +namespace Yavsc.Models.Musical { public class MusicianPerformerProfile : PerformerProfile { diff --git a/Yavsc/Models/Booking/Profiles/StarPerformerProfile.cs b/Yavsc/Models/Musical/Profiles/StarPerformerProfile.cs similarity index 88% rename from Yavsc/Models/Booking/Profiles/StarPerformerProfile.cs rename to Yavsc/Models/Musical/Profiles/StarPerformerProfile.cs index 1dc1a077..43b976b4 100644 --- a/Yavsc/Models/Booking/Profiles/StarPerformerProfile.cs +++ b/Yavsc/Models/Musical/Profiles/StarPerformerProfile.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using Yavsc.Models.Workflow; -namespace Yavsc.Models.Booking.Profiles +namespace Yavsc.Models.Musical.Profiles { public class StarPerformerProfile : PerformerProfile { diff --git a/Yavsc/Models/Booking/BookQuery.cs b/Yavsc/Models/Workflow/BookQuery.cs similarity index 90% rename from Yavsc/Models/Booking/BookQuery.cs rename to Yavsc/Models/Workflow/BookQuery.cs index c6cb094a..9f7edec7 100644 --- a/Yavsc/Models/Booking/BookQuery.cs +++ b/Yavsc/Models/Workflow/BookQuery.cs @@ -3,17 +3,16 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Newtonsoft.Json; -namespace Yavsc.Models.Booking +namespace Yavsc.Models.Workflow { using YavscLib; using Yavsc.Models.Billing; using Yavsc.Models.Relationship; - using Yavsc.Models.Workflow; /// /// Query, for a date, with a given perfomer, at this given place. /// - public class BookQuery : NominativeServiceCommand, IBaseTrackedEntity + public class BookQuery : NominativeServiceCommand { /// /// The command identifier diff --git a/Yavsc/Models/Booking/Profiles/FormationSettings.cs b/Yavsc/Models/Workflow/Profiles/FormationSettings.cs similarity index 89% rename from Yavsc/Models/Booking/Profiles/FormationSettings.cs rename to Yavsc/Models/Workflow/Profiles/FormationSettings.cs index b0d9abdb..085ee2f2 100644 --- a/Yavsc/Models/Booking/Profiles/FormationSettings.cs +++ b/Yavsc/Models/Workflow/Profiles/FormationSettings.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -namespace Yavsc.Models.Booking.Profiles +namespace Yavsc.Models.Workflow.Profiles { using Models.Workflow; using YavscLib; diff --git a/Yavsc/Models/Workflow/Query.cs b/Yavsc/Models/Workflow/Query.cs index 369bb300..c619f78b 100644 --- a/Yavsc/Models/Workflow/Query.cs +++ b/Yavsc/Models/Workflow/Query.cs @@ -6,28 +6,8 @@ namespace Yavsc.Models.Workflow using Models.Market; using YavscLib; - public class Query

: IBaseTrackedEntity where P : BaseProduct + public interface IQuery: IBaseTrackedEntity { - public DateTime DateCreated - { - get; set; - } - - public DateTime DateModified - { - get; set; - } - - public string UserCreated - { - get; set; - } - - public string UserModified - { - get; set; - } - QueryStatus Status { get; set; } } diff --git a/Yavsc/Models/Booking/RendezVous.cs b/Yavsc/Models/Workflow/RendezVous.cs similarity index 96% rename from Yavsc/Models/Booking/RendezVous.cs rename to Yavsc/Models/Workflow/RendezVous.cs index 0ca7ad88..3942a9a5 100644 --- a/Yavsc/Models/Booking/RendezVous.cs +++ b/Yavsc/Models/Workflow/RendezVous.cs @@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Yavsc.Models.Market; -namespace Yavsc.Models.Booking +namespace Yavsc.Models.Workflow { using Models.Relationship; ///

diff --git a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx index 3f9767bd..adfe14e0 100644 --- a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx +++ b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx @@ -323,10 +323,10 @@ {0} has been notified of your query, you should be fast contacted regarding his calendar, {0} should be available for this booking - Paramètres musicien (l'instrument) - Paramètres Dj (le compte SoundCloud.com) - Paramètres formation (les partenaires) - Paramètres généraux: une couleur musicale + Paramètres musicien (l'instrument) + Paramètres Dj (le compte SoundCloud.com) + Paramètres formation (les partenaires) + Paramètres généraux: une couleur musicale You need to be authenticated in order to contact a performer You're not administrator diff --git a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.resx b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.resx index ba99724b..4ea89a52 100644 --- a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.resx +++ b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.resx @@ -396,10 +396,10 @@ {0} à été notifié de votre demande, vous devriez être contacté rapidement Au vu de son calendrier, {0} devrait être disponible pour ce rendez-vous - Paramètres musicien (l'instrument) - Paramètres Dj (le compte SoundCloud.com) - Paramètres formation (les partenaires) - Paramètres généraux (visibilité et présentation) + Paramètres musicien (l'instrument) + Paramètres Dj (le compte SoundCloud.com) + Paramètres formation (les partenaires) + Paramètres généraux (visibilité et présentation) Oui Vous devez vous authentifier pour pouvoir demander un devis à un préstataire. diff --git a/Yavsc/Startup/Startup.Workflow.cs b/Yavsc/Startup/Startup.Workflow.cs index 603d1c8e..1e369268 100644 --- a/Yavsc/Startup/Startup.Workflow.cs +++ b/Yavsc/Startup/Startup.Workflow.cs @@ -10,6 +10,8 @@ namespace Yavsc /// Lists Available user profile classes. /// public static Dictionary ProfileTypes = new Dictionary() ; + public static readonly string [] Forms = new string [] { "Profiles" }; + private void ConfigureWorkflow(IApplicationBuilder app, SiteSettings settings) { System.AppDomain.CurrentDomain.ResourceResolve += OnYavscResourceResolve; diff --git a/Yavsc/ViewModels/Auth/Handlers/BlogViewHandler.cs b/Yavsc/ViewModels/Auth/Handlers/BlogViewHandler.cs index c37960e0..7253c957 100644 --- a/Yavsc/ViewModels/Auth/Handlers/BlogViewHandler.cs +++ b/Yavsc/ViewModels/Auth/Handlers/BlogViewHandler.cs @@ -16,10 +16,12 @@ namespace Yavsc.ViewModels.Auth.Handlers if (resource.AuthorId == context.User.GetUserId()) context.Succeed(requirement); else if (resource.Visible) { - if (resource.ACL.Count>0) + if (resource.ACL==null) + context.Succeed(requirement); + else if (resource.ACL.Count>0) { var uid = context.User.GetUserId(); - if (resource.ACL.Any(a=>a.Allowed.Members.Any(m=>m.MemberId == uid ))) + if (resource.ACL.Any(a=>a.Allowed!=null && a.Allowed.Members.Any(m=>m.MemberId == uid ))) context.Succeed(requirement); else context.Fail(); } diff --git a/Yavsc/ViewModels/Auth/Handlers/CommandEditHandler.cs b/Yavsc/ViewModels/Auth/Handlers/CommandEditHandler.cs index 9cc7228e..738918b8 100644 --- a/Yavsc/ViewModels/Auth/Handlers/CommandEditHandler.cs +++ b/Yavsc/ViewModels/Auth/Handlers/CommandEditHandler.cs @@ -3,7 +3,7 @@ using Microsoft.AspNet.Authorization; namespace Yavsc.ViewModels.Auth.Handlers { - using Models.Booking; + using Models.Workflow; public class CommandEditHandler : AuthorizationHandler { protected override void Handle(AuthorizationContext context, EditRequirement requirement, BookQuery resource) diff --git a/Yavsc/ViewModels/Auth/Handlers/CommandViewHandler.cs b/Yavsc/ViewModels/Auth/Handlers/CommandViewHandler.cs index 7ab2a6b4..7b46a8e6 100644 --- a/Yavsc/ViewModels/Auth/Handlers/CommandViewHandler.cs +++ b/Yavsc/ViewModels/Auth/Handlers/CommandViewHandler.cs @@ -3,7 +3,7 @@ using Microsoft.AspNet.Authorization; namespace Yavsc.ViewModels.Auth.Handlers { - using Models.Booking; + using Models.Workflow; public class CommandViewHandler : AuthorizationHandler { protected override void Handle(AuthorizationContext context, ViewRequirement requirement, BookQuery resource) diff --git a/Yavsc/Views/Blogspot/Details.cshtml b/Yavsc/Views/Blogspot/Details.cshtml index 4858509b..f2b49751 100644 --- a/Yavsc/Views/Blogspot/Details.cshtml +++ b/Yavsc/Views/Blogspot/Details.cshtml @@ -8,11 +8,7 @@

@Model.Title

-

- -

-
-
+

diff --git a/Yavsc/Views/Blogspot/Index.cshtml b/Yavsc/Views/Blogspot/Index.cshtml index 57dabfd3..c20d6460 100644 --- a/Yavsc/Views/Blogspot/Index.cshtml +++ b/Yavsc/Views/Blogspot/Index.cshtml @@ -1,11 +1,24 @@ @model IEnumerable @{ ViewData["Title"] = "Index"; - }

Index

@ViewData["StatusMessage"]

+@if (User.IsSignedIn()) { + + + +}

@SR["Create a new article"]

@@ -26,12 +39,14 @@ @item.Title - @item.Author.UserName
+ @item.Content.Substring(0,120) + @((item.Content.Length>120)?"...":"") + (@item.Author.UserName , posté le @item.DateCreated.ToString("dddd d MMM yyyy à H:mm") @if ((item.DateModified - item.DateCreated).Minutes > 0){  @:- Modifié le @item.DateModified.ToString("dddd d MMM yyyy à H:mm") - } + }) @@ -50,27 +65,4 @@ } - - diff --git a/Yavsc/Views/Colors/Create.cshtml b/Yavsc/Views/Colors/Create.cshtml new file mode 100644 index 00000000..35631493 --- /dev/null +++ b/Yavsc/Views/Colors/Create.cshtml @@ -0,0 +1,40 @@ +@model Color +@{ + ViewData["Title"] = "Create"; +} +

Create

+ + +
+

Color

+
+
+
+ +
+ + + +
+
+ +
+ +
+ @await Html.PartialAsync("ColorEditor",Model) +
+
+ +
+
+ +
+
+
+ + + diff --git a/Yavsc/Views/Colors/Delete.cshtml b/Yavsc/Views/Colors/Delete.cshtml new file mode 100644 index 00000000..7ff85b75 --- /dev/null +++ b/Yavsc/Views/Colors/Delete.cshtml @@ -0,0 +1,30 @@ +@model Yavsc.Models.Drawing.Color + +@{ + ViewData["Title"] = "Delete"; +} + +

Delete

+ +

Are you sure you want to delete this?

+
+

Color

+
+
+
+ @Html.DisplayNameFor(model => model.Name) +
+
+ @Html.DisplayFor(model => model) + @Html.DisplayFor(model => model.Name) +
+
+ +
+ +
+ | + Back to List +
+
+
diff --git a/Yavsc/Views/Colors/Details.cshtml b/Yavsc/Views/Colors/Details.cshtml new file mode 100644 index 00000000..c5935b81 --- /dev/null +++ b/Yavsc/Views/Colors/Details.cshtml @@ -0,0 +1,26 @@ +@model Yavsc.Models.Drawing.Color + +@{ + ViewData["Title"] = "Details"; +} + +

Details

+ +
+

Color

+
+
+
+ @Html.DisplayNameFor(model => model.Name) +
+
+ @Html.DisplayFor(model => model) + @Html.DisplayFor(model => model.Name) +
+ +
+
+

+ @Html.ActionLink("Edit", "Edit", new { id = Model.Id }) | + Back to List +

diff --git a/Yavsc/Views/Colors/Edit.cshtml b/Yavsc/Views/Colors/Edit.cshtml new file mode 100644 index 00000000..f9173877 --- /dev/null +++ b/Yavsc/Views/Colors/Edit.cshtml @@ -0,0 +1,44 @@ +@model Yavsc.Models.Drawing.Color + +@{ + ViewData["Title"] = "Edit"; +} + +

Edit

+ +
+
+

Color

+
+
+ + + +
+ +
+ + +
+
+
+ +
+ @await Html.PartialAsync("ColorEditor",Model) +
+
+ +
+
+ +
+
+
+
+ + + diff --git a/Yavsc/Views/Colors/Index.cshtml b/Yavsc/Views/Colors/Index.cshtml new file mode 100644 index 00000000..9d1c9c54 --- /dev/null +++ b/Yavsc/Views/Colors/Index.cshtml @@ -0,0 +1,33 @@ +@model IEnumerable + +@{ + ViewData["Title"] = "Index"; +} + +

Index

+ +

+ Create New +

+ + + + + + +@foreach (var item in Model) { + + + + +} +
+ @SR["Les couleurs"] +
+ @Html.DisplayFor(l => item) + @Html.DisplayFor(l => item.Name) + + @Html.ActionLink("Edit", "Edit", new { id = item.Id }) | + @Html.ActionLink("Details", "Details", new {id = item.Id }) | + @Html.ActionLink("Delete", "Delete", new { id = item.Id }) +
diff --git a/Yavsc/Views/Command/BookHaircutStar.cshtml b/Yavsc/Views/Command/BookHaircutStar.cshtml new file mode 100644 index 00000000..9e631dc3 --- /dev/null +++ b/Yavsc/Views/Command/BookHaircutStar.cshtml @@ -0,0 +1,207 @@ +@model HairPrestationQuery +@{ ViewData["Title"] = "Proposition de rendez-vous "+ +@SR["to"]+" "+ Model.PerformerProfile.Performer.UserName ++" ["+SR[ViewBag.Activity.Code]+"]"; } + + + + + +@section header { + +} +@section scripts{ + +} +

@ViewData["Title"]

+
+
+

@SR["Fill in your book query"]

+
+
+
+
+ Votre évennement + +
+
+
+
+
+ + + + +
+
+ + + +
+
+
+ +
+
+
+
+
+ + +
    +
+
+
+
+
+
+ +
+ + +
+
+
+
+
+ + +@Html.HiddenFor(model=>model.Location.Latitude) + @Html.HiddenFor(model=>model.Location.Longitude) +
+
+
+
+
+
+
+
+
+ +
+
+@Html.HiddenFor(model=>model.ClientId) +@Html.HiddenFor(model=>model.PerformerId) +@Html.HiddenFor(model=>model.ActivityCode) +
+ + +
+ +@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } diff --git a/Yavsc/Views/Command/Create.cshtml b/Yavsc/Views/Command/Create.cshtml index cdb9d8c5..dc385204 100644 --- a/Yavsc/Views/Command/Create.cshtml +++ b/Yavsc/Views/Command/Create.cshtml @@ -1,5 +1,7 @@ @model BookQuery -@{ ViewData["Title"] = SR["Book "+ViewBag.Activity.Code]; } +@{ ViewData["Title"] = "Proposition de rendez-vous "+ +@SR["to"]+" "+ Model.PerformerProfile.Performer.UserName ++" ["+SR[ViewBag.Activity.Code]+"]"; } diff --git a/Yavsc/Views/FrontOffice/HArts.chtml b/Yavsc/Views/FrontOffice/HArts.chtml new file mode 100644 index 00000000..dadf8034 --- /dev/null +++ b/Yavsc/Views/FrontOffice/HArts.chtml @@ -0,0 +1,16 @@ +@model IEnumerable + +@{ + ViewData["Title"] = "Book - " + (ViewBag.Activity?.Name ?? SR["Any"]); +} +@ViewBag.Activity.Description + +@foreach (var profile in Model) { +
+ @Html.DisplayFor(m=>m) +
+ + + +
+} diff --git a/Yavsc/Views/FrontOffice/Book.cshtml b/Yavsc/Views/FrontOffice/Profiles.cshtml similarity index 80% rename from Yavsc/Views/FrontOffice/Book.cshtml rename to Yavsc/Views/FrontOffice/Profiles.cshtml index ee399d0a..88ed7d0e 100644 --- a/Yavsc/Views/FrontOffice/Book.cshtml +++ b/Yavsc/Views/FrontOffice/Profiles.cshtml @@ -11,7 +11,7 @@
- +
} diff --git a/Yavsc/Views/HairTaints/Create.cshtml b/Yavsc/Views/HairTaints/Create.cshtml new file mode 100644 index 00000000..0c9210ec --- /dev/null +++ b/Yavsc/Views/HairTaints/Create.cshtml @@ -0,0 +1,38 @@ +@model Yavsc.Models.Haircut.HairTaint + +@{ + ViewData["Title"] = "Create"; +} + +

Create

+ +
+
+

HairTaint

+
+
+
+ +
+ + +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+ + + diff --git a/Yavsc/Views/HairTaints/Delete.cshtml b/Yavsc/Views/HairTaints/Delete.cshtml new file mode 100644 index 00000000..b520a00d --- /dev/null +++ b/Yavsc/Views/HairTaints/Delete.cshtml @@ -0,0 +1,28 @@ +@model Yavsc.Models.Haircut.HairTaint + +@{ + ViewData["Title"] = "Delete"; +} + +

Delete

+ +

Are you sure you want to delete this?

+
+

HairTaint

+
+
+
+ @Html.DisplayNameFor(model => model.Brand) +
+
+ @Html.DisplayFor(model => model.Brand) +
+
+ +
+
+ | + Back to List +
+
+
diff --git a/Yavsc/Views/HairTaints/Details.cshtml b/Yavsc/Views/HairTaints/Details.cshtml new file mode 100644 index 00000000..5ba7a48f --- /dev/null +++ b/Yavsc/Views/HairTaints/Details.cshtml @@ -0,0 +1,24 @@ +@model Yavsc.Models.Haircut.HairTaint + +@{ + ViewData["Title"] = "Details"; +} + +

Details

+ +
+

HairTaint

+
+
+
+ @Html.DisplayNameFor(model => model.Brand) +
+
+ @Html.DisplayFor(model => model.Brand) +
+
+
+

+ Edit | + Back to List +

diff --git a/Yavsc/Views/HairTaints/Edit.cshtml b/Yavsc/Views/HairTaints/Edit.cshtml new file mode 100644 index 00000000..0b7d68b2 --- /dev/null +++ b/Yavsc/Views/HairTaints/Edit.cshtml @@ -0,0 +1,40 @@ +@model Yavsc.Models.Haircut.HairTaint + +@{ + ViewData["Title"] = "Edit"; +} + +

Edit

+ +
+
+

HairTaint

+
+
+ +
+ +
+ + +
+
+
+ +
+ + +
+
+
+
+ +
+
+
+
+ + + diff --git a/Yavsc/Views/HairTaints/Index.cshtml b/Yavsc/Views/HairTaints/Index.cshtml new file mode 100644 index 00000000..5a02d5cb --- /dev/null +++ b/Yavsc/Views/HairTaints/Index.cshtml @@ -0,0 +1,38 @@ +@model IEnumerable + +@{ + ViewData["Title"] = "Index"; +} + +

Index

+ +

+ Create New +

+ + + + + + + +@foreach (var item in Model) { + + + + + +} +
+ @Html.DisplayNameFor(model => model.Brand) + + @Html.DisplayNameFor(model => model.Color) +
+ @Html.DisplayFor(modelItem => item.Brand) + + @Html.DisplayFor(modelItem => item.Color) + + Edit | + Details | + Delete +
diff --git a/Yavsc/Views/Home/Chat.cshtml b/Yavsc/Views/Home/Chat.cshtml index e7db288b..8e3b8e1a 100644 --- a/Yavsc/Views/Home/Chat.cshtml +++ b/Yavsc/Views/Home/Chat.cshtml @@ -3,42 +3,43 @@ + + +
-
-

Salons

-
    -
  • Public
  • -
-

Utilisateurs

-
    -
- -
+
+ Salons +
    +
  • Public
  • +
+ Utilisateurs +
    +
+
- +
@if (ViewBag.IsAuthenticated) {
diff --git a/Yavsc/Views/Home/Index.cshtml b/Yavsc/Views/Home/Index.cshtml index a13186e1..a705df4c 100755 --- a/Yavsc/Views/Home/Index.cshtml +++ b/Yavsc/Views/Home/Index.cshtml @@ -22,20 +22,18 @@ i=0; foreach (var act in Model) { string cls = (i==0) ? "item active":"item"; -
+
@@ -51,7 +49,4 @@ Suivant
- -
- -
+ diff --git a/Yavsc/Views/Instrumentation/Create.cshtml b/Yavsc/Views/Instrumentation/Create.cshtml index 7f59f176..90c18819 100644 --- a/Yavsc/Views/Instrumentation/Create.cshtml +++ b/Yavsc/Views/Instrumentation/Create.cshtml @@ -2,7 +2,7 @@ @model Instrumentation @{ - ViewBag.SettingLabel = SR["Yavsc.Models.Booking.Profiles.Instrumentation"]; + ViewBag.SettingLabel = SR["Yavsc.Models.Musical.Profiles.Instrumentation"]; ViewData["Title"] = SR[ViewBag.SettingLabel] + "[" +SR["Set"] + "]" ; } diff --git a/Yavsc/Views/Instrumentation/Delete.cshtml b/Yavsc/Views/Instrumentation/Delete.cshtml index 2f0465e1..7a07bddb 100644 --- a/Yavsc/Views/Instrumentation/Delete.cshtml +++ b/Yavsc/Views/Instrumentation/Delete.cshtml @@ -2,7 +2,7 @@ @{ - ViewBag.SettingLabel = SR["Yavsc.Models.Booking.Profiles.Instrumentation"]; + ViewBag.SettingLabel = SR["Yavsc.Models.Musical.Profiles.Instrumentation"]; ViewData["Title"] = SR[ViewBag.SettingLabel] + "[" +SR["Delete"] + "]" ; } diff --git a/Yavsc/Views/Instrumentation/Details.cshtml b/Yavsc/Views/Instrumentation/Details.cshtml index 9447b05d..46696c08 100644 --- a/Yavsc/Views/Instrumentation/Details.cshtml +++ b/Yavsc/Views/Instrumentation/Details.cshtml @@ -2,7 +2,7 @@ @{ - ViewBag.SettingLabel = SR["Yavsc.Models.Booking.Profiles.Instrumentation"]; + ViewBag.SettingLabel = SR["Yavsc.Models.Musical.Profiles.Instrumentation"]; ViewData["Title"] = SR[ViewBag.SettingLabel] + "[" +SR["Details"] + "]" ; } @{ diff --git a/Yavsc/Views/Instrumentation/Edit.cshtml b/Yavsc/Views/Instrumentation/Edit.cshtml index 39c5e386..def5b752 100644 --- a/Yavsc/Views/Instrumentation/Edit.cshtml +++ b/Yavsc/Views/Instrumentation/Edit.cshtml @@ -1,7 +1,7 @@ @model Instrumentation @{ - ViewBag.SettingLabel = SR["Yavsc.Models.Booking.Profiles.Instrumentation"]; + ViewBag.SettingLabel = SR["Yavsc.Models.Musical.Profiles.Instrumentation"]; ViewData["Title"] = SR[ViewBag.SettingLabel] + "[" +SR["Edit"] + "]" ; }

Edit

diff --git a/Yavsc/Views/Instrumentation/Index.cshtml b/Yavsc/Views/Instrumentation/Index.cshtml index 85c1a1bb..67e1f408 100644 --- a/Yavsc/Views/Instrumentation/Index.cshtml +++ b/Yavsc/Views/Instrumentation/Index.cshtml @@ -2,7 +2,7 @@ @{ - ViewBag.SettingLabel = SR["Yavsc.Models.Booking.Profiles.Instrumentation"]; + ViewBag.SettingLabel = SR["Yavsc.Models.Musical.Profiles.Instrumentation"]; ViewData["Title"] = SR[ViewBag.SettingLabel] + "[" +SR["Index"] + "]" ; } diff --git a/Yavsc/Views/Shared/ColorEditor.cshtml b/Yavsc/Views/Shared/ColorEditor.cshtml new file mode 100644 index 00000000..354579c7 --- /dev/null +++ b/Yavsc/Views/Shared/ColorEditor.cshtml @@ -0,0 +1,64 @@ +@model Color +
+ +
+ +
+
+
+
+
+
+ + + + diff --git a/Yavsc/Views/Shared/DisplayTemplates/Color.cshtml b/Yavsc/Views/Shared/DisplayTemplates/Color.cshtml new file mode 100644 index 00000000..98c25cab --- /dev/null +++ b/Yavsc/Views/Shared/DisplayTemplates/Color.cshtml @@ -0,0 +1,2 @@ +@model Color +
diff --git a/Yavsc/Views/Shared/_Layout.cshtml b/Yavsc/Views/Shared/_Layout.cshtml index fb1be114..6a43dad5 100755 --- a/Yavsc/Views/Shared/_Layout.cshtml +++ b/Yavsc/Views/Shared/_Layout.cshtml @@ -8,18 +8,18 @@ + - - + + - - + + - + @RenderSection("header", required: false) @@ -62,7 +63,17 @@