diff --git a/Yavsc/Controllers/BrusherProfileController.cs b/Yavsc/Controllers/BrusherProfileController.cs new file mode 100644 index 00000000..35644de3 --- /dev/null +++ b/Yavsc/Controllers/BrusherProfileController.cs @@ -0,0 +1,123 @@ +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNet.Mvc; +using System.Security.Claims; +using Microsoft.Data.Entity; +using Yavsc.Models; +using Yavsc.Models.Haircut; +using Microsoft.AspNet.Authorization; +using System; + +namespace Yavsc.Controllers +{ + [Authorize(Roles="Performer")] + public class BrusherProfileController : Controller + { + private ApplicationDbContext _context; + + public BrusherProfileController(ApplicationDbContext context) + { + _context = context; + } + + // GET: BrusherProfile + public async Task Index() + { + var existing = await _context.BrusherProfile.SingleOrDefaultAsync(p=>p.UserId == User.GetUserId()); + return View(existing); + } + + // GET: BrusherProfile/Details/5 + public async Task Details(string id) + { + if (id == null) + { + id = User.GetUserId(); + } + + BrusherProfile brusherProfile = await _context.BrusherProfile.SingleAsync(m => m.UserId == id); + if (brusherProfile == null) + { + return HttpNotFound(); + } + + return View(brusherProfile); + } + + // GET: BrusherProfile/Create + public IActionResult Create() + { + return View(); + } + + // GET: BrusherProfile/Edit/5 + public async Task Edit(string id) + { + if (id == null) + { + id = User.GetUserId(); + } + + BrusherProfile brusherProfile = await _context.BrusherProfile.SingleOrDefaultAsync(m => m.UserId == id); + if (brusherProfile == null) + { + brusherProfile = new BrusherProfile { }; + } + return View(brusherProfile); + } + + // POST: BrusherProfile/Edit/5 + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Edit(BrusherProfile brusherProfile) + { + if (string.IsNullOrEmpty(brusherProfile.UserId)) + { + // a creation + brusherProfile.UserId = User.GetUserId(); + if (ModelState.IsValid) + { + _context.BrusherProfile.Add(brusherProfile); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + } + else if (ModelState.IsValid) + { + _context.Update(brusherProfile); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + return View(brusherProfile); + } + + // GET: BrusherProfile/Delete/5 + [ActionName("Delete")] + public async Task Delete(string id) + { + if (id == null) + { + return HttpNotFound(); + } + + BrusherProfile brusherProfile = await _context.BrusherProfile.SingleAsync(m => m.UserId == id); + if (brusherProfile == null) + { + return HttpNotFound(); + } + + return View(brusherProfile); + } + + // POST: BrusherProfile/Delete/5 + [HttpPost, ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(string id) + { + BrusherProfile brusherProfile = await _context.BrusherProfile.SingleAsync(m => m.UserId == id); + _context.BrusherProfile.Remove(brusherProfile); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + } +} diff --git a/Yavsc/Controllers/DoController.cs b/Yavsc/Controllers/DoController.cs index bd59f1e8..4a81f722 100644 --- a/Yavsc/Controllers/DoController.cs +++ b/Yavsc/Controllers/DoController.cs @@ -48,7 +48,7 @@ namespace Yavsc.Controllers } ViewBag.HasConfigurableSettings = (userActivity.Does.SettingsClassName != null); if (ViewBag.HasConfigurableSettings) - ViewBag.SettingsClassControllerName = Startup.ProfileTypes[userActivity.Does.SettingsClassName].Name; + ViewBag.SettingsControllerName = Startup.ProfileTypes[userActivity.Does.SettingsClassName].Name; return View(userActivity); } diff --git a/Yavsc/Controllers/FrontOfficeController.cs b/Yavsc/Controllers/FrontOfficeController.cs index c5cee49b..bc141903 100644 --- a/Yavsc/Controllers/FrontOfficeController.cs +++ b/Yavsc/Controllers/FrontOfficeController.cs @@ -11,9 +11,11 @@ namespace Yavsc.Controllers { using Helpers; using Microsoft.AspNet.Http; + using Microsoft.Extensions.Localization; using Models; using Newtonsoft.Json; using ViewModels.FrontOffice; + using Yavsc.Extensions; using Yavsc.Models.Haircut; using Yavsc.ViewModels.Haircut; @@ -23,13 +25,17 @@ namespace Yavsc.Controllers UserManager _userManager; ILogger _logger; + + IStringLocalizer _SR; public FrontOfficeController(ApplicationDbContext context, UserManager userManager, - ILoggerFactory loggerFactory) + ILoggerFactory loggerFactory, + IStringLocalizer SR) { _context = context; _userManager = userManager; _logger = loggerFactory.CreateLogger(); + _SR = SR; } public ActionResult Index() { @@ -70,11 +76,13 @@ namespace Yavsc.Controllers if (prestaJson!=null) { pPrestation = JsonConvert.DeserializeObject(prestaJson); } - else pPrestation = new HairPrestation { - - }; - + else pPrestation = new HairPrestation {}; + ViewBag.HairTaints = _context.HairTaint.Include(t=>t.Color); + ViewBag.HairTechnos = EnumExtensions.GetSelectList(typeof(HairTechnos),_SR); + ViewBag.HairLength = EnumExtensions.GetSelectList(typeof(HairLength),_SR); ViewBag.Activity = _context.Activities.First(a => a.Code == id); + ViewBag.Gender = EnumExtensions.GetSelectList(typeof(HairCutGenders),_SR); + ViewBag.HairDressings = EnumExtensions.GetSelectList(typeof(HairDressings),_SR); var result = new HairCutView { HairBrushers = _context.ListPerformers(id), Topic = pPrestation diff --git a/Yavsc/Controllers/HairPrestationsController.cs b/Yavsc/Controllers/HairPrestationsController.cs index 93e081bc..116ba040 100644 --- a/Yavsc/Controllers/HairPrestationsController.cs +++ b/Yavsc/Controllers/HairPrestationsController.cs @@ -1,7 +1,5 @@ -using System.Linq; using System.Threading.Tasks; using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; using Microsoft.Data.Entity; using Yavsc.Models; using Yavsc.Models.Haircut; diff --git a/Yavsc/Extensions/EnumExtensions.cs b/Yavsc/Extensions/EnumExtensions.cs new file mode 100644 index 00000000..c34be6ff --- /dev/null +++ b/Yavsc/Extensions/EnumExtensions.cs @@ -0,0 +1,78 @@ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Reflection; +using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.Extensions.Localization; + +namespace Yavsc.Extensions +{ + public static class EnumExtensions + { + public static List GetSelectList (Type type, IStringLocalizer SR, Enum valueSelected) + { + var typeInfo = type.GetTypeInfo(); + var values = Enum.GetValues(type).Cast(); + var items = new List(); + + foreach (var value in values) + { + items.Add(new SelectListItem { + Text = SR[GetDescription(value, typeInfo)], + Value = value.ToString(), + Selected = value == valueSelected + }); + } + return items; + } + public static List GetSelectList (Type type, IStringLocalizer SR) + { + var typeInfo = type.GetTypeInfo(); + var values = Enum.GetValues(type).Cast(); + var items = new List(); + + foreach (var value in values) + { + items.Add(new SelectListItem { + Text = SR[GetDescription(value, typeInfo)], + Value = value.ToString() + }); + } + return items; + } + public static string GetDescription(this Enum value, TypeInfo typeInfo ) + { + var declaredMember = typeInfo.DeclaredMembers.FirstOrDefault(i => i.Name == value.ToString()); + var attribute = declaredMember?.GetCustomAttribute(); + return attribute == null ? value.ToString() : attribute.Description ?? attribute.Name; + } + public static string GetDescription(this Enum value) + { + var type = value.GetType(); + var typeInfo = type.GetTypeInfo(); + return GetDescription(value, typeInfo); + } + + public static IEnumerable GetDescriptions(Type type) + { + var values = Enum.GetValues(type).Cast(); + var descriptions = new List(); + + foreach (var value in values) + { + descriptions.Add(value.GetDescription()); + } + + return descriptions; + } + + public static Enum GetEnumFromDescription(string description, Type enumType) + { + var enumValues = Enum.GetValues(enumType).Cast(); + var descriptionToEnum = enumValues.ToDictionary(k => k.GetDescription(), v => v); + return descriptionToEnum[description]; + } + } +} diff --git a/Yavsc/Migrations/20170227151759_hairPrestations.Designer.cs b/Yavsc/Migrations/20170227151759_hairPrestations.Designer.cs index b0287338..49167cc5 100644 --- a/Yavsc/Migrations/20170227151759_hairPrestations.Designer.cs +++ b/Yavsc/Migrations/20170227151759_hairPrestations.Designer.cs @@ -1,7 +1,6 @@ using System; using Microsoft.Data.Entity; using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; using Microsoft.Data.Entity.Migrations; using Yavsc.Models; diff --git a/Yavsc/Migrations/20170227151759_hairPrestations.cs b/Yavsc/Migrations/20170227151759_hairPrestations.cs index 3ba54b9e..67928122 100644 --- a/Yavsc/Migrations/20170227151759_hairPrestations.cs +++ b/Yavsc/Migrations/20170227151759_hairPrestations.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using Microsoft.Data.Entity.Migrations; namespace Yavsc.Migrations diff --git a/Yavsc/Migrations/20170228115359_brusherProfile.Designer.cs b/Yavsc/Migrations/20170228115359_brusherProfile.Designer.cs new file mode 100644 index 00000000..632c23da --- /dev/null +++ b/Yavsc/Migrations/20170228115359_brusherProfile.Designer.cs @@ -0,0 +1,1396 @@ +using System; +using Microsoft.Data.Entity; +using Microsoft.Data.Entity.Infrastructure; +using Microsoft.Data.Entity.Metadata; +using Microsoft.Data.Entity.Migrations; +using Yavsc.Models; + +namespace Yavsc.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20170228115359_brusherProfile")] + partial class brusherProfile + { + 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("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.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.BrusherProfile", b => + { + b.Property("UserId"); + + b.Property("CarePrice"); + + b.Property("EndOfTheDay"); + + b.Property("HalfBalayagePrice"); + + b.Property("HalfBrushingPrice"); + + b.Property("HalfColorPrice"); + + b.Property("HalfDefrisPrice"); + + b.Property("HalfMechPrice"); + + b.Property("HalfMultiColorPrice"); + + b.Property("HalfPermanentPrice"); + + b.Property("KidCutPrice"); + + b.Property("LongBalayagePrice"); + + b.Property("LongBrushingPrice"); + + b.Property("LongColorPrice"); + + b.Property("LongDefrisPrice"); + + b.Property("LongMechPrice"); + + b.Property("LongMultiColorPrice"); + + b.Property("LongPermanentPrice"); + + b.Property("ManCutPrice"); + + b.Property("ShampooPrice"); + + b.Property("ShortBalayagePrice"); + + b.Property("ShortBrushingPrice"); + + b.Property("ShortColorPrice"); + + b.Property("ShortDefrisPrice"); + + b.Property("ShortMechPrice"); + + b.Property("ShortMultiColorPrice"); + + b.Property("ShortPermanentPrice"); + + b.Property("StartOfTheDay"); + + b.Property("WomenHalfCutPrice"); + + b.Property("WomenLongCutPrice"); + + b.Property("WomenShortCutPrice"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", 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("PerformerId") + .IsRequired(); + + b.Property("PrestationId"); + + b.Property("Previsional"); + + b.Property("Status"); + + b.Property("UserCreated"); + + b.Property("UserModified"); + + b.Property("ValidationDate"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", 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("PerformerId") + .IsRequired(); + + b.Property("Previsional"); + + b.Property("Status"); + + b.Property("UserCreated"); + + b.Property("UserModified"); + + b.Property("ValidationDate"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Cares"); + + b.Property("Cut"); + + b.Property("Dressing"); + + b.Property("Gender"); + + b.Property("HairMultiCutQueryId"); + + b.Property("Length"); + + b.Property("Shampoo"); + + b.Property("Tech"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Brand"); + + b.Property("ColorId"); + + b.Property("HairPrestationId"); + + 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.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Depth"); + + b.Property("Description"); + + b.Property("Height"); + + b.Property("Name"); + + b.Property("Price"); + + b.Property("Public"); + + b.Property("Weight"); + + b.Property("Width"); + + b.HasKey("Id"); + }); + + 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.Messaging.DimissClicked", b => + { + b.Property("UserId"); + + b.Property("NotificationId"); + + b.HasKey("UserId", "NotificationId"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.Notification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("body") + .IsRequired(); + + b.Property("click_action") + .IsRequired(); + + b.Property("color"); + + b.Property("icon"); + + b.Property("sound"); + + b.Property("tag"); + + b.Property("title") + .IsRequired(); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Instrument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name") + .IsRequired() + .HasAnnotation("MaxLength", 255); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.MusicalPreference", b => + { + b.Property("OwnerProfileId"); + + b.Property("DjSettingsUserId"); + + b.Property("GeneralSettingsUserId"); + + b.Property("Rate"); + + b.Property("TendencyId"); + + b.HasKey("OwnerProfileId"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.MusicalTendency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name") + .IsRequired() + .HasAnnotation("MaxLength", 255); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.DjSettings", b => + { + b.Property("UserId"); + + b.Property("SoundCloudId"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.GeneralSettings", b => + { + b.Property("UserId"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.Instrumentation", b => + { + b.Property("InstrumentId"); + + b.Property("UserId"); + + b.HasKey("InstrumentId", "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("Hidden"); + + 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.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.RdvQuery", 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("Status"); + + b.Property("UserCreated"); + + b.Property("UserModified"); + + b.Property("ValidationDate"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => + { + b.Property("DoesCode"); + + b.Property("UserId"); + + b.Property("Weight"); + + b.HasKey("DoesCode", "UserId"); + }); + + 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.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.RdvQuery") + .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.Chat.Connection", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", 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.Workflow.PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId"); + + b.HasOne("Yavsc.Models.Haircut.HairPrestation") + .WithMany() + .HasForeignKey("PrestationId"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", 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.Workflow.PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestation", b => + { + b.HasOne("Yavsc.Models.Haircut.HairMultiCutQuery") + .WithMany() + .HasForeignKey("HairMultiCutQueryId"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b => + { + b.HasOne("Yavsc.Models.Drawing.Color") + .WithMany() + .HasForeignKey("ColorId"); + + b.HasOne("Yavsc.Models.Haircut.HairPrestation") + .WithMany() + .HasForeignKey("HairPrestationId"); + }); + + 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.Messaging.DimissClicked", b => + { + b.HasOne("Yavsc.Models.Messaging.Notification") + .WithMany() + .HasForeignKey("NotificationId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.MusicalPreference", b => + { + b.HasOne("Yavsc.Models.Musical.Profiles.DjSettings") + .WithMany() + .HasForeignKey("DjSettingsUserId"); + + b.HasOne("Yavsc.Models.Musical.Profiles.GeneralSettings") + .WithMany() + .HasForeignKey("GeneralSettingsUserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.Instrumentation", b => + { + b.HasOne("Yavsc.Models.Musical.Instrument") + .WithMany() + .HasForeignKey("InstrumentId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile") + .WithMany() + .HasForeignKey("UserId"); + }); + + 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.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.RdvQuery", 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.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/20170228115359_brusherProfile.cs b/Yavsc/Migrations/20170228115359_brusherProfile.cs new file mode 100644 index 00000000..8c033090 --- /dev/null +++ b/Yavsc/Migrations/20170228115359_brusherProfile.cs @@ -0,0 +1,602 @@ +using System; +using System.Collections.Generic; +using Microsoft.Data.Entity.Migrations; + +namespace Yavsc.Migrations +{ + public partial class brusherProfile : 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_HairCutQuery_Activity_ActivityCode", table: "HairCutQuery"); + migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_ApplicationUser_ClientId", table: "HairCutQuery"); + migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_PerformerProfile_PerformerId", table: "HairCutQuery"); + migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_Activity_ActivityCode", table: "HairMultiCutQuery"); + migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_ApplicationUser_ClientId", table: "HairMultiCutQuery"); + migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId", table: "HairMultiCutQuery"); + migrationBuilder.DropForeignKey(name: "FK_HairTaint_Color_ColorId", table: "HairTaint"); + migrationBuilder.DropForeignKey(name: "FK_DimissClicked_Notification_NotificationId", table: "DimissClicked"); + migrationBuilder.DropForeignKey(name: "FK_DimissClicked_ApplicationUser_UserId", table: "DimissClicked"); + migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation"); + migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember"); + migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember"); + migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag"); + migrationBuilder.DropForeignKey(name: "FK_CommandForm_Activity_ActivityCode", table: "CommandForm"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile"); + migrationBuilder.DropForeignKey(name: "FK_RdvQuery_Activity_ActivityCode", table: "RdvQuery"); + migrationBuilder.DropForeignKey(name: "FK_RdvQuery_ApplicationUser_ClientId", table: "RdvQuery"); + migrationBuilder.DropForeignKey(name: "FK_RdvQuery_PerformerProfile_PerformerId", table: "RdvQuery"); + migrationBuilder.DropForeignKey(name: "FK_UserActivity_Activity_DoesCode", table: "UserActivity"); + migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity"); + migrationBuilder.CreateTable( + name: "BrusherProfile", + columns: table => new + { + UserId = table.Column(nullable: false), + CarePrice = table.Column(nullable: false), + EndOfTheDay = table.Column(nullable: false), + HalfBalayagePrice = table.Column(nullable: false), + HalfBrushingPrice = table.Column(nullable: false), + HalfColorPrice = table.Column(nullable: false), + HalfDefrisPrice = table.Column(nullable: false), + HalfMechPrice = table.Column(nullable: false), + HalfMultiColorPrice = table.Column(nullable: false), + HalfPermanentPrice = table.Column(nullable: false), + KidCutPrice = table.Column(nullable: false), + LongBalayagePrice = table.Column(nullable: false), + LongBrushingPrice = table.Column(nullable: false), + LongColorPrice = table.Column(nullable: false), + LongDefrisPrice = table.Column(nullable: false), + LongMechPrice = table.Column(nullable: false), + LongMultiColorPrice = table.Column(nullable: false), + LongPermanentPrice = table.Column(nullable: false), + ManCutPrice = table.Column(nullable: false), + ShampooPrice = table.Column(nullable: false), + ShortBalayagePrice = table.Column(nullable: false), + ShortBrushingPrice = table.Column(nullable: false), + ShortColorPrice = table.Column(nullable: false), + ShortDefrisPrice = table.Column(nullable: false), + ShortMechPrice = table.Column(nullable: false), + ShortMultiColorPrice = table.Column(nullable: false), + ShortPermanentPrice = table.Column(nullable: false), + StartOfTheDay = table.Column(nullable: false), + WomenHalfCutPrice = table.Column(nullable: false), + WomenLongCutPrice = table.Column(nullable: false), + WomenShortCutPrice = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_BrusherProfile", x => x.UserId); + }); + 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_HairCutQuery_Activity_ActivityCode", + table: "HairCutQuery", + column: "ActivityCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_HairCutQuery_ApplicationUser_ClientId", + table: "HairCutQuery", + column: "ClientId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_HairCutQuery_PerformerProfile_PerformerId", + table: "HairCutQuery", + column: "PerformerId", + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_HairMultiCutQuery_Activity_ActivityCode", + table: "HairMultiCutQuery", + column: "ActivityCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_HairMultiCutQuery_ApplicationUser_ClientId", + table: "HairMultiCutQuery", + column: "ClientId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId", + table: "HairMultiCutQuery", + column: "PerformerId", + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_HairTaint_Color_ColorId", + table: "HairTaint", + column: "ColorId", + principalTable: "Color", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_DimissClicked_Notification_NotificationId", + table: "DimissClicked", + column: "NotificationId", + principalTable: "Notification", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_DimissClicked_ApplicationUser_UserId", + table: "DimissClicked", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_Instrumentation_Instrument_InstrumentId", + table: "Instrumentation", + column: "InstrumentId", + principalTable: "Instrument", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_CircleMember_Circle_CircleId", + table: "CircleMember", + column: "CircleId", + principalTable: "Circle", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_CircleMember_ApplicationUser_MemberId", + table: "CircleMember", + column: "MemberId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_PostTag_Blog_PostId", + table: "PostTag", + column: "PostId", + principalTable: "Blog", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_CommandForm_Activity_ActivityCode", + table: "CommandForm", + column: "ActivityCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_Location_OrganizationAddressId", + table: "PerformerProfile", + column: "OrganizationAddressId", + principalTable: "Location", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_ApplicationUser_PerformerId", + table: "PerformerProfile", + column: "PerformerId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_RdvQuery_Activity_ActivityCode", + table: "RdvQuery", + column: "ActivityCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_RdvQuery_ApplicationUser_ClientId", + table: "RdvQuery", + column: "ClientId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_RdvQuery_PerformerProfile_PerformerId", + table: "RdvQuery", + column: "PerformerId", + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_UserActivity_Activity_DoesCode", + table: "UserActivity", + column: "DoesCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_UserActivity_PerformerProfile_UserId", + table: "UserActivity", + column: "UserId", + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Cascade); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim_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_HairCutQuery_Activity_ActivityCode", table: "HairCutQuery"); + migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_ApplicationUser_ClientId", table: "HairCutQuery"); + migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_PerformerProfile_PerformerId", table: "HairCutQuery"); + migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_Activity_ActivityCode", table: "HairMultiCutQuery"); + migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_ApplicationUser_ClientId", table: "HairMultiCutQuery"); + migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId", table: "HairMultiCutQuery"); + migrationBuilder.DropForeignKey(name: "FK_HairTaint_Color_ColorId", table: "HairTaint"); + migrationBuilder.DropForeignKey(name: "FK_DimissClicked_Notification_NotificationId", table: "DimissClicked"); + migrationBuilder.DropForeignKey(name: "FK_DimissClicked_ApplicationUser_UserId", table: "DimissClicked"); + migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation"); + migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember"); + migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember"); + migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag"); + migrationBuilder.DropForeignKey(name: "FK_CommandForm_Activity_ActivityCode", table: "CommandForm"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile"); + migrationBuilder.DropForeignKey(name: "FK_RdvQuery_Activity_ActivityCode", table: "RdvQuery"); + migrationBuilder.DropForeignKey(name: "FK_RdvQuery_ApplicationUser_ClientId", table: "RdvQuery"); + migrationBuilder.DropForeignKey(name: "FK_RdvQuery_PerformerProfile_PerformerId", table: "RdvQuery"); + migrationBuilder.DropForeignKey(name: "FK_UserActivity_Activity_DoesCode", table: "UserActivity"); + migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity"); + migrationBuilder.DropTable("BrusherProfile"); + 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_HairCutQuery_Activity_ActivityCode", + table: "HairCutQuery", + column: "ActivityCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_HairCutQuery_ApplicationUser_ClientId", + table: "HairCutQuery", + column: "ClientId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_HairCutQuery_PerformerProfile_PerformerId", + table: "HairCutQuery", + column: "PerformerId", + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_HairMultiCutQuery_Activity_ActivityCode", + table: "HairMultiCutQuery", + column: "ActivityCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_HairMultiCutQuery_ApplicationUser_ClientId", + table: "HairMultiCutQuery", + column: "ClientId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId", + table: "HairMultiCutQuery", + column: "PerformerId", + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_HairTaint_Color_ColorId", + table: "HairTaint", + column: "ColorId", + principalTable: "Color", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_DimissClicked_Notification_NotificationId", + table: "DimissClicked", + column: "NotificationId", + principalTable: "Notification", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_DimissClicked_ApplicationUser_UserId", + table: "DimissClicked", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_Instrumentation_Instrument_InstrumentId", + table: "Instrumentation", + column: "InstrumentId", + principalTable: "Instrument", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_CircleMember_Circle_CircleId", + table: "CircleMember", + column: "CircleId", + principalTable: "Circle", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_CircleMember_ApplicationUser_MemberId", + table: "CircleMember", + column: "MemberId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_PostTag_Blog_PostId", + table: "PostTag", + column: "PostId", + principalTable: "Blog", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_CommandForm_Activity_ActivityCode", + table: "CommandForm", + column: "ActivityCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_Location_OrganizationAddressId", + table: "PerformerProfile", + column: "OrganizationAddressId", + principalTable: "Location", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_ApplicationUser_PerformerId", + table: "PerformerProfile", + column: "PerformerId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_RdvQuery_Activity_ActivityCode", + table: "RdvQuery", + column: "ActivityCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_RdvQuery_ApplicationUser_ClientId", + table: "RdvQuery", + column: "ClientId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_RdvQuery_PerformerProfile_PerformerId", + table: "RdvQuery", + column: "PerformerId", + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_UserActivity_Activity_DoesCode", + table: "UserActivity", + column: "DoesCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_UserActivity_PerformerProfile_UserId", + table: "UserActivity", + column: "UserId", + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Restrict); + } + } +} diff --git a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs index 3421caed..a6fcd8d4 100644 --- a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs @@ -441,6 +441,73 @@ namespace Yavsc.Migrations b.HasKey("Id"); }); + modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b => + { + b.Property("UserId"); + + b.Property("CarePrice"); + + b.Property("EndOfTheDay"); + + b.Property("HalfBalayagePrice"); + + b.Property("HalfBrushingPrice"); + + b.Property("HalfColorPrice"); + + b.Property("HalfDefrisPrice"); + + b.Property("HalfMechPrice"); + + b.Property("HalfMultiColorPrice"); + + b.Property("HalfPermanentPrice"); + + b.Property("KidCutPrice"); + + b.Property("LongBalayagePrice"); + + b.Property("LongBrushingPrice"); + + b.Property("LongColorPrice"); + + b.Property("LongDefrisPrice"); + + b.Property("LongMechPrice"); + + b.Property("LongMultiColorPrice"); + + b.Property("LongPermanentPrice"); + + b.Property("ManCutPrice"); + + b.Property("ShampooPrice"); + + b.Property("ShortBalayagePrice"); + + b.Property("ShortBrushingPrice"); + + b.Property("ShortColorPrice"); + + b.Property("ShortDefrisPrice"); + + b.Property("ShortMechPrice"); + + b.Property("ShortMultiColorPrice"); + + b.Property("ShortPermanentPrice"); + + b.Property("StartOfTheDay"); + + b.Property("WomenHalfCutPrice"); + + b.Property("WomenLongCutPrice"); + + b.Property("WomenShortCutPrice"); + + b.HasKey("UserId"); + }); + modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", b => { b.Property("Id") diff --git a/Yavsc/Models/ApplicationDbContext.cs b/Yavsc/Models/ApplicationDbContext.cs index 867f313b..6e533671 100644 --- a/Yavsc/Models/ApplicationDbContext.cs +++ b/Yavsc/Models/ApplicationDbContext.cs @@ -273,6 +273,8 @@ namespace Yavsc.Models public DbSet DimissClicked { get; set; } public DbSet HairPrestation { get; set; } + + public DbSet BrusherProfile { get; set; } } diff --git a/Yavsc/Models/Haircut/BrusherProfile.cs b/Yavsc/Models/Haircut/BrusherProfile.cs new file mode 100644 index 00000000..7871bc49 --- /dev/null +++ b/Yavsc/Models/Haircut/BrusherProfile.cs @@ -0,0 +1,118 @@ +using System.ComponentModel.DataAnnotations; +using YavscLib; + +namespace Yavsc.Models.Haircut +{ + public class BrusherProfile : ISpecializationSettings + { + [Key] + public string UserId + { + get; set; + } + + /// + /// StartOfTheDay In munutes + /// + /// + [Display(Name="Début de la journée")] + public int StartOfTheDay { get; set;} + /// + /// End Of The Day, In munutes + /// + /// + [Display(Name="Fin de la journée")] + public int EndOfTheDay { get; set;} + + [Display(Name="Coût d'une coupe femme cheveux longs")] + + public decimal WomenLongCutPrice { get; set; } + + [Display(Name="Coût d'une coupe femme cheveux mi-longs")] + public decimal WomenHalfCutPrice { get; set; } + + [Display(Name="Coût d'une coupe femme cheveux courts")] + public decimal WomenShortCutPrice { get; set; } + + [Display(Name="Coût d'une coupe homme")] + public decimal ManCutPrice { get; set; } + + [Display(Name="Coût d'une coupe enfant")] + public decimal KidCutPrice { get; set; } + + [Display(Name="Coût d'un brushing cheveux longs")] + public decimal LongBrushingPrice { get; set; } + + [Display(Name="Coût d'un brushing cheveux mi-longs")] + public decimal HalfBrushingPrice { get; set; } + + [Display(Name="Coût d'un brushing cheveux courts")] + public decimal ShortBrushingPrice { get; set; } + + [Display(Name="Coût du shamoing")] + + public decimal ShampooPrice { get; set; } + + [Display(Name="Coût du soin")] + + public decimal CarePrice { get; set; } + + [Display(Name="Coût d'une couleur cheveux longs")] + public decimal LongColorPrice { get; set; } + + [Display(Name="Coût d'une couleur cheveux mi-longs")] + public decimal HalfColorPrice { get; set; } + + [Display(Name="Coût d'une couleur cheveux courts")] + public decimal ShortColorPrice { get; set; } + + [Display(Name="Coût d'une couleur multiple cheveux longs")] + public decimal LongMultiColorPrice { get; set; } + + [Display(Name="Coût d'une couleur multiple cheveux mi-longs")] + public decimal HalfMultiColorPrice { get; set; } + + [Display(Name="Coût d'une couleur multiple cheveux courts")] + public decimal ShortMultiColorPrice { get; set; } + + [Display(Name="Coût d'une permanente cheveux longs")] + public decimal LongPermanentPrice { get; set; } + + [Display(Name="Coût d'une permanente cheveux mi-longs")] + public decimal HalfPermanentPrice { get; set; } + + [Display(Name="Coût d'une permanente cheveux courts")] + public decimal ShortPermanentPrice { get; set; } + + [Display(Name="Coût d'un défrisage cheveux longs")] + public decimal LongDefrisPrice { get; set; } + + [Display(Name="Coût d'un défrisage cheveux mi-longs")] + public decimal HalfDefrisPrice { get; set; } + + [Display(Name="Coût d'un défrisage cheveux courts")] + public decimal ShortDefrisPrice { get; set; } + + [Display(Name="Coût des mêches sur cheveux longs")] + + public decimal LongMechPrice { get; set; } + + [Display(Name="Coût des mêches sur cheveux mi-longs")] + public decimal HalfMechPrice { get; set; } + + [Display(Name="Coût des mêches sur cheveux courts")] + public decimal ShortMechPrice { get; set; } + + [Display(Name="Coût du balayage cheveux longs")] + + public decimal LongBalayagePrice { get; set; } + + [Display(Name="Coût du balayage cheveux mi-longs")] + public decimal HalfBalayagePrice { get; set; } + + [Display(Name="Coût du balayage cheveux courts")] + public decimal ShortBalayagePrice { get; set; } + + + } +} \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairCutGenders.cs b/Yavsc/Models/Haircut/HairCutGenders.cs index 9e6fb2a6..ef5120dc 100644 --- a/Yavsc/Models/Haircut/HairCutGenders.cs +++ b/Yavsc/Models/Haircut/HairCutGenders.cs @@ -1,9 +1,17 @@ +using System.ComponentModel.DataAnnotations; + namespace Yavsc.Models.Haircut { public enum HairCutGenders : int { - Kid = 1, + [Display(Name="Femme")] + Women, + + [Display(Name="Homme")] Man, - Women + + [Display(Name="Enfant")] + Kid + } } \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairLength.cs b/Yavsc/Models/Haircut/HairLength.cs index c187540f..063d4171 100644 --- a/Yavsc/Models/Haircut/HairLength.cs +++ b/Yavsc/Models/Haircut/HairLength.cs @@ -1,9 +1,16 @@ +using System.ComponentModel.DataAnnotations; + namespace Yavsc.Models.Haircut { public enum HairLength : int { - Short = 1, + [Display(Name="Mi-longs")] HalfLong, + + [Display(Name="Courts")] + Short = 1, + + [Display(Name="Longs")] Long } } \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairPrestation.cs b/Yavsc/Models/Haircut/HairPrestation.cs index 2ebd4d30..b7ca0abb 100644 --- a/Yavsc/Models/Haircut/HairPrestation.cs +++ b/Yavsc/Models/Haircut/HairPrestation.cs @@ -23,7 +23,7 @@ namespace Yavsc.Models.Haircut public HairDressings Dressing { get; set; } - [Display(Name="Technique")] + [Display(Name="Technique")] public HairTechnos Tech { get; set; } [Display(Name="Shampoing")] diff --git a/Yavsc/Models/Haircut/HairTechnos.cs b/Yavsc/Models/Haircut/HairTechnos.cs index d3333216..b47d6a38 100644 --- a/Yavsc/Models/Haircut/HairTechnos.cs +++ b/Yavsc/Models/Haircut/HairTechnos.cs @@ -5,6 +5,10 @@ namespace Yavsc.Models.Haircut public enum HairTechnos { + [Display(Name="Aucune technique spécifique")] + None, + + [Display(Name="Couleur")] Color, [Display(Name="Permantante")] diff --git a/Yavsc/Views/BrusherProfile/Delete.cshtml b/Yavsc/Views/BrusherProfile/Delete.cshtml new file mode 100644 index 00000000..11227d24 --- /dev/null +++ b/Yavsc/Views/BrusherProfile/Delete.cshtml @@ -0,0 +1,202 @@ +@model Yavsc.Models.Haircut.BrusherProfile + +@{ + ViewData["Title"] = "Delete"; +} + +

Delete

+ +

Are you sure you want to delete this?

+
+

BrusherProfile

+
+
+
+ @Html.DisplayNameFor(model => model.CarePrice) +
+
+ @Html.DisplayFor(model => model.CarePrice) +
+
+ @Html.DisplayNameFor(model => model.EndOfTheDay) +
+
+ @Html.DisplayFor(model => model.EndOfTheDay) +
+
+ @Html.DisplayNameFor(model => model.HalfBalayagePrice) +
+
+ @Html.DisplayFor(model => model.HalfBalayagePrice) +
+
+ @Html.DisplayNameFor(model => model.HalfBrushingPrice) +
+
+ @Html.DisplayFor(model => model.HalfBrushingPrice) +
+
+ @Html.DisplayNameFor(model => model.HalfColorPrice) +
+
+ @Html.DisplayFor(model => model.HalfColorPrice) +
+
+ @Html.DisplayNameFor(model => model.HalfDefrisPrice) +
+
+ @Html.DisplayFor(model => model.HalfDefrisPrice) +
+
+ @Html.DisplayNameFor(model => model.HalfMechPrice) +
+
+ @Html.DisplayFor(model => model.HalfMechPrice) +
+
+ @Html.DisplayNameFor(model => model.HalfMultiColorPrice) +
+
+ @Html.DisplayFor(model => model.HalfMultiColorPrice) +
+
+ @Html.DisplayNameFor(model => model.HalfPermanentPrice) +
+
+ @Html.DisplayFor(model => model.HalfPermanentPrice) +
+
+ @Html.DisplayNameFor(model => model.KidCutPrice) +
+
+ @Html.DisplayFor(model => model.KidCutPrice) +
+
+ @Html.DisplayNameFor(model => model.LongBalayagePrice) +
+
+ @Html.DisplayFor(model => model.LongBalayagePrice) +
+
+ @Html.DisplayNameFor(model => model.LongBrushingPrice) +
+
+ @Html.DisplayFor(model => model.LongBrushingPrice) +
+
+ @Html.DisplayNameFor(model => model.LongColorPrice) +
+
+ @Html.DisplayFor(model => model.LongColorPrice) +
+
+ @Html.DisplayNameFor(model => model.LongDefrisPrice) +
+
+ @Html.DisplayFor(model => model.LongDefrisPrice) +
+
+ @Html.DisplayNameFor(model => model.LongMechPrice) +
+
+ @Html.DisplayFor(model => model.LongMechPrice) +
+
+ @Html.DisplayNameFor(model => model.LongMultiColorPrice) +
+
+ @Html.DisplayFor(model => model.LongMultiColorPrice) +
+
+ @Html.DisplayNameFor(model => model.LongPermanentPrice) +
+
+ @Html.DisplayFor(model => model.LongPermanentPrice) +
+
+ @Html.DisplayNameFor(model => model.ManCutPrice) +
+
+ @Html.DisplayFor(model => model.ManCutPrice) +
+
+ @Html.DisplayNameFor(model => model.ShampooPrice) +
+
+ @Html.DisplayFor(model => model.ShampooPrice) +
+
+ @Html.DisplayNameFor(model => model.ShortBalayagePrice) +
+
+ @Html.DisplayFor(model => model.ShortBalayagePrice) +
+
+ @Html.DisplayNameFor(model => model.ShortBrushingPrice) +
+
+ @Html.DisplayFor(model => model.ShortBrushingPrice) +
+
+ @Html.DisplayNameFor(model => model.ShortColorPrice) +
+
+ @Html.DisplayFor(model => model.ShortColorPrice) +
+
+ @Html.DisplayNameFor(model => model.ShortDefrisPrice) +
+
+ @Html.DisplayFor(model => model.ShortDefrisPrice) +
+
+ @Html.DisplayNameFor(model => model.ShortMechPrice) +
+
+ @Html.DisplayFor(model => model.ShortMechPrice) +
+
+ @Html.DisplayNameFor(model => model.ShortMultiColorPrice) +
+
+ @Html.DisplayFor(model => model.ShortMultiColorPrice) +
+
+ @Html.DisplayNameFor(model => model.ShortPermanentPrice) +
+
+ @Html.DisplayFor(model => model.ShortPermanentPrice) +
+
+ @Html.DisplayNameFor(model => model.StartOfTheDay) +
+
+ @Html.DisplayFor(model => model.StartOfTheDay) +
+
+ @Html.DisplayNameFor(model => model.WomenHalfCutPrice) +
+
+ @Html.DisplayFor(model => model.WomenHalfCutPrice) +
+
+ @Html.DisplayNameFor(model => model.WomenLongCutPrice) +
+
+ @Html.DisplayFor(model => model.WomenLongCutPrice) +
+
+ @Html.DisplayNameFor(model => model.WomenShortCutPrice) +
+
+ @Html.DisplayFor(model => model.WomenShortCutPrice) +
+
+ +
+
+ | + @SR["Annuler"] +
+
+
diff --git a/Yavsc/Views/BrusherProfile/Edit.cshtml b/Yavsc/Views/BrusherProfile/Edit.cshtml new file mode 100644 index 00000000..15cd9de0 --- /dev/null +++ b/Yavsc/Views/BrusherProfile/Edit.cshtml @@ -0,0 +1,241 @@ +@model Yavsc.Models.Haircut.BrusherProfile + +@{ + ViewData["Title"] = "Edit"; +} + +

Edit

+ +
+
+

BrusherProfile

+
+
Disponibilité +
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
Grille tarifaire +
+ +
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+
+ +
+
+
+
+
+ +
+ Annuler +
+ diff --git a/Yavsc/Views/BrusherProfile/Index.cshtml b/Yavsc/Views/BrusherProfile/Index.cshtml new file mode 100644 index 00000000..f3a715e5 --- /dev/null +++ b/Yavsc/Views/BrusherProfile/Index.cshtml @@ -0,0 +1,205 @@ +@model Yavsc.Models.Haircut.BrusherProfile + +@{ + ViewData["Title"] = "Profile coiffeur"; +} + +

@ViewData["Title"]

+ +
+
+ @if (Model!=null) { +
+
+ @Html.DisplayNameFor(model => model.EndOfTheDay) +
+
+ @Html.Partial("HourFromMinutes", Model.EndOfTheDay) +
+
+ @Html.DisplayNameFor(model => model.StartOfTheDay) +
+
+ @Html.Partial("HourFromMinutes", Model.StartOfTheDay) +
+ +
+ @Html.DisplayNameFor(model => model.CarePrice) +
+
+ @Html.DisplayFor(model => model.CarePrice) +
+
+ @Html.DisplayNameFor(model => model.HalfBalayagePrice) +
+
+ @Html.DisplayFor(model => model.HalfBalayagePrice) +
+
+ @Html.DisplayNameFor(model => model.HalfBrushingPrice) +
+
+ @Html.DisplayFor(model => model.HalfBrushingPrice) +
+
+ @Html.DisplayNameFor(model => model.HalfColorPrice) +
+
+ @Html.DisplayFor(model => model.HalfColorPrice) +
+
+ @Html.DisplayNameFor(model => model.HalfDefrisPrice) +
+
+ @Html.DisplayFor(model => model.HalfDefrisPrice) +
+
+ @Html.DisplayNameFor(model => model.HalfMechPrice) +
+
+ @Html.DisplayFor(model => model.HalfMechPrice) +
+
+ @Html.DisplayNameFor(model => model.HalfMultiColorPrice) +
+
+ @Html.DisplayFor(model => model.HalfMultiColorPrice) +
+
+ @Html.DisplayNameFor(model => model.HalfPermanentPrice) +
+
+ @Html.DisplayFor(model => model.HalfPermanentPrice) +
+
+ @Html.DisplayNameFor(model => model.KidCutPrice) +
+
+ @Html.DisplayFor(model => model.KidCutPrice) +
+
+ @Html.DisplayNameFor(model => model.LongBalayagePrice) +
+
+ @Html.DisplayFor(model => model.LongBalayagePrice) +
+
+ @Html.DisplayNameFor(model => model.LongBrushingPrice) +
+
+ @Html.DisplayFor(model => model.LongBrushingPrice) +
+
+ @Html.DisplayNameFor(model => model.LongColorPrice) +
+
+ @Html.DisplayFor(model => model.LongColorPrice) +
+
+ @Html.DisplayNameFor(model => model.LongDefrisPrice) +
+
+ @Html.DisplayFor(model => model.LongDefrisPrice) +
+
+ @Html.DisplayNameFor(model => model.LongMechPrice) +
+
+ @Html.DisplayFor(model => model.LongMechPrice) +
+
+ @Html.DisplayNameFor(model => model.LongMultiColorPrice) +
+
+ @Html.DisplayFor(model => model.LongMultiColorPrice) +
+
+ @Html.DisplayNameFor(model => model.LongPermanentPrice) +
+
+ @Html.DisplayFor(model => model.LongPermanentPrice) +
+
+ @Html.DisplayNameFor(model => model.ManCutPrice) +
+
+ @Html.DisplayFor(model => model.ManCutPrice) +
+
+ @Html.DisplayNameFor(model => model.ShampooPrice) +
+
+ @Html.DisplayFor(model => model.ShampooPrice) +
+
+ @Html.DisplayNameFor(model => model.ShortBalayagePrice) +
+
+ @Html.DisplayFor(model => model.ShortBalayagePrice) +
+
+ @Html.DisplayNameFor(model => model.ShortBrushingPrice) +
+
+ @Html.DisplayFor(model => model.ShortBrushingPrice) +
+
+ @Html.DisplayNameFor(model => model.ShortColorPrice) +
+
+ @Html.DisplayFor(model => model.ShortColorPrice) +
+
+ @Html.DisplayNameFor(model => model.ShortDefrisPrice) +
+
+ @Html.DisplayFor(model => model.ShortDefrisPrice) +
+
+ @Html.DisplayNameFor(model => model.ShortMechPrice) +
+
+ @Html.DisplayFor(model => model.ShortMechPrice) +
+
+ @Html.DisplayNameFor(model => model.ShortMultiColorPrice) +
+
+ @Html.DisplayFor(model => model.ShortMultiColorPrice) +
+
+ @Html.DisplayNameFor(model => model.ShortPermanentPrice) +
+
+ @Html.DisplayFor(model => model.ShortPermanentPrice) +
+ +
+ @Html.DisplayNameFor(model => model.WomenHalfCutPrice) +
+
+ @Html.DisplayFor(model => model.WomenHalfCutPrice) +
+
+ @Html.DisplayNameFor(model => model.WomenLongCutPrice) +
+
+ @Html.DisplayFor(model => model.WomenLongCutPrice) +
+
+ @Html.DisplayNameFor(model => model.WomenShortCutPrice) +
+
+ @Html.DisplayFor(model => model.WomenShortCutPrice) +
+
} + else { + @SR["Aucun profile renseigné"] + } +
+

+ @SR["Edit"] + @if (Model!=null) { + @SR["Delete"] + } +

diff --git a/Yavsc/Views/Do/Details.cshtml b/Yavsc/Views/Do/Details.cshtml index 432bfa6a..b54804c4 100644 --- a/Yavsc/Views/Do/Details.cshtml +++ b/Yavsc/Views/Do/Details.cshtml @@ -13,7 +13,7 @@
@SR["Activity"]
@Html.DisplayFor(m=>m.Does) @if (ViewBag.HasConfigurableSettings) { - + [@SR["Manage"] @SR[Model.Does.SettingsClassName]] } diff --git a/Yavsc/Views/FrontOffice/HairCut.cshtml b/Yavsc/Views/FrontOffice/HairCut.cshtml index bed7bde9..7ef820e8 100644 --- a/Yavsc/Views/FrontOffice/HairCut.cshtml +++ b/Yavsc/Views/FrontOffice/HairCut.cshtml @@ -1,25 +1,31 @@ @model HairCutView @{ - ViewData["Title"] = "Book - " + (ViewBag.Activity?.Name ?? SR["Any"]); + ViewData["Title"] = $"{ViewBag.Activity.Name}: Votre commande"; } @ViewBag.Activity.Description @Html.DisplayFor(m=>m) -
+
-

HairPrestation

+

@ViewData["Title"]


-
-
- - -
+ +
+ + +
+
+
+ +
+ +
@@ -31,24 +37,31 @@
- +
- +
- +
- - + +
- +
- - + +@foreach (HairTaint color in ViewBag.HairTaints) { + + } + +
@@ -60,14 +73,14 @@
- -
- - +
+
+ + +
- - + diff --git a/Yavsc/Views/FrontOffice/Profiles.cshtml b/Yavsc/Views/FrontOffice/Profiles.cshtml index 88ed7d0e..888e734b 100644 --- a/Yavsc/Views/FrontOffice/Profiles.cshtml +++ b/Yavsc/Views/FrontOffice/Profiles.cshtml @@ -1,8 +1,9 @@ @model IEnumerable @{ - ViewData["Title"] = "Book - " + (ViewBag.Activity?.Name ?? SR["Any"]); + ViewData["Title"] = "Les profiles - " + (ViewBag.Activity?.Name ?? SR["Any"]); } +

@ViewData["Title"]

@ViewBag.Activity.Description @foreach (var profile in Model) { diff --git a/Yavsc/Views/Shared/HairTaint.cshtml b/Yavsc/Views/Shared/HairTaint.cshtml new file mode 100644 index 00000000..8c64e16a --- /dev/null +++ b/Yavsc/Views/Shared/HairTaint.cshtml @@ -0,0 +1,2 @@ +@model HairTaint +@Html.DisplayFor(m=>m.Color) (@Model.Brand) \ No newline at end of file diff --git a/Yavsc/Views/Shared/HourFromMinutes.cshtml b/Yavsc/Views/Shared/HourFromMinutes.cshtml new file mode 100644 index 00000000..319acb5b --- /dev/null +++ b/Yavsc/Views/Shared/HourFromMinutes.cshtml @@ -0,0 +1,2 @@ +@model int +@(Model/60):@(Model%60) \ No newline at end of file diff --git a/Yavsc/Views/_ViewImports.cshtml b/Yavsc/Views/_ViewImports.cshtml index e7b61490..325a5b1c 100755 --- a/Yavsc/Views/_ViewImports.cshtml +++ b/Yavsc/Views/_ViewImports.cshtml @@ -21,6 +21,7 @@ @using Yavsc.Models.Workflow; @using Yavsc.Models.Relationship @using Yavsc.Models.Drawing; +@using Yavsc.Models.Haircut; @using Yavsc.ViewModels.Account; @using Yavsc.ViewModels.Manage;