diff --git a/Yavsc/ApiControllers/BookQueryApiController.cs b/Yavsc/ApiControllers/BookQueryApiController.cs index 74d7f54e..96c67b86 100644 --- a/Yavsc/ApiControllers/BookQueryApiController.cs +++ b/Yavsc/ApiControllers/BookQueryApiController.cs @@ -34,7 +34,7 @@ namespace Yavsc.Controllers /// returned Ids must be lower than this value /// book queries [HttpGet] - public IEnumerable GetCommands(long maxId=long.MaxValue) + public IEnumerable GetCommands(long maxId=long.MaxValue) { var uid = User.GetUserId(); var now = DateTime.Now; @@ -42,7 +42,7 @@ namespace Yavsc.Controllers var result = _context.Commands.Include(c => c.Location). Include(c => c.Client).Where(c => c.PerformerId == uid && c.Id < maxId && c.EventDate > now && c.ValidationDate == null). - Select(c => new BookQueryProviderInfo + Select(c => new RdvQueryProviderInfo { Client = new ClientProviderInfo { UserName = c.Client.UserName, @@ -71,7 +71,7 @@ namespace Yavsc.Controllers } var uid = User.GetUserId(); - BookQuery bookQuery = _context.Commands.Where(c => c.ClientId == uid || c.PerformerId == uid).Single(m => m.Id == id); + RdvQuery bookQuery = _context.Commands.Where(c => c.ClientId == uid || c.PerformerId == uid).Single(m => m.Id == id); if (bookQuery == null) { @@ -83,7 +83,7 @@ namespace Yavsc.Controllers // PUT: api/BookQueryApi/5 [HttpPut("{id}")] - public IActionResult PutBookQuery(long id, [FromBody] BookQuery bookQuery) + public IActionResult PutBookQuery(long id, [FromBody] RdvQuery bookQuery) { if (!ModelState.IsValid) { @@ -121,7 +121,7 @@ namespace Yavsc.Controllers // POST: api/BookQueryApi [HttpPost] - public IActionResult PostBookQuery([FromBody] BookQuery bookQuery) + public IActionResult PostBookQuery([FromBody] RdvQuery bookQuery) { if (!ModelState.IsValid) { @@ -162,7 +162,7 @@ namespace Yavsc.Controllers return HttpBadRequest(ModelState); } var uid = User.GetUserId(); - BookQuery bookQuery = _context.Commands.Single(m => m.Id == id); + RdvQuery bookQuery = _context.Commands.Single(m => m.Id == id); if (bookQuery == null) { diff --git a/Yavsc/ApiControllers/EstimateApiController.cs b/Yavsc/ApiControllers/EstimateApiController.cs index 6ae3ce8c..f2d8b26b 100644 --- a/Yavsc/ApiControllers/EstimateApiController.cs +++ b/Yavsc/ApiControllers/EstimateApiController.cs @@ -126,7 +126,7 @@ namespace Yavsc.Controllers } } if (estimate.CommandId!=null) { - var query = _context.BookQueries.FirstOrDefault(q => q.Id == estimate.CommandId); + var query = _context.RdvQueries.FirstOrDefault(q => q.Id == estimate.CommandId); if (query == null || query.PerformerId!= uid) throw new InvalidOperationException(); query.ValidationDate = DateTime.Now; diff --git a/Yavsc/ApiControllers/PerformersApiController.cs b/Yavsc/ApiControllers/PerformersApiController.cs index 509cf97e..c08e3a50 100644 --- a/Yavsc/ApiControllers/PerformersApiController.cs +++ b/Yavsc/ApiControllers/PerformersApiController.cs @@ -51,4 +51,4 @@ namespace Yavsc.Controllers return new BadRequestObjectResult(ModelState); } } -} \ No newline at end of file +} diff --git a/Yavsc/ApiControllers/ProfileApiController.cs b/Yavsc/ApiControllers/ProfileApiController.cs index 77426afa..e7d21f9e 100644 --- a/Yavsc/ApiControllers/ProfileApiController.cs +++ b/Yavsc/ApiControllers/ProfileApiController.cs @@ -3,6 +3,10 @@ using Microsoft.AspNet.Mvc; namespace Yavsc.ApiControllers { using Models; + + /// + /// Base class for managing performers profiles + /// [Produces("application/json"),Route("api/profile")] public abstract class ProfileApiController : Controller { diff --git a/Yavsc/Controllers/CommandController.cs b/Yavsc/Controllers/CommandController.cs index a1d58653..0f494123 100644 --- a/Yavsc/Controllers/CommandController.cs +++ b/Yavsc/Controllers/CommandController.cs @@ -22,16 +22,16 @@ namespace Yavsc.Controllers [ServiceFilter(typeof(LanguageActionFilter))] public class CommandController : Controller { - private UserManager _userManager; - private ApplicationDbContext _context; - private GoogleAuthSettings _googleSettings; - private IGoogleCloudMessageSender _GCMSender; - private IEmailSender _emailSender; - private IStringLocalizer _localizer; - SiteSettings _siteSettings; - SmtpSettings _smtpSettings; + protected UserManager _userManager; + protected ApplicationDbContext _context; + protected GoogleAuthSettings _googleSettings; + protected IGoogleCloudMessageSender _GCMSender; + protected IEmailSender _emailSender; + protected IStringLocalizer _localizer; + protected SiteSettings _siteSettings; + protected SmtpSettings _smtpSettings; - private readonly ILogger _logger; + protected readonly ILogger _logger; public CommandController(ApplicationDbContext context, IOptions googleSettings, IGoogleCloudMessageSender GCMSender, UserManager userManager, @@ -57,7 +57,7 @@ namespace Yavsc.Controllers public IActionResult Index() { var uid = User.GetUserId(); - return View(_context.BookQueries + return View(_context.RdvQueries .Include(x => x.Client) .Include(x => x.PerformerProfile) .Include(x => x.PerformerProfile.Performer) @@ -74,7 +74,7 @@ namespace Yavsc.Controllers return HttpNotFound(); } - BookQuery command = _context.BookQueries + RdvQuery command = _context.RdvQueries .Include(x => x.Location) .Include(x => x.PerformerProfile) .Single(m => m.Id == id); @@ -113,7 +113,7 @@ namespace Yavsc.Controllers ViewBag.GoogleSettings = _googleSettings; var userid = User.GetUserId(); var user = _userManager.FindByIdAsync(userid).Result; - return View(new BookQuery(activityCode,new Location(),DateTime.Now.AddHours(4)) + return View(new RdvQuery(activityCode,new Location(),DateTime.Now.AddHours(4)) { PerformerProfile = pro, PerformerId = pro.PerformerId, @@ -126,7 +126,7 @@ namespace Yavsc.Controllers // POST: Command/Create [HttpPost, Authorize] [ValidateAntiForgeryToken] - public async Task Create(BookQuery command) + public async Task Create(RdvQuery command) { var uid = User.GetUserId(); @@ -161,7 +161,7 @@ namespace Yavsc.Controllers command.Location=existingLocation; } else _context.Attach(command.Location); - _context.BookQueries.Add(command, GraphBehavior.IncludeDependents); + _context.RdvQueries.Add(command, GraphBehavior.IncludeDependents); _context.SaveChanges(User.GetUserId()); var yaev = command.CreateEvent(_localizer); @@ -206,7 +206,7 @@ namespace Yavsc.Controllers return HttpNotFound(); } - BookQuery command = _context.BookQueries.Single(m => m.Id == id); + RdvQuery command = _context.RdvQueries.Single(m => m.Id == id); if (command == null) { return HttpNotFound(); @@ -217,7 +217,7 @@ namespace Yavsc.Controllers // POST: Command/Edit/5 [HttpPost] [ValidateAntiForgeryToken] - public IActionResult Edit(BookQuery command) + public IActionResult Edit(RdvQuery command) { if (ModelState.IsValid) { @@ -237,7 +237,7 @@ namespace Yavsc.Controllers return HttpNotFound(); } - BookQuery command = _context.BookQueries.Single(m => m.Id == id); + RdvQuery command = _context.RdvQueries.Single(m => m.Id == id); if (command == null) { return HttpNotFound(); @@ -251,8 +251,8 @@ namespace Yavsc.Controllers [ValidateAntiForgeryToken] public IActionResult DeleteConfirmed(long id) { - BookQuery command = _context.BookQueries.Single(m => m.Id == id); - _context.BookQueries.Remove(command); + RdvQuery command = _context.RdvQueries.Single(m => m.Id == id); + _context.RdvQueries.Remove(command); _context.SaveChanges(User.GetUserId()); return RedirectToAction("Index"); } diff --git a/Yavsc/Controllers/EstimateController.cs b/Yavsc/Controllers/EstimateController.cs index 288d914c..01184d20 100644 --- a/Yavsc/Controllers/EstimateController.cs +++ b/Yavsc/Controllers/EstimateController.cs @@ -81,7 +81,7 @@ namespace Yavsc.Controllers public IActionResult Create() { var uid = User.GetUserId(); - IQueryable queries = _context.BookQueries.Include(q=>q.Location).Where(bq=>bq.PerformerId == uid); + IQueryable queries = _context.RdvQueries.Include(q=>q.Location).Where(bq=>bq.PerformerId == uid); //.Select(bq=>new SelectListItem{ Text = bq.Client.UserName, Value = bq.Client.Id }); ViewBag.Clients = queries.Select(q=>q.Client).Distinct(); ViewBag.Queries = queries; @@ -103,7 +103,7 @@ namespace Yavsc.Controllers _context.Estimates .Add(estimate); _context.SaveChanges(User.GetUserId()); - var query = _context.BookQueries.FirstOrDefault( + var query = _context.RdvQueries.FirstOrDefault( q=>q.Id == estimate.CommandId ); var perfomerProfile = _context.Performers @@ -111,7 +111,7 @@ namespace Yavsc.Controllers perpr => perpr.Performer).FirstOrDefault( x=>x.PerformerId == query.PerformerId ); - var command = _context.BookQueries.FirstOrDefault( + var command = _context.RdvQueries.FirstOrDefault( cmd => cmd.Id == estimate.CommandId ); diff --git a/Yavsc/Controllers/FrontOfficeController.cs b/Yavsc/Controllers/FrontOfficeController.cs index 31635d73..c5cee49b 100644 --- a/Yavsc/Controllers/FrontOfficeController.cs +++ b/Yavsc/Controllers/FrontOfficeController.cs @@ -10,9 +10,13 @@ using System.Security.Claims; namespace Yavsc.Controllers { using Helpers; + using Microsoft.AspNet.Http; using Models; - using Models.Workflow; + using Newtonsoft.Json; using ViewModels.FrontOffice; + using Yavsc.Models.Haircut; + using Yavsc.ViewModels.Haircut; + public class FrontOfficeController : Controller { ApplicationDbContext _context; @@ -46,7 +50,7 @@ namespace Yavsc.Controllers return View(model); } - [Route("Profiles/{id?}"), HttpGet, AllowAnonymous] + [AllowAnonymous] public ActionResult Profiles(string id) { if (id == null) @@ -57,40 +61,28 @@ namespace Yavsc.Controllers var result = _context.ListPerformers(id); return View(result); } - - [Route("Profiles/{id}"), HttpPost, AllowAnonymous] - public ActionResult Profiles(BookQuery bookQuery) + + [AllowAnonymous] + public ActionResult HairCut(string id) { - if (ModelState.IsValid) - { - var pro = _context.Performers.Include( - pr => pr.Performer - ).FirstOrDefault( - x => x.PerformerId == bookQuery.PerformerId - ); - if (pro == null) - return HttpNotFound(); - // Let's create a command - if (bookQuery.Id == 0) - { - _context.BookQueries.Add(bookQuery); - } - else - { - _context.BookQueries.Update(bookQuery); - } - _context.SaveChanges(User.GetUserId()); - // TODO Send sys notifications & - // notify the user (make him a basket badge) - return View("Index"); + HairPrestation pPrestation=null; + var prestaJson = HttpContext.Session.GetString("HairCutPresta") ; + if (prestaJson!=null) { + pPrestation = JsonConvert.DeserializeObject(prestaJson); } - ViewBag.Activities = _context.ActivityItems(null); - return View("Profiles", _context.Performers.Include(p => p.Performer).Where - (p => p.Active).OrderBy( - x => x.MinDailyCost - )); + else pPrestation = new HairPrestation { + + }; + + ViewBag.Activity = _context.Activities.First(a => a.Code == id); + var result = new HairCutView { + HairBrushers = _context.ListPerformers(id), + Topic = pPrestation + } ; + return View(result); } + [Produces("text/x-tex"), Authorize, Route("estimate-{id}.tex")] public ViewResult EstimateTex(long id) { diff --git a/Yavsc/Controllers/HairCutCommandController.cs b/Yavsc/Controllers/HairCutCommandController.cs new file mode 100644 index 00000000..0de5571d --- /dev/null +++ b/Yavsc/Controllers/HairCutCommandController.cs @@ -0,0 +1,189 @@ +using System; +using System.Linq; +using System.Security.Claims; +using System.Threading.Tasks; +using Microsoft.AspNet.Authorization; +using Microsoft.AspNet.Identity; +using Microsoft.AspNet.Mvc; +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.Google.Messaging; +using Yavsc.Models.Haircut; +using Yavsc.Models.Relationship; +using Yavsc.Services; + +namespace Yavsc.Controllers +{ + public class HairCutCommandController : CommandController + { + public HairCutCommandController(ApplicationDbContext context, + IOptions googleSettings, + IGoogleCloudMessageSender GCMSender, + UserManager userManager, + IStringLocalizer localizer, + IEmailSender emailSender, + IOptions smtpSettings, + IOptions siteSettings, + ILoggerFactory loggerFactory) : base(context,googleSettings,GCMSender,userManager, + localizer,emailSender,smtpSettings,siteSettings,loggerFactory) + { + + } + + [HttpPost, Authorize] + [ValidateAntiForgeryToken] + public async Task CreateHairCutQuery(HairCutQuery command) + { + + + var uid = User.GetUserId(); + var prid = command.PerformerId; + if (string.IsNullOrWhiteSpace(uid) + || string.IsNullOrWhiteSpace(prid)) + throw new InvalidOperationException( + "This method needs a PerformerId" + ); + var pro = _context.Performers.Include( + u => u.Performer + ).Include(u => u.Performer.Devices) + .FirstOrDefault( + x => x.PerformerId == command.PerformerId + ); + var user = await _userManager.FindByIdAsync(uid); + command.Client = user; + command.ClientId = uid; + command.PerformerProfile = pro; + // FIXME Why!! + // ModelState.ClearValidationState("PerformerProfile.Avatar"); + // ModelState.ClearValidationState("Client.Avatar"); + // ModelState.ClearValidationState("ClientId"); + ModelState.MarkFieldSkipped("ClientId"); + + if (ModelState.IsValid) + { + var existingLocation = _context.Locations.FirstOrDefault( x=>x.Address == command.Location.Address + && x.Longitude == command.Location.Longitude && x.Latitude == command.Location.Latitude ); + + if (existingLocation!=null) { + command.Location=existingLocation; + } + else _context.Attach(command.Location); + + _context.HairCutQueries.Add(command, GraphBehavior.IncludeDependents); + _context.SaveChanges(User.GetUserId()); + + var yaev = command.CreateEvent(_localizer); + MessageWithPayloadResponse grep = null; + + if (pro.AcceptNotifications + && pro.AcceptPublicContact) + { + if (pro.Performer.Devices.Count > 0) { + var regids = command.PerformerProfile.Performer + .Devices.Select(d => d.GCMRegistrationId); + grep = await _GCMSender.NotifyHairCutQueryAsync(_googleSettings,regids,yaev); + } + // TODO setup a profile choice to allow notifications + // both on mailbox and mobile + // if (grep==null || grep.success<=0 || grep.failure>0) + ViewBag.GooglePayload=grep; + if (grep!=null) + _logger.LogWarning($"Performer: {command.PerformerProfile.Performer.UserName} success: {grep.success} failure: {grep.failure}"); + + await _emailSender.SendEmailAsync( + _siteSettings, _smtpSettings, + command.PerformerProfile.Performer.Email, + yaev.Topic+" "+yaev.Sender, + $"{yaev.Message}\r\n-- \r\n{yaev.Previsional}\r\n{yaev.EventDate}\r\n" + ); + } + ViewBag.Activity = _context.Activities.FirstOrDefault(a=>a.Code == command.ActivityCode); + ViewBag.GoogleSettings = _googleSettings; + return View("CommandConfirmation",command); + } + ViewBag.Activity = _context.Activities.FirstOrDefault(a=>a.Code == command.ActivityCode); + ViewBag.GoogleSettings = _googleSettings; + return View(command); + + } + + [HttpPost, Authorize] + [ValidateAntiForgeryToken] + public async Task CreateHairMultiCutQuery(HairMultiCutQuery command) + { + + var uid = User.GetUserId(); + var prid = command.PerformerId; + if (string.IsNullOrWhiteSpace(uid) + || string.IsNullOrWhiteSpace(prid)) + throw new InvalidOperationException( + "This method needs a PerformerId" + ); + var pro = _context.Performers.Include( + u => u.Performer + ).Include(u => u.Performer.Devices) + .FirstOrDefault( + x => x.PerformerId == command.PerformerId + ); + var user = await _userManager.FindByIdAsync(uid); + command.Client = user; + command.ClientId = uid; + command.PerformerProfile = pro; + // FIXME Why!! + // ModelState.ClearValidationState("PerformerProfile.Avatar"); + // ModelState.ClearValidationState("Client.Avatar"); + // ModelState.ClearValidationState("ClientId"); + ModelState.MarkFieldSkipped("ClientId"); + + if (ModelState.IsValid) + { + var existingLocation = _context.Locations.FirstOrDefault( x=>x.Address == command.Location.Address + && x.Longitude == command.Location.Longitude && x.Latitude == command.Location.Latitude ); + + if (existingLocation!=null) { + command.Location=existingLocation; + } + else _context.Attach(command.Location); + + _context.HairMultiCutQueries.Add(command, GraphBehavior.IncludeDependents); + _context.SaveChanges(User.GetUserId()); + + var yaev = command.CreateEvent(_localizer); + MessageWithPayloadResponse grep = null; + + if (pro.AcceptNotifications + && pro.AcceptPublicContact) + { + if (pro.Performer.Devices.Count > 0) { + var regids = command.PerformerProfile.Performer + .Devices.Select(d => d.GCMRegistrationId); + grep = await _GCMSender.NotifyHairCutQueryAsync(_googleSettings,regids,yaev); + } + // TODO setup a profile choice to allow notifications + // both on mailbox and mobile + // if (grep==null || grep.success<=0 || grep.failure>0) + ViewBag.GooglePayload=grep; + if (grep!=null) + _logger.LogWarning($"Performer: {command.PerformerProfile.Performer.UserName} success: {grep.success} failure: {grep.failure}"); + + await _emailSender.SendEmailAsync( + _siteSettings, _smtpSettings, + command.PerformerProfile.Performer.Email, + yaev.Topic+" "+yaev.Sender, + $"{yaev.Message}\r\n-- \r\n{yaev.Previsional}\r\n{yaev.EventDate}\r\n" + ); + } + ViewBag.Activity = _context.Activities.FirstOrDefault(a=>a.Code == command.ActivityCode); + ViewBag.GoogleSettings = _googleSettings; + return View("CommandConfirmation",command); + } + ViewBag.Activity = _context.Activities.FirstOrDefault(a=>a.Code == command.ActivityCode); + ViewBag.GoogleSettings = _googleSettings; + return View(command); + } + } +} \ No newline at end of file diff --git a/Yavsc/Controllers/HairPrestationsController.cs b/Yavsc/Controllers/HairPrestationsController.cs new file mode 100644 index 00000000..93e081bc --- /dev/null +++ b/Yavsc/Controllers/HairPrestationsController.cs @@ -0,0 +1,122 @@ +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNet.Mvc; +using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.Data.Entity; +using Yavsc.Models; +using Yavsc.Models.Haircut; + +namespace Yavsc.Controllers +{ + public class HairPrestationsController : Controller + { + private ApplicationDbContext _context; + + public HairPrestationsController(ApplicationDbContext context) + { + _context = context; + } + + // GET: HairPrestations + public async Task Index() + { + return View(await _context.HairPrestation.ToListAsync()); + } + + // GET: HairPrestations/Details/5 + public async Task Details(long? id) + { + if (id == null) + { + return HttpNotFound(); + } + + HairPrestation hairPrestation = await _context.HairPrestation.SingleAsync(m => m.Id == id); + if (hairPrestation == null) + { + return HttpNotFound(); + } + + return View(hairPrestation); + } + + // GET: HairPrestations/Create + public IActionResult Create() + { + return View(); + } + + // POST: HairPrestations/Create + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Create(HairPrestation hairPrestation) + { + if (ModelState.IsValid) + { + _context.HairPrestation.Add(hairPrestation); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + return View(hairPrestation); + } + + // GET: HairPrestations/Edit/5 + public async Task Edit(long? id) + { + if (id == null) + { + return HttpNotFound(); + } + + HairPrestation hairPrestation = await _context.HairPrestation.SingleAsync(m => m.Id == id); + if (hairPrestation == null) + { + return HttpNotFound(); + } + return View(hairPrestation); + } + + // POST: HairPrestations/Edit/5 + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Edit(HairPrestation hairPrestation) + { + if (ModelState.IsValid) + { + _context.Update(hairPrestation); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + return View(hairPrestation); + } + + // GET: HairPrestations/Delete/5 + [ActionName("Delete")] + public async Task Delete(long? id) + { + if (id == null) + { + return HttpNotFound(); + } + + HairPrestation hairPrestation = await _context.HairPrestation.SingleAsync(m => m.Id == id); + if (hairPrestation == null) + { + return HttpNotFound(); + } + + return View(hairPrestation); + } + + // POST: HairPrestations/Delete/5 + [HttpPost, ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(long id) + { + HairPrestation hairPrestation = await _context.HairPrestation.SingleAsync(m => m.Id == id); + _context.HairPrestation.Remove(hairPrestation); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + } +} diff --git a/Yavsc/Controllers/ManageController.cs b/Yavsc/Controllers/ManageController.cs index 34649b19..dd472b08 100644 --- a/Yavsc/Controllers/ManageController.cs +++ b/Yavsc/Controllers/ManageController.cs @@ -103,7 +103,7 @@ namespace Yavsc.Controllers UserName = user.UserName, PostsCounter = pc, Balance = user.AccountBalance, - ActiveCommandCount = _dbContext.BookQueries.Count(x => (x.ClientId == user.Id) && (x.EventDate > DateTime.Now)), + ActiveCommandCount = _dbContext.RdvQueries.Count(x => (x.ClientId == user.Id) && (x.EventDate > DateTime.Now)), HasDedicatedCalendar = !string.IsNullOrEmpty(user.DedicatedGoogleCalendar), Roles = await _userManager.GetRolesAsync(user), PostalAddress = user.PostalAddress?.Address, diff --git a/Yavsc/Helpers/EventHelpers.cs b/Yavsc/Helpers/EventHelpers.cs index 67c180e7..943c238c 100644 --- a/Yavsc/Helpers/EventHelpers.cs +++ b/Yavsc/Helpers/EventHelpers.cs @@ -4,13 +4,22 @@ namespace Yavsc.Helpers { using Models.Workflow; using Models.Messaging; + using Yavsc.Models.Haircut; + public static class EventHelpers { - public static BookQueryEvent CreateEvent(this BookQuery query, + public static RdvQueryEvent CreateEvent(this RdvQuery query, IStringLocalizer SR) { - var yaev = new BookQueryEvent - { + var yaev = new RdvQueryEvent + { + Sender = query.ClientId, + Message = string.Format(SR["RdvToPerf"], + query.Client.UserName, + query.EventDate.ToString("dddd dd/MM/yyyy à HH:mm"), + query.Location.Address, + query.ActivityCode)+ + "\n"+query.Reason, Client = new ClientProviderInfo {  UserName = query.Client.UserName , UserId = query.ClientId, @@ -24,6 +33,54 @@ namespace Yavsc.Helpers }; return yaev; } - + public static HairCutQueryEvent CreateEvent(this HairCutQuery query, + IStringLocalizer SR) + { + var yaev = new HairCutQueryEvent + { + Sender = query.ClientId, + Message = string.Format(SR["RdvToPerf"], + query.Client.UserName, + query.EventDate.ToString("dddd dd/MM/yyyy à HH:mm"), + query.Location.Address, + query.ActivityCode), + Client = new ClientProviderInfo {  + UserName = query.Client.UserName , + UserId = query.ClientId, + Avatar = query.Client.Avatar } , + Previsional = query.Previsional, + EventDate = query.EventDate, + Location = query.Location, + Id = query.Id, + Reason = "Coupe particulier", + ActivityCode = query.ActivityCode + }; + return yaev; + } + + public static HairCutQueryEvent CreateEvent(this HairMultiCutQuery query, + IStringLocalizer SR) + { + var yaev = new HairCutQueryEvent + { + Sender = query.ClientId, + Message = string.Format(SR["RdvToPerf"], + query.Client.UserName, + query.EventDate.ToString("dddd dd/MM/yyyy à HH:mm"), + query.Location.Address, + query.ActivityCode), + Client = new ClientProviderInfo {  + UserName = query.Client.UserName , + UserId = query.ClientId, + Avatar = query.Client.Avatar } , + Previsional = query.Previsional, + EventDate = query.EventDate, + Location = query.Location, + Id = query.Id, + Reason = "Commande groupée!", + ActivityCode = query.ActivityCode + }; + return yaev; + } } } diff --git a/Yavsc/Migrations/20170227151759_hairPrestations.Designer.cs b/Yavsc/Migrations/20170227151759_hairPrestations.Designer.cs new file mode 100644 index 00000000..b0287338 --- /dev/null +++ b/Yavsc/Migrations/20170227151759_hairPrestations.Designer.cs @@ -0,0 +1,1329 @@ +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("20170227151759_hairPrestations")] + partial class hairPrestations + { + 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.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/20170227151759_hairPrestations.cs b/Yavsc/Migrations/20170227151759_hairPrestations.cs new file mode 100644 index 00000000..3ba54b9e --- /dev/null +++ b/Yavsc/Migrations/20170227151759_hairPrestations.cs @@ -0,0 +1,745 @@ +using System; +using System.Collections.Generic; +using Microsoft.Data.Entity.Migrations; + +namespace Yavsc.Migrations +{ + public partial class hairPrestations : 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_BaseProduct_ArticleId", table: "CommandLine"); + migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine"); + migrationBuilder.DropForeignKey(name: "FK_Estimate_ApplicationUser_ClientId", table: "Estimate"); + migrationBuilder.DropForeignKey(name: "FK_Estimate_BookQuery_CommandId", table: "Estimate"); + migrationBuilder.DropForeignKey(name: "FK_Estimate_PerformerProfile_OwnerId", table: "Estimate"); + 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_UserActivity_Activity_DoesCode", table: "UserActivity"); + migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity"); + migrationBuilder.DropColumn(name: "ArticleId", table: "CommandLine"); + migrationBuilder.DropTable("BaseProduct"); + migrationBuilder.DropTable("BookQuery"); + // les id de requete existant venaient d'une table nomée "BookQuery" + // qui n'existe plus. + migrationBuilder.Sql("DELETE FROM \"Estimate\""); + migrationBuilder.Sql("DELETE FROM \"CommandLine\""); + migrationBuilder.CreateTable( + name: "HairMultiCutQuery", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:Serial", true), + ActivityCode = table.Column(nullable: false), + ClientId = table.Column(nullable: false), + DateCreated = table.Column(nullable: false), + DateModified = table.Column(nullable: false), + EventDate = table.Column(nullable: false), + LocationId = table.Column(nullable: true), + PerformerId = table.Column(nullable: false), + Previsional = table.Column(nullable: true), + Status = table.Column(nullable: false), + UserCreated = table.Column(nullable: true), + UserModified = table.Column(nullable: true), + ValidationDate = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_HairMultiCutQuery", x => x.Id); + table.ForeignKey( + name: "FK_HairMultiCutQuery_Activity_ActivityCode", + column: x => x.ActivityCode, + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_HairMultiCutQuery_ApplicationUser_ClientId", + column: x => x.ClientId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_HairMultiCutQuery_Location_LocationId", + column: x => x.LocationId, + principalTable: "Location", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId", + column: x => x.PerformerId, + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( + name: "Product", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:Serial", true), + Depth = table.Column(nullable: false), + Description = table.Column(nullable: true), + Height = table.Column(nullable: false), + Name = table.Column(nullable: true), + Price = table.Column(nullable: true), + Public = table.Column(nullable: false), + Weight = table.Column(nullable: false), + Width = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Product", x => x.Id); + }); + migrationBuilder.CreateTable( + name: "RdvQuery", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:Serial", true), + ActivityCode = table.Column(nullable: false), + ClientId = table.Column(nullable: false), + DateCreated = table.Column(nullable: false), + DateModified = table.Column(nullable: false), + EventDate = table.Column(nullable: false), + LocationId = table.Column(nullable: true), + LocationTypeId = table.Column(nullable: true), + PerformerId = table.Column(nullable: false), + Previsional = table.Column(nullable: true), + Reason = table.Column(nullable: true), + Status = table.Column(nullable: false), + UserCreated = table.Column(nullable: true), + UserModified = table.Column(nullable: true), + ValidationDate = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_RdvQuery", x => x.Id); + table.ForeignKey( + name: "FK_RdvQuery_Activity_ActivityCode", + column: x => x.ActivityCode, + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_RdvQuery_ApplicationUser_ClientId", + column: x => x.ClientId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_RdvQuery_Location_LocationId", + column: x => x.LocationId, + principalTable: "Location", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_RdvQuery_LocationType_LocationTypeId", + column: x => x.LocationTypeId, + principalTable: "LocationType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_RdvQuery_PerformerProfile_PerformerId", + column: x => x.PerformerId, + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( + name: "HairPrestation", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:Serial", true), + Cares = table.Column(nullable: false), + Cut = table.Column(nullable: false), + Dressing = table.Column(nullable: false), + Gender = table.Column(nullable: false), + HairMultiCutQueryId = table.Column(nullable: true), + Length = table.Column(nullable: false), + Shampoo = table.Column(nullable: false), + Tech = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_HairPrestation", x => x.Id); + table.ForeignKey( + name: "FK_HairPrestation_HairMultiCutQuery_HairMultiCutQueryId", + column: x => x.HairMultiCutQueryId, + principalTable: "HairMultiCutQuery", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( + name: "HairCutQuery", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:Serial", true), + ActivityCode = table.Column(nullable: false), + ClientId = table.Column(nullable: false), + DateCreated = table.Column(nullable: false), + DateModified = table.Column(nullable: false), + EventDate = table.Column(nullable: false), + LocationId = table.Column(nullable: true), + PerformerId = table.Column(nullable: false), + PrestationId = table.Column(nullable: true), + Previsional = table.Column(nullable: true), + Status = table.Column(nullable: false), + UserCreated = table.Column(nullable: true), + UserModified = table.Column(nullable: true), + ValidationDate = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_HairCutQuery", x => x.Id); + table.ForeignKey( + name: "FK_HairCutQuery_Activity_ActivityCode", + column: x => x.ActivityCode, + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_HairCutQuery_ApplicationUser_ClientId", + column: x => x.ClientId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_HairCutQuery_Location_LocationId", + column: x => x.LocationId, + principalTable: "Location", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_HairCutQuery_PerformerProfile_PerformerId", + column: x => x.PerformerId, + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_HairCutQuery_HairPrestation_PrestationId", + column: x => x.PrestationId, + principalTable: "HairPrestation", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.AddColumn( + name: "HairPrestationId", + table: "HairTaint", + nullable: true); + 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_RdvQuery_CommandId", + table: "Estimate", + column: "CommandId", + principalTable: "RdvQuery", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_Estimate_PerformerProfile_OwnerId", + table: "Estimate", + column: "OwnerId", + 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_HairTaint_HairPrestation_HairPrestationId", + table: "HairTaint", + column: "HairPrestationId", + principalTable: "HairPrestation", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_DimissClicked_Notification_NotificationId", + table: "DimissClicked", + column: "NotificationId", + principalTable: "Notification", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_DimissClicked_ApplicationUser_UserId", + table: "DimissClicked", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_Instrumentation_Instrument_InstrumentId", + table: "Instrumentation", + column: "InstrumentId", + principalTable: "Instrument", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_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_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_RdvQuery_CommandId", table: "Estimate"); + migrationBuilder.DropForeignKey(name: "FK_Estimate_PerformerProfile_OwnerId", table: "Estimate"); + migrationBuilder.DropForeignKey(name: "FK_HairTaint_Color_ColorId", table: "HairTaint"); + migrationBuilder.DropForeignKey(name: "FK_HairTaint_HairPrestation_HairPrestationId", 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_UserActivity_Activity_DoesCode", table: "UserActivity"); + migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity"); + migrationBuilder.DropColumn(name: "HairPrestationId", table: "HairTaint"); + migrationBuilder.DropTable("HairCutQuery"); + migrationBuilder.DropTable("Product"); + migrationBuilder.DropTable("RdvQuery"); + migrationBuilder.DropTable("HairPrestation"); + migrationBuilder.DropTable("HairMultiCutQuery"); + migrationBuilder.CreateTable( + name: "BaseProduct", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:Serial", true), + Description = table.Column(nullable: true), + Discriminator = table.Column(nullable: false), + Name = table.Column(nullable: true), + Public = table.Column(nullable: false), + Depth = table.Column(nullable: true), + Height = table.Column(nullable: true), + Price = table.Column(nullable: true), + Weight = table.Column(nullable: true), + Width = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_BaseProduct", x => x.Id); + }); + migrationBuilder.CreateTable( + name: "BookQuery", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:Serial", true), + ActivityCode = table.Column(nullable: false), + ClientId = table.Column(nullable: false), + DateCreated = table.Column(nullable: false), + DateModified = table.Column(nullable: false), + EventDate = table.Column(nullable: false), + LocationId = table.Column(nullable: true), + LocationTypeId = table.Column(nullable: true), + PerformerId = table.Column(nullable: false), + Previsional = table.Column(nullable: true), + Reason = table.Column(nullable: true), + Status = table.Column(nullable: false), + UserCreated = table.Column(nullable: true), + UserModified = table.Column(nullable: true), + ValidationDate = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_BookQuery", x => x.Id); + table.ForeignKey( + name: "FK_BookQuery_Activity_ActivityCode", + column: x => x.ActivityCode, + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_BookQuery_ApplicationUser_ClientId", + column: x => x.ClientId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_BookQuery_Location_LocationId", + column: x => x.LocationId, + principalTable: "Location", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_BookQuery_LocationType_LocationTypeId", + column: x => x.LocationTypeId, + principalTable: "LocationType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_BookQuery_PerformerProfile_PerformerId", + column: x => x.PerformerId, + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.AddColumn( + name: "ArticleId", + table: "CommandLine", + nullable: true); + 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_BaseProduct_ArticleId", + table: "CommandLine", + column: "ArticleId", + principalTable: "BaseProduct", + principalColumn: "Id", + 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_BookQuery_CommandId", + table: "Estimate", + column: "CommandId", + principalTable: "BookQuery", + 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_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_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 811d6f93..3421caed 100644 --- a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1,6 +1,8 @@ using System; using Microsoft.Data.Entity; using Microsoft.Data.Entity.Infrastructure; +using Microsoft.Data.Entity.Metadata; +using Microsoft.Data.Entity.Migrations; using Yavsc.Models; namespace Yavsc.Migrations @@ -306,8 +308,6 @@ namespace Yavsc.Migrations b.Property("Id") .ValueGeneratedOnAdd(); - b.Property("ArticleId"); - b.Property("Count"); b.Property("Description") @@ -441,6 +441,102 @@ namespace Yavsc.Migrations b.HasKey("Id"); }); + 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") @@ -450,6 +546,8 @@ namespace Yavsc.Migrations b.Property("ColorId"); + b.Property("HairPrestationId"); + b.HasKey("Id"); }); @@ -475,25 +573,28 @@ namespace Yavsc.Migrations b.HasKey("DeviceId"); }); - modelBuilder.Entity("Yavsc.Models.Market.BaseProduct", b => + modelBuilder.Entity("Yavsc.Models.Market.Product", b => { b.Property("Id") .ValueGeneratedOnAdd(); + b.Property("Depth"); + b.Property("Description"); - b.Property("Discriminator") - .IsRequired(); + b.Property("Height"); b.Property("Name"); + b.Property("Price"); + b.Property("Public"); + b.Property("Weight"); + + b.Property("Width"); + b.HasKey("Id"); - - b.HasAnnotation("Relational:DiscriminatorProperty", "Discriminator"); - - b.HasAnnotation("Relational:DiscriminatorValue", "BaseProduct"); }); modelBuilder.Entity("Yavsc.Models.Market.Service", b => @@ -773,45 +874,6 @@ 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("Status"); - - b.Property("UserCreated"); - - b.Property("UserModified"); - - b.Property("ValidationDate"); - - b.HasKey("Id"); - }); - modelBuilder.Entity("Yavsc.Models.Workflow.CommandForm", b => { b.Property("Id") @@ -877,6 +939,45 @@ namespace Yavsc.Migrations 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"); @@ -888,23 +989,6 @@ namespace Yavsc.Migrations 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") @@ -982,10 +1066,6 @@ namespace Yavsc.Migrations 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"); @@ -1001,7 +1081,7 @@ namespace Yavsc.Migrations .WithMany() .HasForeignKey("ClientId"); - b.HasOne("Yavsc.Models.Workflow.BookQuery") + b.HasOne("Yavsc.Models.Workflow.RdvQuery") .WithMany() .HasForeignKey("CommandId"); @@ -1024,11 +1104,64 @@ namespace Yavsc.Migrations .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 => @@ -1124,29 +1257,6 @@ 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") @@ -1180,6 +1290,29 @@ namespace Yavsc.Migrations .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") diff --git a/Yavsc/Models/ApplicationDbContext.cs b/Yavsc/Models/ApplicationDbContext.cs index 59fc70d2..867f313b 100644 --- a/Yavsc/Models/ApplicationDbContext.cs +++ b/Yavsc/Models/ApplicationDbContext.cs @@ -91,13 +91,15 @@ namespace Yavsc.Models /// on his profile). /// /// - public DbSet Commands { get; set; } + public DbSet Commands { get; set; } /// /// Special commands, talking about /// a given place and date. /// /// - public DbSet BookQueries { get; set; } + public DbSet RdvQueries { get; set; } + public DbSet HairCutQueries { get; set; } + public DbSet HairMultiCutQueries { get; set; } public DbSet Performers { get; set; } public DbSet Estimates { get; set; } public DbSet BankStatus { get; set; } @@ -269,6 +271,8 @@ namespace Yavsc.Models public DbSet Notification { get; set; } public DbSet DimissClicked { get; set; } + + public DbSet HairPrestation { get; set; } } diff --git a/Yavsc/Models/Billing/CommandLine.cs b/Yavsc/Models/Billing/CommandLine.cs index cd55e5ce..f7df4b13 100644 --- a/Yavsc/Models/Billing/CommandLine.cs +++ b/Yavsc/Models/Billing/CommandLine.cs @@ -2,7 +2,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Newtonsoft.Json; -using Yavsc.Models.Market; namespace Yavsc.Models.Billing { @@ -14,7 +13,7 @@ namespace Yavsc.Models.Billing [Required,MaxLength(512)] public string Description { get; set; } - public BaseProduct Article { get; set; } + public int Count { get; set; } [DisplayFormat(DataFormatString="{0:C}")] diff --git a/Yavsc/Models/Billing/Estimate.cs b/Yavsc/Models/Billing/Estimate.cs index 01e5d906..8cfa34cf 100644 --- a/Yavsc/Models/Billing/Estimate.cs +++ b/Yavsc/Models/Billing/Estimate.cs @@ -24,7 +24,7 @@ namespace Yavsc.Models.Billing /// /// [ForeignKey("CommandId"),JsonIgnore] - public BookQuery Query { get; set; } + public RdvQuery Query { get; set; } public string Description { get; set; } public string Title { get; set; } diff --git a/Yavsc/Models/Billing/NominativeServiceCommand.cs b/Yavsc/Models/Billing/NominativeServiceCommand.cs index c11b22bb..878dc560 100644 --- a/Yavsc/Models/Billing/NominativeServiceCommand.cs +++ b/Yavsc/Models/Billing/NominativeServiceCommand.cs @@ -5,11 +5,12 @@ using System.ComponentModel.DataAnnotations.Schema; namespace Yavsc.Models.Billing { -using Interfaces.Workflow; -using Workflow; -using YavscLib; + using Interfaces.Workflow; + using Newtonsoft.Json; + using Workflow; + using YavscLib; - public abstract class NominativeServiceCommand : IBaseTrackedEntity, IQuery + public abstract class NominativeServiceCommand : IBaseTrackedEntity, IQuery { public DateTime DateCreated { @@ -60,6 +61,10 @@ using YavscLib; /// /// + [Required] + public string ActivityCode { get; set; } + [ForeignKey("ActivityCode"),JsonIgnore] + public virtual Activity Context  { get; set ; } } } \ No newline at end of file diff --git a/Yavsc/Models/Calendar/ICalendarManager.cs b/Yavsc/Models/Calendar/ICalendarManager.cs index 5a5f2799..cf60bd13 100644 --- a/Yavsc/Models/Calendar/ICalendarManager.cs +++ b/Yavsc/Models/Calendar/ICalendarManager.cs @@ -35,7 +35,7 @@ namespace Yavsc.Models.Calendar /// The free dates. /// Username. /// Req. - IFreeDateSet GetFreeDates(string username, BookQuery req); + IFreeDateSet GetFreeDates(string username, RdvQuery req); /// /// Book the specified username and ev. /// diff --git a/Yavsc/Models/Haircut/HairCutQuery.cs b/Yavsc/Models/Haircut/HairCutQuery.cs index 57bd3a6a..c4960ffd 100644 --- a/Yavsc/Models/Haircut/HairCutQuery.cs +++ b/Yavsc/Models/Haircut/HairCutQuery.cs @@ -1,7 +1,9 @@ +using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Yavsc.Models.Billing; +using Yavsc.Models.Relationship; namespace Yavsc.Models.Haircut { @@ -9,6 +11,14 @@ namespace Yavsc.Models.Haircut { [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)] public long Id { get; set; } - HairPrestation [] Prestations { get; set; } + HairPrestation Prestation { get; set; } + + public Location Location { get; set; } + + public DateTime EventDate + { + get; + set; + } } } \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairCutQueryEvent.cs b/Yavsc/Models/Haircut/HairCutQueryEvent.cs index ccb12992..04d18ed2 100644 --- a/Yavsc/Models/Haircut/HairCutQueryEvent.cs +++ b/Yavsc/Models/Haircut/HairCutQueryEvent.cs @@ -2,7 +2,7 @@ using Yavsc.Interfaces.Workflow; namespace Yavsc.Models.Haircut { - public class HairCutQueryEvent : BookQueryProviderInfo, IEvent + public class HairCutQueryEvent : RdvQueryProviderInfo, IEvent { public HairCutQueryEvent() { diff --git a/Yavsc/Models/Haircut/HairDressings.cs b/Yavsc/Models/Haircut/HairDressings.cs index 7f3369a4..02fa17ed 100644 --- a/Yavsc/Models/Haircut/HairDressings.cs +++ b/Yavsc/Models/Haircut/HairDressings.cs @@ -1,7 +1,14 @@ +using System.ComponentModel.DataAnnotations; + namespace Yavsc.Models.Haircut { public enum HairDressings { + + Coiffage, + Brushing, + + [Display(Name="Mise en plis")] Folding } } \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairMultiCutQuery.cs b/Yavsc/Models/Haircut/HairMultiCutQuery.cs new file mode 100644 index 00000000..35e958fc --- /dev/null +++ b/Yavsc/Models/Haircut/HairMultiCutQuery.cs @@ -0,0 +1,23 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Yavsc.Models.Billing; +using Yavsc.Models.Relationship; + +namespace Yavsc.Models.Haircut +{ + public class HairMultiCutQuery : NominativeServiceCommand + { + [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long Id { get; set; } + HairPrestation [] Prestations { get; set; } + + public Location Location { get; set; } + + public DateTime EventDate + { + get; + set; + } + } +} \ No newline at end of file diff --git a/Yavsc/Models/Haircut/HairPrestation.cs b/Yavsc/Models/Haircut/HairPrestation.cs index 66ecac62..2ebd4d30 100644 --- a/Yavsc/Models/Haircut/HairPrestation.cs +++ b/Yavsc/Models/Haircut/HairPrestation.cs @@ -1,18 +1,39 @@ -using Yavsc.Models.Market; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; namespace Yavsc.Models.Haircut { - public class HairPrestation : Service + public class HairPrestation { + [Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long Id { get; set; } + + [Display(Name="Longueur de cheveux")] public HairLength Length { get; set; } + + [Display(Name="Pour qui")] public HairCutGenders Gender { get; set; } + + [Display(Name="Coupe")] public bool Cut { get; set; } + [Display(Name="Coiffage")] + public HairDressings Dressing { get; set; } + + [Display(Name="Technique")] public HairTechnos Tech { get; set; } + + [Display(Name="Shampoing")] public bool Shampoo { get; set; } - public HairTaint[] Taints { get; set; } + + [Display(Name="Couleurs")] + + public virtual List Taints { get; set; } + + [Display(Name="Soins")] public bool Cares { get; set; } } diff --git a/Yavsc/Models/Haircut/HairTechnos.cs b/Yavsc/Models/Haircut/HairTechnos.cs index 39af80d7..d3333216 100644 --- a/Yavsc/Models/Haircut/HairTechnos.cs +++ b/Yavsc/Models/Haircut/HairTechnos.cs @@ -1,13 +1,18 @@ +using System.ComponentModel.DataAnnotations; + namespace Yavsc.Models.Haircut { public enum HairTechnos { Color, + + [Display(Name="Permantante")] Permanent, + [Display(Name="Défrisage")] Defris, + [Display(Name="Mêches")] Mech, - Balayage, - TyAndDie + Balayage } -} \ No newline at end of file +} diff --git a/Yavsc/Models/Market/BaseProduct.cs b/Yavsc/Models/Market/BaseProduct.cs index cd6b2525..2efacfe8 100644 --- a/Yavsc/Models/Market/BaseProduct.cs +++ b/Yavsc/Models/Market/BaseProduct.cs @@ -1,16 +1,10 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; + namespace Yavsc.Models.Market { - public partial class BaseProduct + public class BaseProduct { - /// - /// An unique product identifier. - /// - /// - [Key(),DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public long Id { get; set; } + public string Name { get; set; } /// /// A contractual description for this product. diff --git a/Yavsc/Models/Market/Product.cs b/Yavsc/Models/Market/Product.cs index e616ffe0..ae8f2919 100644 --- a/Yavsc/Models/Market/Product.cs +++ b/Yavsc/Models/Market/Product.cs @@ -1,9 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + namespace Yavsc.Models.Market { - public partial class Product : BaseProduct + public class Product : BaseProduct { + [Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long Id { get; set; } + /// /// Weight in gram /// diff --git a/Yavsc/Models/Market/Service.cs b/Yavsc/Models/Market/Service.cs index 9e77596e..d4ee08d7 100644 --- a/Yavsc/Models/Market/Service.cs +++ b/Yavsc/Models/Market/Service.cs @@ -2,11 +2,19 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; namespace Yavsc.Models.Market { + using System.ComponentModel.DataAnnotations; using Billing; using Workflow; - public partial class Service : BaseProduct + public class Service : BaseProduct { + /// + /// An unique product identifier. + /// + /// + [Key(),DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long Id { get; set; } + public string ContextId { get; set; } [ForeignKey("ContextId")] public virtual Activity Context { get; set; } diff --git a/Yavsc/Models/Messaging/BookQueryEvent.cs b/Yavsc/Models/Messaging/RdvQueryEvent.cs similarity index 92% rename from Yavsc/Models/Messaging/BookQueryEvent.cs rename to Yavsc/Models/Messaging/RdvQueryEvent.cs index 2e4a4bb5..234529e6 100644 --- a/Yavsc/Models/Messaging/BookQueryEvent.cs +++ b/Yavsc/Models/Messaging/RdvQueryEvent.cs @@ -25,9 +25,9 @@ using Interfaces.Workflow; -public class BookQueryEvent: BookQueryProviderInfo, IEvent +public class RdvQueryEvent: RdvQueryProviderInfo, IEvent { - public BookQueryEvent() + public RdvQueryEvent() { Topic = "BookQuery"; } diff --git a/Yavsc/Models/Messaging/BookQueryProviderInfo.cs b/Yavsc/Models/Messaging/RdvQueryProviderInfo.cs similarity index 92% rename from Yavsc/Models/Messaging/BookQueryProviderInfo.cs rename to Yavsc/Models/Messaging/RdvQueryProviderInfo.cs index 72859999..55dd2f43 100644 --- a/Yavsc/Models/Messaging/BookQueryProviderInfo.cs +++ b/Yavsc/Models/Messaging/RdvQueryProviderInfo.cs @@ -5,7 +5,7 @@ namespace Yavsc.Models using Models.Messaging; using Models.Relationship; - public class BookQueryProviderInfo + public class RdvQueryProviderInfo { public ClientProviderInfo Client { get; set; } public Location Location { get; set; } diff --git a/Yavsc/Models/Workflow/BookQuery.cs b/Yavsc/Models/Workflow/RdvQuery.cs similarity index 73% rename from Yavsc/Models/Workflow/BookQuery.cs rename to Yavsc/Models/Workflow/RdvQuery.cs index c27890db..4b3de2e6 100644 --- a/Yavsc/Models/Workflow/BookQuery.cs +++ b/Yavsc/Models/Workflow/RdvQuery.cs @@ -1,7 +1,6 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using Newtonsoft.Json; namespace Yavsc.Models.Workflow { @@ -11,7 +10,7 @@ namespace Yavsc.Models.Workflow /// Query, for a date, with a given perfomer, at this given place. /// - public class BookQuery : NominativeServiceCommand + public class RdvQuery : NominativeServiceCommand { /// /// The command identifier @@ -38,22 +37,18 @@ namespace Yavsc.Models.Workflow } public string Reason { get; set; } - public BookQuery() + public RdvQuery() { } - public BookQuery(string activityCode, Location eventLocation, DateTime eventDate) + public RdvQuery(string activityCode, Location eventLocation, DateTime eventDate) { Location = eventLocation; EventDate = eventDate; ActivityCode = activityCode; } - [Required] - public string ActivityCode { get; set; } - [ForeignKey("ActivityCode"),JsonIgnore] - public virtual Activity Context  { get; set ; } } } diff --git a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx index adfe14e0..abaeadd1 100644 --- a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx +++ b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx @@ -338,5 +338,5 @@ contact a performer You posts Your profile Your message has been sent - + Hair Length diff --git a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.resx b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.resx index 0a7b4e3c..aa101278 100644 --- a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.resx +++ b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.resx @@ -325,6 +325,7 @@ Identifiant du fournisseur Nom du fournisseur Cote + {0} vous demande une intervention le {1} à {2} ({3}) Lire la suite ... raison S'inscrire diff --git a/Yavsc/Services/IGoogleCloudMessageSender.cs b/Yavsc/Services/IGoogleCloudMessageSender.cs index 662be685..c6ad796f 100644 --- a/Yavsc/Services/IGoogleCloudMessageSender.cs +++ b/Yavsc/Services/IGoogleCloudMessageSender.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Yavsc.Models.Google.Messaging; +using Yavsc.Models.Haircut; using Yavsc.Models.Messaging; namespace Yavsc.Services @@ -11,12 +12,18 @@ namespace Yavsc.Services Task NotifyBookQueryAsync( GoogleAuthSettings googlesettings, IEnumerable registrationId, - BookQueryEvent ev); + RdvQueryEvent ev); - Task NotifyEstimateAsync( + Task NotifyEstimateAsync( GoogleAuthSettings googlesettings, IEnumerable registrationId, EstimationEvent ev); + Task NotifyHairCutQueryAsync( + GoogleAuthSettings googlesettings, + IEnumerable registrationId, + HairCutQueryEvent ev); + + } } diff --git a/Yavsc/Services/MessageServices.cs b/Yavsc/Services/MessageServices.cs index d0a0b44c..30a299a1 100755 --- a/Yavsc/Services/MessageServices.cs +++ b/Yavsc/Services/MessageServices.cs @@ -10,6 +10,7 @@ using Microsoft.AspNet.Identity; using Yavsc.Models; using Yavsc.Models.Google.Messaging; using System.Collections.Generic; +using Yavsc.Models.Haircut; namespace Yavsc.Services { @@ -27,11 +28,11 @@ namespace Yavsc.Services /// a MessageWithPayloadResponse, /// bool somethingsent = (response.failure == 0 && response.success > 0) /// - public async Task NotifyBookQueryAsync(GoogleAuthSettings googleSettings, IEnumerable registrationIds, BookQueryEvent ev) + public async Task NotifyBookQueryAsync(GoogleAuthSettings googleSettings, IEnumerable registrationIds, RdvQueryEvent ev) { MessageWithPayloadResponse response = null; await Task.Run(()=>{ - response = googleSettings.NotifyEvent(registrationIds, ev); + response = googleSettings.NotifyEvent(registrationIds, ev); }); return response; } @@ -45,6 +46,16 @@ namespace Yavsc.Services return response; } + public async Task NotifyHairCutQueryAsync(GoogleAuthSettings googleSettings, + IEnumerable registrationIds, HairCutQueryEvent ev) + { + MessageWithPayloadResponse response = null; + await Task.Run(()=>{ + response = googleSettings.NotifyEvent(registrationIds, ev); + }); + return response; + } + public Task SendEmailAsync(SiteSettings siteSettings, SmtpSettings smtpSettings, string email, string subject, string message) { try diff --git a/Yavsc/Startup/Startup.Workflow.cs b/Yavsc/Startup/Startup.Workflow.cs index 1e369268..64a6b287 100644 --- a/Yavsc/Startup/Startup.Workflow.cs +++ b/Yavsc/Startup/Startup.Workflow.cs @@ -7,10 +7,16 @@ namespace Yavsc public partial class Startup { /// - /// Lists Available user profile classes. + /// Lists Available user profile classes, + /// populated at startup, using reflexion. /// public static Dictionary ProfileTypes = new Dictionary() ; - public static readonly string [] Forms = new string [] { "Profiles" }; + + /// + /// Lists available command forms. + /// This is hard coded. + /// + public static readonly string [] Forms = new string [] { "Profiles" , "HairCut" }; private void ConfigureWorkflow(IApplicationBuilder app, SiteSettings settings) { @@ -30,6 +36,5 @@ namespace Yavsc return AppDomain.CurrentDomain.GetAssemblies()[0]; } } - } diff --git a/Yavsc/ViewModels/Auth/Handlers/CommandEditHandler.cs b/Yavsc/ViewModels/Auth/Handlers/CommandEditHandler.cs index 738918b8..eeb9c891 100644 --- a/Yavsc/ViewModels/Auth/Handlers/CommandEditHandler.cs +++ b/Yavsc/ViewModels/Auth/Handlers/CommandEditHandler.cs @@ -4,9 +4,9 @@ using Microsoft.AspNet.Authorization; namespace Yavsc.ViewModels.Auth.Handlers { using Models.Workflow; - public class CommandEditHandler : AuthorizationHandler + public class CommandEditHandler : AuthorizationHandler { - protected override void Handle(AuthorizationContext context, EditRequirement requirement, BookQuery resource) + protected override void Handle(AuthorizationContext context, EditRequirement requirement, RdvQuery resource) { if (context.User.IsInRole("FrontOffice")) context.Succeed(requirement); diff --git a/Yavsc/ViewModels/Auth/Handlers/CommandViewHandler.cs b/Yavsc/ViewModels/Auth/Handlers/CommandViewHandler.cs index 7b46a8e6..5073013e 100644 --- a/Yavsc/ViewModels/Auth/Handlers/CommandViewHandler.cs +++ b/Yavsc/ViewModels/Auth/Handlers/CommandViewHandler.cs @@ -4,9 +4,9 @@ using Microsoft.AspNet.Authorization; namespace Yavsc.ViewModels.Auth.Handlers { using Models.Workflow; - public class CommandViewHandler : AuthorizationHandler + public class CommandViewHandler : AuthorizationHandler { - protected override void Handle(AuthorizationContext context, ViewRequirement requirement, BookQuery resource) + protected override void Handle(AuthorizationContext context, ViewRequirement requirement, RdvQuery resource) { if (context.User.IsInRole("FrontOffice")) context.Succeed(requirement); diff --git a/Yavsc/ViewModels/Haircut/HairCutView.cs b/Yavsc/ViewModels/Haircut/HairCutView.cs new file mode 100644 index 00000000..feb494b8 --- /dev/null +++ b/Yavsc/ViewModels/Haircut/HairCutView.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using Yavsc.Models.Haircut; +using Yavsc.Models.Workflow; + +namespace Yavsc.ViewModels.Haircut +{ + public class HairCutView + { + public List HairBrushers { get; set; } + + public HairPrestation Topic { get; set; } + } +} \ No newline at end of file diff --git a/Yavsc/Views/Command/CommandConfirmation.cshtml b/Yavsc/Views/Command/CommandConfirmation.cshtml index 2b3d91b3..a32e3e7c 100644 --- a/Yavsc/Views/Command/CommandConfirmation.cshtml +++ b/Yavsc/Views/Command/CommandConfirmation.cshtml @@ -1,4 +1,4 @@ -@model BookQuery +@model RdvQuery @using Yavsc.Models.Google.Messaging @{ ViewData["Title"] = SR["Command confirmation"]+" "+ViewBag.Activity.Name; diff --git a/Yavsc/Views/Command/Create.cshtml b/Yavsc/Views/Command/Create.cshtml index dc385204..20df652a 100644 --- a/Yavsc/Views/Command/Create.cshtml +++ b/Yavsc/Views/Command/Create.cshtml @@ -1,4 +1,4 @@ -@model BookQuery +@model RdvQuery @{ ViewData["Title"] = "Proposition de rendez-vous "+ @SR["to"]+" "+ Model.PerformerProfile.Performer.UserName +" ["+SR[ViewBag.Activity.Code]+"]"; } @@ -21,10 +21,16 @@ } } -@section scripts{ +@section scripts { }

@ViewData["Title"]

@@ -137,14 +143,7 @@ - + diff --git a/Yavsc/Views/Command/CreateHairCutQuery.cshtml b/Yavsc/Views/Command/CreateHairCutQuery.cshtml new file mode 100644 index 00000000..e69de29b diff --git a/Yavsc/Views/Command/Delete.cshtml b/Yavsc/Views/Command/Delete.cshtml index 5f0bf21c..6d899121 100644 --- a/Yavsc/Views/Command/Delete.cshtml +++ b/Yavsc/Views/Command/Delete.cshtml @@ -1,4 +1,4 @@ -@model BookQuery +@model RdvQuery @{ ViewData["Title"] = "Delete"; diff --git a/Yavsc/Views/Command/Details.cshtml b/Yavsc/Views/Command/Details.cshtml index 167d1363..277af60c 100644 --- a/Yavsc/Views/Command/Details.cshtml +++ b/Yavsc/Views/Command/Details.cshtml @@ -1,4 +1,4 @@ -@model BookQuery +@model RdvQuery @{ ViewData["Title"] = @SR["Details"]; diff --git a/Yavsc/Views/Command/Edit.cshtml b/Yavsc/Views/Command/Edit.cshtml index 6c2e58a5..bc50e98c 100644 --- a/Yavsc/Views/Command/Edit.cshtml +++ b/Yavsc/Views/Command/Edit.cshtml @@ -1,4 +1,4 @@ -@model BookQuery +@model RdvQuery @{ ViewData["Title"] = "Edit"; diff --git a/Yavsc/Views/Command/Index.cshtml b/Yavsc/Views/Command/Index.cshtml index f8deaefe..a14b8f99 100644 --- a/Yavsc/Views/Command/Index.cshtml +++ b/Yavsc/Views/Command/Index.cshtml @@ -1,4 +1,4 @@ -@model IEnumerable +@model IEnumerable @{ ViewData["Title"] = "Index"; diff --git a/Yavsc/Views/FrontOffice/HArts.chtml b/Yavsc/Views/FrontOffice/HArts.chtml deleted file mode 100644 index dadf8034..00000000 --- a/Yavsc/Views/FrontOffice/HArts.chtml +++ /dev/null @@ -1,16 +0,0 @@ -@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/HairCut.cshtml b/Yavsc/Views/FrontOffice/HairCut.cshtml new file mode 100644 index 00000000..bed7bde9 --- /dev/null +++ b/Yavsc/Views/FrontOffice/HairCut.cshtml @@ -0,0 +1,73 @@ +@model HairCutView + +@{ + ViewData["Title"] = "Book - " + (ViewBag.Activity?.Name ?? SR["Any"]); +} +@ViewBag.Activity.Description + + + @Html.DisplayFor(m=>m) +
+ + +
+

HairPrestation

+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+
+
+ + +
+
+
+
+ +
+ + +
+
+ + + + + diff --git a/Yavsc/Views/HairPrestations/Create.cshtml b/Yavsc/Views/HairPrestations/Create.cshtml new file mode 100644 index 00000000..237f286e --- /dev/null +++ b/Yavsc/Views/HairPrestations/Create.cshtml @@ -0,0 +1,77 @@ +@model Yavsc.Models.Haircut.HairPrestation + +@{ + ViewData["Title"] = "Create"; +} + +

Create

+ +
+
+

HairPrestation

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

Delete

+ +

Are you sure you want to delete this?

+
+

HairPrestation

+
+
+
+ @Html.DisplayNameFor(model => model.Cares) +
+
+ @Html.DisplayFor(model => model.Cares) +
+
+ @Html.DisplayNameFor(model => model.Cut) +
+
+ @Html.DisplayFor(model => model.Cut) +
+
+ @Html.DisplayNameFor(model => model.Dressing) +
+
+ @Html.DisplayFor(model => model.Dressing) +
+
+ @Html.DisplayNameFor(model => model.Gender) +
+
+ @Html.DisplayFor(model => model.Gender) +
+
+ @Html.DisplayNameFor(model => model.Length) +
+
+ @Html.DisplayFor(model => model.Length) +
+
+ @Html.DisplayNameFor(model => model.Shampoo) +
+
+ @Html.DisplayFor(model => model.Shampoo) +
+
+ @Html.DisplayNameFor(model => model.Tech) +
+
+ @Html.DisplayFor(model => model.Tech) +
+
+ +
+
+ | + Back to List +
+
+
diff --git a/Yavsc/Views/HairPrestations/Details.cshtml b/Yavsc/Views/HairPrestations/Details.cshtml new file mode 100644 index 00000000..cfe09317 --- /dev/null +++ b/Yavsc/Views/HairPrestations/Details.cshtml @@ -0,0 +1,60 @@ +@model Yavsc.Models.Haircut.HairPrestation + +@{ + ViewData["Title"] = "Details"; +} + +

Details

+ +
+

HairPrestation

+
+
+
+ @Html.DisplayNameFor(model => model.Cares) +
+
+ @Html.DisplayFor(model => model.Cares) +
+
+ @Html.DisplayNameFor(model => model.Cut) +
+
+ @Html.DisplayFor(model => model.Cut) +
+
+ @Html.DisplayNameFor(model => model.Dressing) +
+
+ @Html.DisplayFor(model => model.Dressing) +
+
+ @Html.DisplayNameFor(model => model.Gender) +
+
+ @Html.DisplayFor(model => model.Gender) +
+
+ @Html.DisplayNameFor(model => model.Length) +
+
+ @Html.DisplayFor(model => model.Length) +
+
+ @Html.DisplayNameFor(model => model.Shampoo) +
+
+ @Html.DisplayFor(model => model.Shampoo) +
+
+ @Html.DisplayNameFor(model => model.Tech) +
+
+ @Html.DisplayFor(model => model.Tech) +
+
+
+

+ Edit | + Back to List +

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

Edit

+ +
+
+

HairPrestation

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

Index

+ +

+ Create New +

+ + + + + + + + + + + + +@foreach (var item in Model) { + + + + + + + + + + +} +
+ @Html.DisplayNameFor(model => model.Cares) + + @Html.DisplayNameFor(model => model.Cut) + + @Html.DisplayNameFor(model => model.Dressing) + + @Html.DisplayNameFor(model => model.Gender) + + @Html.DisplayNameFor(model => model.Length) + + @Html.DisplayNameFor(model => model.Shampoo) + + @Html.DisplayNameFor(model => model.Tech) +
+ @Html.DisplayFor(modelItem => item.Cares) + + @Html.DisplayFor(modelItem => item.Cut) + + @Html.DisplayFor(modelItem => item.Dressing) + + @Html.DisplayFor(modelItem => item.Gender) + + @Html.DisplayFor(modelItem => item.Length) + + @Html.DisplayFor(modelItem => item.Shampoo) + + @Html.DisplayFor(modelItem => item.Tech) + + Edit | + Details | + Delete +
diff --git a/Yavsc/Views/Home/About.cshtml b/Yavsc/Views/Home/About.cshtml index ca57f667..055308bf 100755 --- a/Yavsc/Views/Home/About.cshtml +++ b/Yavsc/Views/Home/About.cshtml @@ -2,8 +2,7 @@ ViewData["Title"] = @SR["About"]+" "+@SiteSettings.Value.Title; }

@ViewData["Title"]

-@SiteSettings.Value.Slogan - + @@ -90,3 +89,33 @@ et programme la suppression complète de ces dites informations dans les quinze L'opération est annulable, jusqu'à deux semaines après sa programmation. + + + + +C'est mon site pérso. + +-- +Paul, + publiant lua.p schneider.fr + + + + + + Yet Another Very Small Company ... + + + + + + Yet Another Very Small Company : La pré-production + + + + + + + Site du développeur + + diff --git a/Yavsc/Views/Home/Index.cshtml b/Yavsc/Views/Home/Index.cshtml index 47f217ce..1a0cb253 100755 --- a/Yavsc/Views/Home/Index.cshtml +++ b/Yavsc/Views/Home/Index.cshtml @@ -1,3 +1,5 @@ +@model IEnumerable + @{ ViewData["Title"] = "Home Page"; } @@ -41,9 +43,9 @@ } - @foreach (var form in act.Forms) { - - @form.Title + @foreach (var frm in act.Forms) { + + @frm.Title }
diff --git a/Yavsc/Views/Shared/DisplayTemplates/BookQuery.cshtml b/Yavsc/Views/Shared/DisplayTemplates/BookQuery.cshtml index b04f4496..ce9ede24 100644 --- a/Yavsc/Views/Shared/DisplayTemplates/BookQuery.cshtml +++ b/Yavsc/Views/Shared/DisplayTemplates/BookQuery.cshtml @@ -1,4 +1,4 @@ -@model BookQuery +@model RdvQuery
diff --git a/Yavsc/Views/_ViewImports.cshtml b/Yavsc/Views/_ViewImports.cshtml index 35cd7f03..e7b61490 100755 --- a/Yavsc/Views/_ViewImports.cshtml +++ b/Yavsc/Views/_ViewImports.cshtml @@ -28,7 +28,8 @@ @using Yavsc.ViewModels.Auth; @using Yavsc.ViewModels.Administration; @using Yavsc.ViewModels.Relationship; - +@using Yavsc.ViewModels.Haircut; + @inject IViewLocalizer LocString @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers" @addTagHelper "*, Yavsc"