Merge branch 'vnext' of https://github.com/pazof/yavsc.git
This commit is contained in:
@ -6,6 +6,7 @@ using Microsoft.AspNet.Http;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Billing;
|
||||
|
||||
@ -65,13 +66,13 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
|
||||
// PUT: api/Estimate/5
|
||||
[HttpPut("{id}")]
|
||||
[HttpPut("{id}"),Produces("application/json")]
|
||||
public IActionResult PutEstimate(long id, [FromBody] Estimate estimate)
|
||||
{
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return HttpBadRequest(ModelState);
|
||||
return new BadRequestObjectResult(ModelState);
|
||||
}
|
||||
|
||||
if (id != estimate.Id)
|
||||
@ -109,13 +110,9 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
|
||||
// POST: api/Estimate
|
||||
[HttpPost]
|
||||
[HttpPost,Produces("application/json")]
|
||||
public IActionResult PostEstimate([FromBody] Estimate estimate)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return HttpBadRequest(ModelState);
|
||||
}
|
||||
var uid = User.GetUserId();
|
||||
if (!User.IsInRole(Constants.AdminGroupName))
|
||||
{
|
||||
@ -127,9 +124,17 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
if (estimate.CommandId!=null) {
|
||||
var query = _context.RdvQueries.FirstOrDefault(q => q.Id == estimate.CommandId);
|
||||
if (query == null || query.PerformerId!= uid)
|
||||
throw new InvalidOperationException();
|
||||
if (query == null) {
|
||||
return HttpBadRequest(ModelState);
|
||||
}
|
||||
query.ValidationDate = DateTime.Now;
|
||||
_context.SaveChanges(User.GetUserId());
|
||||
_context.Entry(query).State = EntityState.Detached;
|
||||
}
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
_logger.LogError(JsonConvert.SerializeObject(ModelState));
|
||||
return Json(ModelState);
|
||||
}
|
||||
_context.Estimates.Add(estimate);
|
||||
|
||||
|
@ -17,6 +17,7 @@ namespace Yavsc.ApiControllers
|
||||
using Yavsc.Services;
|
||||
using Yavsc.Models.Messaging;
|
||||
using Yavsc.ViewModels;
|
||||
using Microsoft.Extensions.OptionsModel;
|
||||
|
||||
[Route("api/pdfestimate"), Authorize]
|
||||
public class PdfEstimateController : Controller
|
||||
@ -33,12 +34,17 @@ namespace Yavsc.ApiControllers
|
||||
IAuthorizationService authorizationService,
|
||||
ILoggerFactory loggerFactory,
|
||||
IStringLocalizer<Yavsc.Resources.YavscLocalisation> SR,
|
||||
ApplicationDbContext context)
|
||||
ApplicationDbContext context,
|
||||
IOptions<GoogleAuthSettings> googleSettings,
|
||||
IGoogleCloudMessageSender GCMSender
|
||||
)
|
||||
{
|
||||
_googleSettings=googleSettings.Value;
|
||||
this.authorizationService = authorizationService;
|
||||
dbContext = context;
|
||||
logger = loggerFactory.CreateLogger<PdfEstimateController>();
|
||||
this._localizer = SR;
|
||||
_GCMSender=GCMSender;
|
||||
}
|
||||
|
||||
[HttpGet("get/{id}", Name = "Get"), Authorize]
|
||||
@ -111,10 +117,12 @@ namespace Yavsc.ApiControllers
|
||||
var yaev = new EstimationEvent(dbContext,estimate,_localizer);
|
||||
|
||||
var regids = estimate.Client.Devices.Select(d => d.GCMRegistrationId).ToArray();
|
||||
logger.LogWarning($"new regids: {regids}");
|
||||
var grep = await _GCMSender.NotifyEstimateAsync(_googleSettings,regids,yaev);
|
||||
logger.LogWarning($"grep: {grep}");
|
||||
return Ok (new { ProviderValidationDate = estimate.ProviderValidationDate, GCMSent = grep.success });
|
||||
bool gcmSent = false;
|
||||
if (regids.Length>0) {
|
||||
var grep = await _GCMSender.NotifyEstimateAsync(_googleSettings,regids,yaev);
|
||||
gcmSent = grep.success>0;
|
||||
}
|
||||
return Ok (new { ProviderValidationDate = estimate.ProviderValidationDate, GCMSent = gcmSent });
|
||||
}
|
||||
|
||||
[HttpGet("prosign/{id}")]
|
||||
|
9
Yavsc/Attributes/ActivitySettingsAttribute.cs
Normal file
9
Yavsc/Attributes/ActivitySettingsAttribute.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Attributes
|
||||
{
|
||||
public class ActivitySettingsAttribute : Attribute
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -41,9 +41,9 @@ namespace Yavsc.Controllers
|
||||
var items = Startup.ProfileTypes.Select(
|
||||
pt => new SelectListItem
|
||||
{
|
||||
Text = SR[pt.Key],
|
||||
Value = pt.Key,
|
||||
Selected = currentCode == pt.Key
|
||||
Text = SR[pt.FullName],
|
||||
Value = pt.FullName,
|
||||
Selected = currentCode == pt.FullName
|
||||
}).ToList();
|
||||
items.Add(new SelectListItem { Text = SR[Constants.NoneCode], Value = Constants.NoneCode, Selected = currentCode == null});
|
||||
ViewBag.SettingsClassName = items;
|
||||
|
@ -1,121 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.Data.Entity;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Haircut;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Yavsc.Controllers.Generic;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
[Authorize(Roles="Performer")]
|
||||
public class BrusherProfileController : Controller
|
||||
public class BrusherProfileController : SettingsController<BrusherProfile>
|
||||
{
|
||||
private ApplicationDbContext _context;
|
||||
|
||||
public BrusherProfileController(ApplicationDbContext context)
|
||||
public BrusherProfileController(ApplicationDbContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: BrusherProfile
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
var existing = await _context.BrusherProfile.SingleOrDefaultAsync(p=>p.UserId == User.GetUserId());
|
||||
return View(existing);
|
||||
}
|
||||
|
||||
// GET: BrusherProfile/Details/5
|
||||
public async Task<IActionResult> Details(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
id = User.GetUserId();
|
||||
}
|
||||
|
||||
BrusherProfile brusherProfile = await _context.BrusherProfile.SingleAsync(m => m.UserId == id);
|
||||
if (brusherProfile == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(brusherProfile);
|
||||
}
|
||||
|
||||
// GET: BrusherProfile/Create
|
||||
public IActionResult Create()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
// GET: BrusherProfile/Edit/5
|
||||
public async Task<IActionResult> Edit(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
id = User.GetUserId();
|
||||
}
|
||||
|
||||
BrusherProfile brusherProfile = await _context.BrusherProfile.SingleOrDefaultAsync(m => m.UserId == id);
|
||||
if (brusherProfile == null)
|
||||
{
|
||||
brusherProfile = new BrusherProfile { };
|
||||
}
|
||||
return View(brusherProfile);
|
||||
}
|
||||
|
||||
// POST: BrusherProfile/Edit/5
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Edit(BrusherProfile brusherProfile)
|
||||
{
|
||||
if (string.IsNullOrEmpty(brusherProfile.UserId))
|
||||
{
|
||||
// a creation
|
||||
brusherProfile.UserId = User.GetUserId();
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.BrusherProfile.Add(brusherProfile);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
else if (ModelState.IsValid)
|
||||
{
|
||||
_context.Update(brusherProfile);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(brusherProfile);
|
||||
}
|
||||
|
||||
// GET: BrusherProfile/Delete/5
|
||||
[ActionName("Delete")]
|
||||
public async Task<IActionResult> Delete(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
BrusherProfile brusherProfile = await _context.BrusherProfile.SingleAsync(m => m.UserId == id);
|
||||
if (brusherProfile == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(brusherProfile);
|
||||
}
|
||||
|
||||
// POST: BrusherProfile/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(string id)
|
||||
{
|
||||
BrusherProfile brusherProfile = await _context.BrusherProfile.SingleAsync(m => m.UserId == id);
|
||||
_context.BrusherProfile.Remove(brusherProfile);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
122
Yavsc/Controllers/DjSettingsController.cs
Normal file
122
Yavsc/Controllers/DjSettingsController.cs
Normal file
@ -0,0 +1,122 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
using Microsoft.Data.Entity;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Musical.Profiles;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
public class DjSettingsController : Controller
|
||||
{
|
||||
private ApplicationDbContext _context;
|
||||
|
||||
public DjSettingsController(ApplicationDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: DjSettings
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
return View(await _context.DjSettings.ToListAsync());
|
||||
}
|
||||
|
||||
// GET: DjSettings/Details/5
|
||||
public async Task<IActionResult> Details(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
DjSettings djSettings = await _context.DjSettings.SingleAsync(m => m.UserId == id);
|
||||
if (djSettings == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(djSettings);
|
||||
}
|
||||
|
||||
// GET: DjSettings/Create
|
||||
public IActionResult Create()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
// POST: DjSettings/Create
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Create(DjSettings djSettings)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.DjSettings.Add(djSettings);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(djSettings);
|
||||
}
|
||||
|
||||
// GET: DjSettings/Edit/5
|
||||
public async Task<IActionResult> Edit(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
DjSettings djSettings = await _context.DjSettings.SingleAsync(m => m.UserId == id);
|
||||
if (djSettings == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
return View(djSettings);
|
||||
}
|
||||
|
||||
// POST: DjSettings/Edit/5
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Edit(DjSettings djSettings)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Update(djSettings);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(djSettings);
|
||||
}
|
||||
|
||||
// GET: DjSettings/Delete/5
|
||||
[ActionName("Delete")]
|
||||
public async Task<IActionResult> Delete(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
DjSettings djSettings = await _context.DjSettings.SingleAsync(m => m.UserId == id);
|
||||
if (djSettings == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(djSettings);
|
||||
}
|
||||
|
||||
// POST: DjSettings/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(string id)
|
||||
{
|
||||
DjSettings djSettings = await _context.DjSettings.SingleAsync(m => m.UserId == id);
|
||||
_context.DjSettings.Remove(djSettings);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
}
|
@ -7,16 +7,23 @@ using Microsoft.Data.Entity;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Models;
|
||||
using Models.Workflow;
|
||||
using Yavsc.Exceptions;
|
||||
using Yavsc.ViewModels.Workflow;
|
||||
using YavscLib;
|
||||
|
||||
[Authorize]
|
||||
public class DoController : Controller
|
||||
{
|
||||
private ApplicationDbContext _context;
|
||||
ILogger _logger;
|
||||
|
||||
public DoController(ApplicationDbContext context)
|
||||
public DoController(ApplicationDbContext context,ILogger<DoController> logger)
|
||||
{
|
||||
_context = context;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
// GET: /Do/Index
|
||||
@ -35,6 +42,7 @@ namespace Yavsc.Controllers
|
||||
// GET: Do/Details/5
|
||||
public IActionResult Details(string id, string activityCode)
|
||||
{
|
||||
|
||||
if (id == null || activityCode == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
@ -46,10 +54,23 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
ViewBag.HasConfigurableSettings = (userActivity.Does.SettingsClassName != null);
|
||||
if (ViewBag.HasConfigurableSettings)
|
||||
ViewBag.SettingsControllerName = Startup.ProfileTypes[userActivity.Does.SettingsClassName].Name;
|
||||
return View(userActivity);
|
||||
|
||||
bool hasConfigurableSettings = (userActivity.Does.SettingsClassName != null);
|
||||
if (hasConfigurableSettings) {
|
||||
ViewBag.ProfileType = Startup.ProfileTypes.Single(t=>t.FullName==userActivity.Does.SettingsClassName);
|
||||
var dbset = (IQueryable<ISpecializationSettings>) _context.GetDbSet(userActivity.Does.SettingsClassName);
|
||||
if (dbset == null) throw new InvalidWorkflowModelException($"pas de db set pour {userActivity.Does.SettingsClassName}, vous avez peut-être besoin de décorer votre propriété avec l'attribut [ActivitySettings]");
|
||||
return View(new UserActivityViewModel {
|
||||
Declaration = userActivity,
|
||||
HasSettings = dbset.Any(ua=>ua.UserId==id),
|
||||
NeedsSettings = hasConfigurableSettings
|
||||
} );
|
||||
}
|
||||
return View(new UserActivityViewModel {
|
||||
Declaration = userActivity,
|
||||
HasSettings = false,
|
||||
NeedsSettings = hasConfigurableSettings
|
||||
} );
|
||||
}
|
||||
|
||||
// GET: Do/Create
|
||||
@ -152,9 +173,10 @@ namespace Yavsc.Controllers
|
||||
// POST: Do/Delete/5
|
||||
[HttpPost, ActionName("Delete"),Authorize]
|
||||
[ValidateAntiForgeryToken]
|
||||
public IActionResult DeleteConfirmed(string id, string activityCode)
|
||||
public IActionResult DeleteConfirmed(UserActivity userActivity)
|
||||
{
|
||||
UserActivity userActivity = _context.UserActivities.Single(m => m.UserId == id && m.DoesCode == activityCode);
|
||||
if (!ModelState.IsValid)
|
||||
return new BadRequestObjectResult(ModelState);
|
||||
if (!User.IsInRole("Administrator"))
|
||||
if (User.GetUserId() != userActivity.UserId) {
|
||||
ModelState.AddModelError("User","You're not admin.");
|
||||
|
15
Yavsc/Controllers/FormationSettingsController.cs
Normal file
15
Yavsc/Controllers/FormationSettingsController.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using Yavsc.Controllers.Generic;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Workflow.Profiles;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
public class FormationSettingsController : SettingsController<FormationSettings>
|
||||
{
|
||||
|
||||
public FormationSettingsController(ApplicationDbContext context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
122
Yavsc/Controllers/GeneralSettingsController.cs
Normal file
122
Yavsc/Controllers/GeneralSettingsController.cs
Normal file
@ -0,0 +1,122 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
using Microsoft.Data.Entity;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Musical.Profiles;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
public class GeneralSettingsController : Controller
|
||||
{
|
||||
private ApplicationDbContext _context;
|
||||
|
||||
public GeneralSettingsController(ApplicationDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: GeneralSettings
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
return View(await _context.GeneralSettings.ToListAsync());
|
||||
}
|
||||
|
||||
// GET: GeneralSettings/Details/5
|
||||
public async Task<IActionResult> Details(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
|
||||
if (generalSettings == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(generalSettings);
|
||||
}
|
||||
|
||||
// GET: GeneralSettings/Create
|
||||
public IActionResult Create()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
// POST: GeneralSettings/Create
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Create(GeneralSettings generalSettings)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.GeneralSettings.Add(generalSettings);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(generalSettings);
|
||||
}
|
||||
|
||||
// GET: GeneralSettings/Edit/5
|
||||
public async Task<IActionResult> Edit(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
|
||||
if (generalSettings == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
return View(generalSettings);
|
||||
}
|
||||
|
||||
// POST: GeneralSettings/Edit/5
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Edit(GeneralSettings generalSettings)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Update(generalSettings);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(generalSettings);
|
||||
}
|
||||
|
||||
// GET: GeneralSettings/Delete/5
|
||||
[ActionName("Delete")]
|
||||
public async Task<IActionResult> Delete(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
|
||||
if (generalSettings == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(generalSettings);
|
||||
}
|
||||
|
||||
// POST: GeneralSettings/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(string id)
|
||||
{
|
||||
GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
|
||||
_context.GeneralSettings.Remove(generalSettings);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
}
|
140
Yavsc/Controllers/Generic/SettingsController.cs
Normal file
140
Yavsc/Controllers/Generic/SettingsController.cs
Normal file
@ -0,0 +1,140 @@
|
||||
using System.Security.Claims;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.Data.Entity;
|
||||
using Yavsc.Exceptions;
|
||||
using Yavsc.Models;
|
||||
using YavscLib;
|
||||
|
||||
namespace Yavsc.Controllers.Generic
|
||||
{
|
||||
[Authorize]
|
||||
public abstract class SettingsController<TSettings> : Controller where TSettings : class, ISpecializationSettings, new()
|
||||
{
|
||||
protected ApplicationDbContext _context;
|
||||
private object dbSet;
|
||||
|
||||
protected DbSet<TSettings> Settings { get {
|
||||
return (DbSet<TSettings>) dbSet;
|
||||
} }
|
||||
|
||||
public SettingsController(ApplicationDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
dbSet=_context.GetDbSet<TSettings>();
|
||||
if (dbSet==null) throw new InvalidWorkflowModelException(this.GetType().Name);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
var existing = await this.Settings.SingleOrDefaultAsync(p=>p.UserId == User.GetUserId());
|
||||
return View(existing);
|
||||
}
|
||||
// GET: BrusherProfile/Details/5
|
||||
public async Task<IActionResult> Details(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
id = User.GetUserId();
|
||||
}
|
||||
|
||||
var profile = await Settings.SingleAsync(m => m.UserId == id);
|
||||
if (profile == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(profile);
|
||||
}
|
||||
|
||||
|
||||
// GET: BrusherProfile/Create
|
||||
public IActionResult Create()
|
||||
{
|
||||
return View("Edit", new TSettings());
|
||||
}
|
||||
|
||||
// GET: BrusherProfile/Edit/5
|
||||
public async Task<IActionResult> Edit(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
id = User.GetUserId();
|
||||
}
|
||||
|
||||
TSettings setting = await Settings.SingleOrDefaultAsync(m => m.UserId == id);
|
||||
if (setting == null)
|
||||
{
|
||||
setting = new TSettings { };
|
||||
}
|
||||
return View(setting);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// GET: BrusherProfile/Delete/5
|
||||
[ActionName("Delete")]
|
||||
public async Task<IActionResult> Delete(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
var brusherProfile = await Settings.SingleAsync(m => m.UserId == id);
|
||||
if (brusherProfile == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(brusherProfile);
|
||||
}
|
||||
|
||||
// POST: FormationSettings/Create
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Create(TSettings settings)
|
||||
{
|
||||
if (settings.UserId == null) settings.UserId = User.GetUserId();
|
||||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
Settings.Add(settings);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View("Edit",settings);
|
||||
}
|
||||
|
||||
// POST: FormationSettings/Edit/5
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Edit(TSettings settings)
|
||||
{
|
||||
if (settings.UserId == null) {
|
||||
settings.UserId = User.GetUserId();
|
||||
Settings.Add(settings);
|
||||
} else
|
||||
_context.Update(settings);
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(settings);
|
||||
}
|
||||
|
||||
// POST: FormationSettings/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(string id)
|
||||
{
|
||||
TSettings formationSettings = await Settings.SingleAsync(m => m.UserId == id);
|
||||
Settings.Remove(formationSettings);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -78,16 +78,16 @@ namespace Yavsc.Controllers
|
||||
public async Task<IActionResult> Index(ManageMessageId? message = null)
|
||||
{
|
||||
ViewData["StatusMessage"] =
|
||||
message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed."
|
||||
: message == ManageMessageId.SetPasswordSuccess ? "Your password has been set."
|
||||
: message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set."
|
||||
: message == ManageMessageId.Error ? "An error has occurred."
|
||||
: message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added."
|
||||
: message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed."
|
||||
: message == ManageMessageId.ChangeNameSuccess ? "Your name was updated."
|
||||
: message == ManageMessageId.SetActivitySuccess ? "Your activity was set."
|
||||
: message == ManageMessageId.AvatarUpdateSuccess ? "Your avatar was updated."
|
||||
: message == ManageMessageId.IdentityUpdateSuccess ? "Your identity was updated."
|
||||
message == ManageMessageId.ChangePasswordSuccess ? _SR["Your password has been changed."]
|
||||
: message == ManageMessageId.SetPasswordSuccess ? _SR["Your password has been set."]
|
||||
: message == ManageMessageId.SetTwoFactorSuccess ? _SR["Your two-factor authentication provider has been set."]
|
||||
: message == ManageMessageId.Error ? _SR["An error has occurred."]
|
||||
: message == ManageMessageId.AddPhoneSuccess ? _SR["Your phone number was added."]
|
||||
: message == ManageMessageId.RemovePhoneSuccess ? _SR["Your phone number was removed."]
|
||||
: message == ManageMessageId.ChangeNameSuccess ? _SR["Your name was updated."]
|
||||
: message == ManageMessageId.SetActivitySuccess ? _SR["Your activity was set."]
|
||||
: message == ManageMessageId.AvatarUpdateSuccess ? _SR["Your avatar was updated."]
|
||||
: message == ManageMessageId.IdentityUpdateSuccess ? _SR["Your identity was updated."]
|
||||
: "";
|
||||
|
||||
var user = await GetCurrentUserAsync();
|
||||
@ -114,8 +114,10 @@ namespace Yavsc.Controllers
|
||||
DiskQuota = user.DiskQuota
|
||||
};
|
||||
model.HaveProfessionalSettings = _dbContext.Performers.Any(x => x.PerformerId == user.Id);
|
||||
model.Activity = _dbContext.UserActivities.Include(a=>a.Does).Where(u=>u.UserId == user.Id)
|
||||
.ToList();
|
||||
var usrActs = _dbContext.UserActivities.Include(a=>a.Does).Where(a=> a.UserId == user.Id);
|
||||
|
||||
model.HaveActivityToConfigure = usrActs.Any( a=> a.Settings == null && a.Does.SettingsClassName!=null );
|
||||
model.Activity = _dbContext.UserActivities.Include(a=>a.Does).Where(u=>u.UserId == user.Id).ToList();
|
||||
return View(model);
|
||||
}
|
||||
|
||||
|
15
Yavsc/Exceptions/InvalidActivityModelException.cs
Normal file
15
Yavsc/Exceptions/InvalidActivityModelException.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
namespace Yavsc.Exceptions
|
||||
{
|
||||
public class InvalidWorkflowModelException : Exception
|
||||
{
|
||||
public InvalidWorkflowModelException(string descr) : base(descr)
|
||||
{
|
||||
|
||||
}
|
||||
public InvalidWorkflowModelException(string descr, Exception inner) : base(descr,inner)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -7,16 +7,8 @@ namespace Yavsc.Helpers
|
||||
using Microsoft.Data.Entity;
|
||||
using Models.Workflow;
|
||||
using Yavsc.Models;
|
||||
using YavscLib;
|
||||
public static class WorkflowHelpers
|
||||
{
|
||||
public static ISpecializationSettings CreateSettings (this Activity activity) {
|
||||
if (activity.SettingsClassName==null) return null;
|
||||
var ctor = Startup.ProfileTypes[activity.SettingsClassName].GetConstructor(System.Type.EmptyTypes);
|
||||
if (ctor==null) return null;
|
||||
return (ISpecializationSettings) ctor.Invoke(null);
|
||||
}
|
||||
|
||||
public static List<PerformerProfile> ListPerformers(this ApplicationDbContext context, string actCode)
|
||||
{
|
||||
return context.Performers
|
||||
|
1409
Yavsc/Migrations/20170303000800_estimateRequireCommandType.Designer.cs
generated
Normal file
1409
Yavsc/Migrations/20170303000800_estimateRequireCommandType.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
600
Yavsc/Migrations/20170303000800_estimateRequireCommandType.cs
Normal file
600
Yavsc/Migrations/20170303000800_estimateRequireCommandType.cs
Normal file
@ -0,0 +1,600 @@
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
public partial class estimateRequireCommandType : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BlackListed_ApplicationUser_OwnerId", table: "BlackListed");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Blog_BlogPostId", table: "CircleAuthorizationToBlogPost");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId", table: "CircleAuthorizationToBlogPost");
|
||||
migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Estimate_ApplicationUser_ClientId", table: "Estimate");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Estimate_PerformerProfile_OwnerId", table: "Estimate");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_Activity_ActivityCode", table: "HairCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_ApplicationUser_ClientId", table: "HairCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_Location_LocationId", table: "HairCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_PerformerProfile_PerformerId", table: "HairCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_HairPrestation_PrestationId", table: "HairCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_Activity_ActivityCode", table: "HairMultiCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_ApplicationUser_ClientId", table: "HairMultiCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId", table: "HairMultiCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairTaint_Color_ColorId", table: "HairTaint");
|
||||
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_Notification_NotificationId", table: "DimissClicked");
|
||||
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_ApplicationUser_UserId", table: "DimissClicked");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CommandForm_Activity_ActivityCode", table: "CommandForm");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_Activity_ActivityCode", table: "RdvQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_ApplicationUser_ClientId", table: "RdvQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_PerformerProfile_PerformerId", table: "RdvQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_UserActivity_Activity_DoesCode", table: "UserActivity");
|
||||
migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity");
|
||||
migrationBuilder.Sql("update \"Estimate\" set \"CommandType\"='RdvQuery'");
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "CommandType",
|
||||
table: "Estimate",
|
||||
nullable: false);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserClaims",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserLogins",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BlackListed_ApplicationUser_OwnerId",
|
||||
table: "BlackListed",
|
||||
column: "OwnerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleAuthorizationToBlogPost_Blog_BlogPostId",
|
||||
table: "CircleAuthorizationToBlogPost",
|
||||
column: "BlogPostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId",
|
||||
table: "CircleAuthorizationToBlogPost",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccountBalance_ApplicationUser_UserId",
|
||||
table: "AccountBalance",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BalanceImpact_AccountBalance_BalanceId",
|
||||
table: "BalanceImpact",
|
||||
column: "BalanceId",
|
||||
principalTable: "AccountBalance",
|
||||
principalColumn: "UserId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommandLine_Estimate_EstimateId",
|
||||
table: "CommandLine",
|
||||
column: "EstimateId",
|
||||
principalTable: "Estimate",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Estimate_ApplicationUser_ClientId",
|
||||
table: "Estimate",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Estimate_PerformerProfile_OwnerId",
|
||||
table: "Estimate",
|
||||
column: "OwnerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairCutQuery_Activity_ActivityCode",
|
||||
table: "HairCutQuery",
|
||||
column: "ActivityCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairCutQuery_ApplicationUser_ClientId",
|
||||
table: "HairCutQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairCutQuery_Location_LocationId",
|
||||
table: "HairCutQuery",
|
||||
column: "LocationId",
|
||||
principalTable: "Location",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairCutQuery_PerformerProfile_PerformerId",
|
||||
table: "HairCutQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairCutQuery_HairPrestation_PrestationId",
|
||||
table: "HairCutQuery",
|
||||
column: "PrestationId",
|
||||
principalTable: "HairPrestation",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairMultiCutQuery_Activity_ActivityCode",
|
||||
table: "HairMultiCutQuery",
|
||||
column: "ActivityCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairMultiCutQuery_ApplicationUser_ClientId",
|
||||
table: "HairMultiCutQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId",
|
||||
table: "HairMultiCutQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairTaint_Color_ColorId",
|
||||
table: "HairTaint",
|
||||
column: "ColorId",
|
||||
principalTable: "Color",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DimissClicked_Notification_NotificationId",
|
||||
table: "DimissClicked",
|
||||
column: "NotificationId",
|
||||
principalTable: "Notification",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DimissClicked_ApplicationUser_UserId",
|
||||
table: "DimissClicked",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Instrumentation_Instrument_InstrumentId",
|
||||
table: "Instrumentation",
|
||||
column: "InstrumentId",
|
||||
principalTable: "Instrument",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_Circle_CircleId",
|
||||
table: "CircleMember",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_ApplicationUser_MemberId",
|
||||
table: "CircleMember",
|
||||
column: "MemberId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PostTag_Blog_PostId",
|
||||
table: "PostTag",
|
||||
column: "PostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommandForm_Activity_ActivityCode",
|
||||
table: "CommandForm",
|
||||
column: "ActivityCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_Location_OrganizationAddressId",
|
||||
table: "PerformerProfile",
|
||||
column: "OrganizationAddressId",
|
||||
principalTable: "Location",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_ApplicationUser_PerformerId",
|
||||
table: "PerformerProfile",
|
||||
column: "PerformerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RdvQuery_Activity_ActivityCode",
|
||||
table: "RdvQuery",
|
||||
column: "ActivityCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RdvQuery_ApplicationUser_ClientId",
|
||||
table: "RdvQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RdvQuery_PerformerProfile_PerformerId",
|
||||
table: "RdvQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserActivity_Activity_DoesCode",
|
||||
table: "UserActivity",
|
||||
column: "DoesCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserActivity_PerformerProfile_UserId",
|
||||
table: "UserActivity",
|
||||
column: "UserId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BlackListed_ApplicationUser_OwnerId", table: "BlackListed");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Blog_BlogPostId", table: "CircleAuthorizationToBlogPost");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId", table: "CircleAuthorizationToBlogPost");
|
||||
migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Estimate_ApplicationUser_ClientId", table: "Estimate");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Estimate_PerformerProfile_OwnerId", table: "Estimate");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_Activity_ActivityCode", table: "HairCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_ApplicationUser_ClientId", table: "HairCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_Location_LocationId", table: "HairCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_PerformerProfile_PerformerId", table: "HairCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_HairPrestation_PrestationId", table: "HairCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_Activity_ActivityCode", table: "HairMultiCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_ApplicationUser_ClientId", table: "HairMultiCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId", table: "HairMultiCutQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_HairTaint_Color_ColorId", table: "HairTaint");
|
||||
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_Notification_NotificationId", table: "DimissClicked");
|
||||
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_ApplicationUser_UserId", table: "DimissClicked");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CommandForm_Activity_ActivityCode", table: "CommandForm");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_Activity_ActivityCode", table: "RdvQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_ApplicationUser_ClientId", table: "RdvQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_PerformerProfile_PerformerId", table: "RdvQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_UserActivity_Activity_DoesCode", table: "UserActivity");
|
||||
migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity");
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "CommandType",
|
||||
table: "Estimate",
|
||||
nullable: true);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserClaims",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserLogins",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BlackListed_ApplicationUser_OwnerId",
|
||||
table: "BlackListed",
|
||||
column: "OwnerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleAuthorizationToBlogPost_Blog_BlogPostId",
|
||||
table: "CircleAuthorizationToBlogPost",
|
||||
column: "BlogPostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId",
|
||||
table: "CircleAuthorizationToBlogPost",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccountBalance_ApplicationUser_UserId",
|
||||
table: "AccountBalance",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BalanceImpact_AccountBalance_BalanceId",
|
||||
table: "BalanceImpact",
|
||||
column: "BalanceId",
|
||||
principalTable: "AccountBalance",
|
||||
principalColumn: "UserId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommandLine_Estimate_EstimateId",
|
||||
table: "CommandLine",
|
||||
column: "EstimateId",
|
||||
principalTable: "Estimate",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Estimate_ApplicationUser_ClientId",
|
||||
table: "Estimate",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Estimate_PerformerProfile_OwnerId",
|
||||
table: "Estimate",
|
||||
column: "OwnerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairCutQuery_Activity_ActivityCode",
|
||||
table: "HairCutQuery",
|
||||
column: "ActivityCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairCutQuery_ApplicationUser_ClientId",
|
||||
table: "HairCutQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairCutQuery_Location_LocationId",
|
||||
table: "HairCutQuery",
|
||||
column: "LocationId",
|
||||
principalTable: "Location",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairCutQuery_PerformerProfile_PerformerId",
|
||||
table: "HairCutQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairCutQuery_HairPrestation_PrestationId",
|
||||
table: "HairCutQuery",
|
||||
column: "PrestationId",
|
||||
principalTable: "HairPrestation",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairMultiCutQuery_Activity_ActivityCode",
|
||||
table: "HairMultiCutQuery",
|
||||
column: "ActivityCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairMultiCutQuery_ApplicationUser_ClientId",
|
||||
table: "HairMultiCutQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId",
|
||||
table: "HairMultiCutQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HairTaint_Color_ColorId",
|
||||
table: "HairTaint",
|
||||
column: "ColorId",
|
||||
principalTable: "Color",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DimissClicked_Notification_NotificationId",
|
||||
table: "DimissClicked",
|
||||
column: "NotificationId",
|
||||
principalTable: "Notification",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DimissClicked_ApplicationUser_UserId",
|
||||
table: "DimissClicked",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Instrumentation_Instrument_InstrumentId",
|
||||
table: "Instrumentation",
|
||||
column: "InstrumentId",
|
||||
principalTable: "Instrument",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_Circle_CircleId",
|
||||
table: "CircleMember",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_ApplicationUser_MemberId",
|
||||
table: "CircleMember",
|
||||
column: "MemberId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PostTag_Blog_PostId",
|
||||
table: "PostTag",
|
||||
column: "PostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommandForm_Activity_ActivityCode",
|
||||
table: "CommandForm",
|
||||
column: "ActivityCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_Location_OrganizationAddressId",
|
||||
table: "PerformerProfile",
|
||||
column: "OrganizationAddressId",
|
||||
principalTable: "Location",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_ApplicationUser_PerformerId",
|
||||
table: "PerformerProfile",
|
||||
column: "PerformerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RdvQuery_Activity_ActivityCode",
|
||||
table: "RdvQuery",
|
||||
column: "ActivityCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RdvQuery_ApplicationUser_ClientId",
|
||||
table: "RdvQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RdvQuery_PerformerProfile_PerformerId",
|
||||
table: "RdvQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserActivity_Activity_DoesCode",
|
||||
table: "UserActivity",
|
||||
column: "DoesCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserActivity_PerformerProfile_UserId",
|
||||
table: "UserActivity",
|
||||
column: "UserId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
@ -337,7 +337,8 @@ namespace Yavsc.Migrations
|
||||
|
||||
b.Property<long?>("CommandId");
|
||||
|
||||
b.Property<string>("CommandType");
|
||||
b.Property<string>("CommandType")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
|
@ -26,6 +26,7 @@ namespace Yavsc.Models
|
||||
using Musical.Profiles;
|
||||
using Workflow.Profiles;
|
||||
using Drawing;
|
||||
using Yavsc.Attributes;
|
||||
|
||||
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
||||
{
|
||||
@ -51,8 +52,23 @@ namespace Yavsc.Models
|
||||
if (et.ClrType.GetInterface("IBaseTrackedEntity")!=null)
|
||||
et.FindProperty("DateCreated").IsReadOnlyAfterSave = true;
|
||||
}
|
||||
|
||||
}
|
||||
public DbSet<TSettings> GetDbSet<TSettings>() where TSettings : class, ISpecializationSettings
|
||||
|
||||
{
|
||||
return (DbSet<TSettings>) GetDbSet(typeof(TSettings).FullName);
|
||||
}
|
||||
public IQueryable<ISpecializationSettings> GetDbSet(string settingsClassName)
|
||||
{
|
||||
var dbSetPropInfo = Startup.GetUserSettingPropertyInfo(settingsClassName);
|
||||
if (dbSetPropInfo == null) return null;
|
||||
// var settingType = dbSetPropInfo.PropertyType;
|
||||
// var dbSetType = typeof(DbSet<>).MakeGenericType(new Type[] { settingType } );
|
||||
// avec une info method Remove et Update, ça le ferait ...
|
||||
|
||||
return (IQueryable<ISpecializationSettings>) dbSetPropInfo.GetValue(this);
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseNpgsql(Startup.ConnectionString);
|
||||
@ -219,18 +235,28 @@ namespace Yavsc.Models
|
||||
|
||||
public DbSet<LocationType> LocationType { get; set; }
|
||||
|
||||
public DbSet<Instrument> Instrument { get; set; }
|
||||
public DbSet<Instrument> Instrument { get; set; }
|
||||
|
||||
[ActivitySettings]
|
||||
public DbSet<DjSettings> DjSettings { get; set; }
|
||||
|
||||
[ActivitySettings]
|
||||
public DbSet<Instrumentation> Instrumentation { get; set; }
|
||||
|
||||
[ActivitySettings]
|
||||
public DbSet<FormationSettings> FormationSettings { get; set; }
|
||||
|
||||
[ActivitySettings]
|
||||
public DbSet<GeneralSettings> GeneralSettings { get; set; }
|
||||
public DbSet<CoWorking> WorkflowProviders { get; set; }
|
||||
|
||||
private void AddTimestamps(string currentUsername)
|
||||
{
|
||||
var entities = ChangeTracker.Entries().Where(x => x.Entity.GetType().GetInterface("IBaseTrackedEntity")!=null && (x.State == EntityState.Added || x.State == EntityState.Modified));
|
||||
var entities =
|
||||
ChangeTracker.Entries()
|
||||
.Where(x => x.Entity.GetType().GetInterface("IBaseTrackedEntity")!=null
|
||||
&& (x.State == EntityState.Added || x.State == EntityState.Modified));
|
||||
|
||||
// Microsoft.AspNet.Identity;
|
||||
|
||||
foreach (var entity in entities)
|
||||
{
|
||||
@ -274,6 +300,7 @@ namespace Yavsc.Models
|
||||
|
||||
public DbSet<HairPrestation> HairPrestation { get; set; }
|
||||
|
||||
[ActivitySettings]
|
||||
public DbSet<BrusherProfile> BrusherProfile { get; set; }
|
||||
|
||||
|
||||
|
@ -71,6 +71,7 @@ namespace Yavsc.Models.Billing
|
||||
[ForeignKey("ClientId"),JsonIgnore]
|
||||
public virtual ApplicationUser Client { get; set; }
|
||||
|
||||
[Required]
|
||||
public string CommandType
|
||||
{
|
||||
get; set;
|
||||
|
@ -135,5 +135,6 @@ namespace Yavsc.Models.Haircut
|
||||
[Display(Name="Remise au forfait coupe+technique"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
|
||||
public decimal FlatFeeDiscount { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -17,6 +17,5 @@ namespace Yavsc.Models.Musical.Profiles
|
||||
|
||||
[ForeignKeyAttribute("InstrumentId")]
|
||||
public virtual Instrument Tool { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -14,5 +14,6 @@ namespace Yavsc.Models.Workflow.Profiles
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
@ -19,5 +20,8 @@ namespace Yavsc.Models.Workflow
|
||||
|
||||
[Range(0,100)]
|
||||
public int Weight { get; set; }
|
||||
|
||||
[NotMapped,JsonIgnore]
|
||||
public object Settings { get; internal set; }
|
||||
}
|
||||
}
|
@ -398,8 +398,10 @@
|
||||
{0} devrait être disponible pour ce rendez-vous</value></data>
|
||||
<data name="Yavsc.Models.Musical.Profiles.Instrumentation"><value>Paramètres musicien (l'instrument)</value></data>
|
||||
<data name="Yavsc.Models.Musical.Profiles.DjSettings"><value>Paramètres Dj (le compte SoundCloud.com)</value></data>
|
||||
<data name="Yavsc.Models.Musical.Profiles.FormationSettings"><value>Paramètres formation (les partenaires)</value></data>
|
||||
<data name="Yavsc.Models.Workflow.Profiles.FormationSettings"><value>Paramètres formation (les partenaires)</value></data>
|
||||
<data name="Yavsc.Models.Musical.Profiles.GeneralSettings"><value>Paramètres généraux (visibilité et présentation)</value></data>
|
||||
<data name="Yavsc.Models.Haircut.BrusherProfile"><value>Paramètres coiffeur: tarifs, disponibilité</value></data>
|
||||
|
||||
<data name="Yes"><value>Oui</value></data>
|
||||
<data name="YouNeedToBeAuthenticatedIOToContact"><value>Vous devez vous authentifier pour pouvoir demander un devis
|
||||
à un préstataire.</value></data>
|
||||
|
@ -18,8 +18,10 @@ namespace Yavsc
|
||||
{
|
||||
private Client GetApplication(string clientId)
|
||||
{
|
||||
var dbContext = new ApplicationDbContext();
|
||||
var app = dbContext.Applications.FirstOrDefault(x => x.Id == clientId);
|
||||
Client app=null;
|
||||
using (var dbContext = new ApplicationDbContext()) {
|
||||
app = dbContext.Applications.FirstOrDefault(x => x.Id == clientId);
|
||||
}
|
||||
return app;
|
||||
}
|
||||
private readonly ConcurrentDictionary<string, string> _authenticationCodes = new ConcurrentDictionary<string, string>(StringComparer.Ordinal);
|
||||
|
@ -1,6 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Yavsc.Exceptions;
|
||||
using Yavsc.Models;
|
||||
using YavscLib;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
@ -10,15 +16,21 @@ namespace Yavsc
|
||||
/// Lists Available user profile classes,
|
||||
/// populated at startup, using reflexion.
|
||||
/// </summary>
|
||||
public static Dictionary<string,Type> ProfileTypes = new Dictionary<string,Type>() ;
|
||||
|
||||
public static List<Type> ProfileTypes = new List<Type>() ;
|
||||
public static List<PropertyInfo> UserSettings = new List<PropertyInfo> ();
|
||||
|
||||
/// <summary>
|
||||
/// Lists available command forms.
|
||||
/// This is hard coded.
|
||||
/// </summary>
|
||||
public static readonly string [] Forms = new string [] { "Profiles" , "HairCut" };
|
||||
|
||||
private void ConfigureWorkflow(IApplicationBuilder app, SiteSettings settings)
|
||||
public static PropertyInfo GetUserSettingPropertyInfo(string settingsClassName)
|
||||
{
|
||||
return UserSettings.SingleOrDefault(s => s.PropertyType.GenericTypeArguments[0].FullName == settingsClassName ) ;
|
||||
}
|
||||
|
||||
private void ConfigureWorkflow(IApplicationBuilder app, SiteSettings settings, ILogger logger)
|
||||
{
|
||||
System.AppDomain.CurrentDomain.ResourceResolve += OnYavscResourceResolve;
|
||||
|
||||
@ -26,10 +38,33 @@ namespace Yavsc
|
||||
foreach (var c in a.GetTypes()) {
|
||||
if (c.IsClass && !c.IsAbstract &&
|
||||
c.GetInterface("ISpecializationSettings")!=null) {
|
||||
ProfileTypes.Add(c.FullName,c);
|
||||
ProfileTypes.Add(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (var propinfo in typeof(ApplicationDbContext).GetProperties()) {
|
||||
foreach (var attr in propinfo.CustomAttributes) {
|
||||
if (attr.AttributeType == typeof(Yavsc.Attributes.ActivitySettingsAttribute)) {
|
||||
// bingo
|
||||
if (typeof(IQueryable<ISpecializationSettings>).IsAssignableFrom(propinfo.PropertyType))
|
||||
{
|
||||
logger.LogInformation($"Paramêtres utilisateur déclaré: {propinfo.Name}");
|
||||
UserSettings.Add(propinfo);
|
||||
} else
|
||||
// Design time error
|
||||
{
|
||||
var msg =
|
||||
$@"La propriété {propinfo.Name} du contexte de la
|
||||
base de donnée porte l'attribut [ActivitySetting],
|
||||
mais n'implemente pas l'interface IQueryable<ISpecializationSettings>
|
||||
({propinfo.MemberType.GetType()})";
|
||||
logger.LogCritical(msg);
|
||||
|
||||
throw new InvalidWorkflowModelException(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static System.Reflection.Assembly OnYavscResourceResolve (object sender, ResolveEventArgs ev)
|
||||
{
|
||||
|
@ -335,7 +335,7 @@ namespace Yavsc
|
||||
ConfigureOAuthApp(app, SiteSetup);
|
||||
ConfigureFileServerApp(app, SiteSetup, env, authorizationService);
|
||||
ConfigureWebSocketsApp(app, SiteSetup, env);
|
||||
ConfigureWorkflow(app, SiteSetup);
|
||||
ConfigureWorkflow(app, SiteSetup, logger);
|
||||
app.UseRequestLocalization(localizationOptions.Value, (RequestCulture) new RequestCulture((string)"fr"));
|
||||
app.UseSession();
|
||||
|
||||
|
@ -25,6 +25,7 @@ namespace Yavsc.ViewModels.Manage
|
||||
public List<UserActivity> Activity { get; set; }
|
||||
|
||||
public bool HaveProfessionalSettings { get; set; }
|
||||
public bool HaveActivityToConfigure { get; set; }
|
||||
|
||||
public long PostsCounter { get; set; }
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Yavsc.Models.Billing;
|
||||
|
||||
namespace Yavsc.ViewModels.WorkFlow
|
||||
namespace Yavsc.ViewModels.Workflow
|
||||
{
|
||||
public class EstimateEdition
|
||||
{
|
11
Yavsc/ViewModels/Workflow/UserActivityViewModel.cs
Normal file
11
Yavsc/ViewModels/Workflow/UserActivityViewModel.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using Yavsc.Models.Workflow;
|
||||
|
||||
namespace Yavsc.ViewModels.Workflow
|
||||
{
|
||||
public class UserActivityViewModel
|
||||
{
|
||||
public UserActivity Declaration { get; set; }
|
||||
public bool NeedsSettings { get; set; }
|
||||
public bool HasSettings { get; set; }
|
||||
}
|
||||
}
|
@ -342,15 +342,15 @@
|
||||
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
<p>
|
||||
<a asp-action="Edit" >@SR["Edit"]</a>
|
||||
<a asp-action="Delete" asp-route-id="@Model.UserId">@SR["Delete"]</a>
|
||||
</p>
|
||||
}
|
||||
else {
|
||||
<p>
|
||||
@SR["Aucun profile renseigné"]
|
||||
<a asp-action="Create" class="btn btn-success">@SR["Renseigner ce paramêtrage"]</a>
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
<p>
|
||||
<a asp-action="Edit" >@SR["Edit"]</a>
|
||||
@if (Model!=null) {
|
||||
<a asp-action="Delete" asp-route-id="@Model.UserId">@SR["Delete"]</a>
|
||||
}
|
||||
</p>
|
||||
|
32
Yavsc/Views/DjSettings/Create.cshtml
Normal file
32
Yavsc/Views/DjSettings/Create.cshtml
Normal file
@ -0,0 +1,32 @@
|
||||
@model Yavsc.Models.Musical.Profiles.DjSettings
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h2>Create</h2>
|
||||
|
||||
<form asp-action="Create">
|
||||
<div class="form-horizontal">
|
||||
<h4>DjSettings</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="SoundCloudId" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="SoundCloudId" class="form-control" />
|
||||
<span asp-validation-for="SoundCloudId" class="text-danger" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Create" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
28
Yavsc/Views/DjSettings/Delete.cshtml
Normal file
28
Yavsc/Views/DjSettings/Delete.cshtml
Normal file
@ -0,0 +1,28 @@
|
||||
@model Yavsc.Models.Musical.Profiles.DjSettings
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h2>Delete</h2>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>DjSettings</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.SoundCloudId)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.SoundCloudId)
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<form asp-action="Delete">
|
||||
<div class="form-actions no-color">
|
||||
<input type="submit" value="Delete" class="btn btn-default" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
24
Yavsc/Views/DjSettings/Details.cshtml
Normal file
24
Yavsc/Views/DjSettings/Details.cshtml
Normal file
@ -0,0 +1,24 @@
|
||||
@model Yavsc.Models.Musical.Profiles.DjSettings
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h2>Details</h2>
|
||||
|
||||
<div>
|
||||
<h4>DjSettings</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.SoundCloudId)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.SoundCloudId)
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<p>
|
||||
<a asp-action="Edit" asp-route-id="@Model.UserId">Edit</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</p>
|
33
Yavsc/Views/DjSettings/Edit.cshtml
Normal file
33
Yavsc/Views/DjSettings/Edit.cshtml
Normal file
@ -0,0 +1,33 @@
|
||||
@model Yavsc.Models.Musical.Profiles.DjSettings
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h2>Edit</h2>
|
||||
|
||||
<form asp-action="Edit">
|
||||
<div class="form-horizontal">
|
||||
<h4>DjSettings</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="UserId" />
|
||||
<div class="form-group">
|
||||
<label asp-for="SoundCloudId" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="SoundCloudId" class="form-control" />
|
||||
<span asp-validation-for="SoundCloudId" class="text-danger" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Save" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
32
Yavsc/Views/DjSettings/Index.cshtml
Normal file
32
Yavsc/Views/DjSettings/Index.cshtml
Normal file
@ -0,0 +1,32 @@
|
||||
@model IEnumerable<Yavsc.Models.Musical.Profiles.DjSettings>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h2>Index</h2>
|
||||
|
||||
<p>
|
||||
<a asp-action="Create">Create New</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.SoundCloudId)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.SoundCloudId)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.UserId">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.UserId">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.UserId">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
@ -12,13 +12,13 @@
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
</dl>
|
||||
|
||||
@Html.DisplayFor(m=>m)
|
||||
<form asp-action="Delete">
|
||||
<input type="hidden" asp-for="UserId" />
|
||||
<input type="hidden" asp-for="DoesCode" />
|
||||
<div class="form-actions no-color">
|
||||
<input type="submit" value="Delete" class="btn btn-default" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
<input type="submit" value="Delete" class="btn btn-success" />
|
||||
<a asp-action="Index" class="btn btn-link">Back to List</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
@model UserActivity
|
||||
@model UserActivityViewModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = SR["Details"];
|
||||
@ -7,20 +7,24 @@
|
||||
<h2>@ViewData["Title"]</h2>
|
||||
|
||||
<div>
|
||||
<h4>Détails de votre activité @Model.DoesCode</h4>
|
||||
<h4>Détails de votre activité en <em>@Model.Declaration.Does.Name</em></h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
<dt>@SR["Activity"]</dt>
|
||||
<dd> @Html.DisplayFor(m=>m.Does)
|
||||
@if (ViewBag.HasConfigurableSettings) {
|
||||
<a asp-controller="@ViewBag.SettingsControllerName" asp-action="Index" >
|
||||
[@SR["Manage"] @SR[Model.Does.SettingsClassName]]
|
||||
<dd>@Html.DisplayFor(m=>m.Declaration.Does)
|
||||
@if (Model.NeedsSettings) {
|
||||
<a asp-controller="@ViewBag.ProfileType.Name" asp-action="Index" class="btn btn-default">
|
||||
@SR[Model.Declaration.Does.SettingsClassName]
|
||||
@if (!Model.HasSettings) {
|
||||
<span class="badge">Non renseigné: Cliquez vite<br/> ici pour positionner les<br/> paramêtres de cette activité</span>
|
||||
}
|
||||
|
||||
</a>
|
||||
}
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<p>
|
||||
<a asp-action="Edit" asp-route-id="@Model.UserId" asp-route-activityCode="@Model.DoesCode">Edit</a> |
|
||||
<a asp-action="Edit" asp-route-id="@Model.Declaration.UserId" asp-route-activityCode="@Model.Declaration.DoesCode">Edit</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</p>
|
||||
|
@ -13,6 +13,7 @@
|
||||
<tr>
|
||||
<th>@SR["Activity"]</th>
|
||||
<th>@SR["Weight"]</th>
|
||||
<th>@SR["Settings"]</th>
|
||||
</tr>
|
||||
|
||||
@foreach (var item in Model) {
|
||||
@ -21,6 +22,8 @@
|
||||
</td>
|
||||
<td> @item.Weight
|
||||
</td>
|
||||
<dt>
|
||||
</dt>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.UserId" asp-route-activityCode="@item.DoesCode">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.UserId" asp-route-activityCode="@item.DoesCode">Details</a> |
|
||||
|
22
Yavsc/Views/FormationSettings/Delete.cshtml
Normal file
22
Yavsc/Views/FormationSettings/Delete.cshtml
Normal file
@ -0,0 +1,22 @@
|
||||
@model Yavsc.Models.Workflow.Profiles.FormationSettings
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h2>Delete</h2>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>FormationSettings</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
</dl>
|
||||
|
||||
<form asp-action="Delete">
|
||||
<div class="form-actions no-color">
|
||||
<input type="submit" value="Delete" class="btn btn-default" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
18
Yavsc/Views/FormationSettings/Details.cshtml
Normal file
18
Yavsc/Views/FormationSettings/Details.cshtml
Normal file
@ -0,0 +1,18 @@
|
||||
@model Yavsc.Models.Workflow.Profiles.FormationSettings
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h2>Details</h2>
|
||||
|
||||
<div>
|
||||
<h4>FormationSettings</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
</dl>
|
||||
</div>
|
||||
<p>
|
||||
<a asp-action="Edit" asp-route-id="@Model.UserId">Edit</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</p>
|
26
Yavsc/Views/FormationSettings/Edit.cshtml
Normal file
26
Yavsc/Views/FormationSettings/Edit.cshtml
Normal file
@ -0,0 +1,26 @@
|
||||
@model Yavsc.Models.Workflow.Profiles.FormationSettings
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h2>Edit</h2>
|
||||
|
||||
<form asp-action="Edit">
|
||||
<div class="form-horizontal">
|
||||
<h4>FormationSettings</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="UserId" />
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Save" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
19
Yavsc/Views/FormationSettings/Index.cshtml
Normal file
19
Yavsc/Views/FormationSettings/Index.cshtml
Normal file
@ -0,0 +1,19 @@
|
||||
@model Yavsc.Models.Workflow.Profiles.FormationSettings
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h2>Index</h2>
|
||||
|
||||
@if (Model == null) {
|
||||
<a asp-action="Create" class="btn btn-default">Positionner les paramêtres</a>
|
||||
} else {
|
||||
<a asp-action="Edit" class="btn btn-default">Edit</a>
|
||||
<a asp-action="Delete" asp-route-id="@Model.UserId" class="btn btn-default">Delete</a>
|
||||
<div>
|
||||
<h4>FormationSettings</h4>
|
||||
<hr />
|
||||
</div>
|
||||
}
|
||||
|
22
Yavsc/Views/GeneralSettings/Delete.cshtml
Normal file
22
Yavsc/Views/GeneralSettings/Delete.cshtml
Normal file
@ -0,0 +1,22 @@
|
||||
@model Yavsc.Models.Musical.Profiles.GeneralSettings
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h2>Delete</h2>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>GeneralSettings</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
</dl>
|
||||
|
||||
<form asp-action="Delete">
|
||||
<div class="form-actions no-color">
|
||||
<input type="submit" value="Delete" class="btn btn-default" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
26
Yavsc/Views/GeneralSettings/Edit.cshtml
Normal file
26
Yavsc/Views/GeneralSettings/Edit.cshtml
Normal file
@ -0,0 +1,26 @@
|
||||
@model Yavsc.Models.Musical.Profiles.GeneralSettings
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h2>Edit</h2>
|
||||
|
||||
<form asp-action="Edit">
|
||||
<div class="form-horizontal">
|
||||
<h4>GeneralSettings</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="UserId" />
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Save" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
25
Yavsc/Views/GeneralSettings/Index.cshtml
Normal file
25
Yavsc/Views/GeneralSettings/Index.cshtml
Normal file
@ -0,0 +1,25 @@
|
||||
@model Yavsc.Models.Musical.Profiles.GeneralSettings
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h2>Details</h2>
|
||||
|
||||
<div>
|
||||
<h4>GeneralSettings</h4>
|
||||
<hr />
|
||||
@if (Model!=null) {
|
||||
<dl class="dl-horizontal">
|
||||
</dl>
|
||||
<p>
|
||||
<a asp-action="Delete" asp-route-id="@Model.UserId">@SR["Delete"]</a>
|
||||
</p>
|
||||
}
|
||||
else {
|
||||
<p>
|
||||
@SR["Aucun profile renseigné"]
|
||||
<a asp-action="Create" class="btn btn-success">@SR["Renseigner ce paramêtrage"]</a>
|
||||
</p>
|
||||
}
|
||||
</div>
|
@ -114,8 +114,20 @@ Paul,
|
||||
</environment>
|
||||
|
||||
|
||||
<environment names="Dev">
|
||||
<environment names="Development">
|
||||
<markdown>
|
||||
Site du développeur
|
||||
## Ceci est un site de développement.
|
||||
|
||||
Cette présente ressource ne concerne que le développement du logiciel qui la met en oeuvre.
|
||||
Elle est éphémère, et pratiquement en permanence force de codes 500.
|
||||
|
||||
Veuillez excuser l'équipe de développement pour vous avoir fait part de cette adresse et pour la gêne occasionnnée.
|
||||
|
||||
La "pré-production" affiche les sites suivants:
|
||||
|
||||
* [ZicMoove](http://zicmoove.pschneider.fr)
|
||||
* [Yavsc](http://yavsc.pschneider.fr)
|
||||
* [Lua (le site perso de l'auteur de ce truc)](http://lua.pschneider.fr)
|
||||
|
||||
</markdown>
|
||||
</environment>
|
||||
|
@ -3,7 +3,7 @@
|
||||
@{
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
|
||||
@section subbanner {
|
||||
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000">
|
||||
<ol class="carousel-indicators">
|
||||
@{
|
||||
@ -62,3 +62,5 @@
|
||||
<span class="sr-only">Suivant</span>
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
@ -73,6 +73,7 @@ nav {
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@RenderSection("subbanner", required: false)
|
||||
<main class="container body-content" role="main">
|
||||
@RenderBody()
|
||||
</main>
|
||||
@ -104,7 +105,7 @@ nav {
|
||||
data-ref="ZicMoove"
|
||||
class="fb-like"
|
||||
data-share="true"
|
||||
data-width="200"
|
||||
data-width="300"
|
||||
data-show-faces="true"
|
||||
data-colorscheme="dark">
|
||||
</div>
|
||||
|
@ -29,6 +29,7 @@
|
||||
@using Yavsc.ViewModels.Auth;
|
||||
@using Yavsc.ViewModels.Administration;
|
||||
@using Yavsc.ViewModels.Relationship;
|
||||
@using Yavsc.ViewModels.Workflow;
|
||||
|
||||
@inject IViewLocalizer LocString
|
||||
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
|
||||
|
20
Yavsc/wwwroot/css/bootstrap.css
vendored
20
Yavsc/wwwroot/css/bootstrap.css
vendored
@ -3195,26 +3195,26 @@ fieldset[disabled] .btn-primary.active {
|
||||
}
|
||||
.btn-success {
|
||||
color: #fff;
|
||||
background-color: #255625;
|
||||
border-color: #4cae4c;
|
||||
background-color: #976116;
|
||||
border-color: #b1aa14;
|
||||
}
|
||||
.btn-success:focus,
|
||||
.btn-success.focus {
|
||||
color: #fff;
|
||||
background-color: #2b8a2b;
|
||||
border-color: #255625;
|
||||
background-color: #b1aa14;
|
||||
border-color: #b1aa14;
|
||||
}
|
||||
.btn-success:hover {
|
||||
color: #fff;
|
||||
background-color: #2b8a2b;
|
||||
border-color: #398439;
|
||||
background-color: #b1aa14;
|
||||
border-color: #6a6713;
|
||||
}
|
||||
.btn-success:active,
|
||||
.btn-success.active,
|
||||
.open > .dropdown-toggle.btn-success {
|
||||
color: #fff;
|
||||
background-color: #2b8a2b;
|
||||
border-color: #398439;
|
||||
background-color: #7d780d;
|
||||
border-color: #6a6713;
|
||||
}
|
||||
.btn-success:active:hover,
|
||||
.btn-success.active:hover,
|
||||
@ -3226,8 +3226,8 @@ fieldset[disabled] .btn-primary.active {
|
||||
.btn-success.active.focus,
|
||||
.open > .dropdown-toggle.btn-success.focus {
|
||||
color: #fff;
|
||||
background-color: #398439;
|
||||
border-color: #255625;
|
||||
background-color: #7d780d;
|
||||
border-color: #6a6713;
|
||||
}
|
||||
.btn-success:active,
|
||||
.btn-success.active,
|
||||
|
@ -124,8 +124,10 @@ a:hover {
|
||||
overflow: auto;
|
||||
}
|
||||
.carousel-inner .item {
|
||||
background-color: #301010;
|
||||
/* background-color: #301010; */
|
||||
color: #FF8;
|
||||
margin-left:15%; /* la taille du carousel-control */
|
||||
margin-right:15%; /* la taille du carousel-control */
|
||||
}
|
||||
.carousel-indicators {
|
||||
position: absolute;
|
||||
@ -137,6 +139,14 @@ a:hover {
|
||||
height: 1em;
|
||||
}
|
||||
|
||||
main.container {
|
||||
padding-right: 1em;
|
||||
padding-left: 1em;
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
|
||||
@-webkit-keyframes mymove {
|
||||
from {text-decoration-color: red;}
|
||||
50% {text-decoration-color: blue;}
|
||||
@ -166,14 +176,16 @@ footer {
|
||||
.display-field {
|
||||
font-kerning: none;
|
||||
display: inline-flex;
|
||||
color: #FF8;
|
||||
background-color: #502020;
|
||||
}
|
||||
|
||||
.display-label {
|
||||
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
|
||||
font-stretch: condensed;
|
||||
display: inline-flex;
|
||||
color: rgb(127,127,127);
|
||||
background-color: rgba(200,256,200,.4);
|
||||
color: #A0A0A0;
|
||||
background-color: #210912;
|
||||
}
|
||||
|
||||
footer {
|
||||
|
4
Yavsc/wwwroot/css/site.min.css
vendored
4
Yavsc/wwwroot/css/site.min.css
vendored
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
BIN
Yavsc/wwwroot/images/it/floss-license-dark-v.png
Normal file
BIN
Yavsc/wwwroot/images/it/floss-license-dark-v.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 108 KiB |
@ -12,5 +12,6 @@
|
||||
long Id { get; set; }
|
||||
string OwnerId { get; set; }
|
||||
string Title { get; set; }
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user