refactoring

This commit is contained in:
2017-02-12 22:20:57 +01:00
parent b3283e4fd4
commit 0acfc2e3b2
26 changed files with 62 additions and 37 deletions

View File

@ -1,7 +1,7 @@
namespace Yavsc.ApiControllers namespace Yavsc.ApiControllers
{ {
using Models; using Models;
using Models.Booking.Profiles; using Models.Musical.Profiles;
public class DjProfileApiController : ProfileApiController<DjSettings> public class DjProfileApiController : ProfileApiController<DjSettings>
{ {

View File

@ -4,7 +4,7 @@ using Microsoft.AspNet.Http;
using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc;
using Microsoft.Data.Entity; using Microsoft.Data.Entity;
using Yavsc.Models; using Yavsc.Models;
using Yavsc.Models.Booking; using Yavsc.Models.Musical;
namespace Yavsc.Controllers namespace Yavsc.Controllers
{ {

View File

@ -4,7 +4,7 @@ using Microsoft.AspNet.Http;
using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc;
using Microsoft.Data.Entity; using Microsoft.Data.Entity;
using Yavsc.Models; using Yavsc.Models;
using Yavsc.Models.Booking; using Yavsc.Models.Musical;
namespace Yavsc.Controllers namespace Yavsc.Controllers
{ {

View File

@ -24,14 +24,14 @@ namespace Yavsc.Controllers
} }
// GET: Colors/Details/5 // GET: Colors/Details/5
public async Task<IActionResult> Details(byte? id) public async Task<IActionResult> Details(long? id)
{ {
if (id == null) if (id == null)
{ {
return HttpNotFound(); return HttpNotFound();
} }
Color color = await _context.Color.SingleAsync(m => m.Red == id); Color color = await _context.Color.SingleAsync(m => m.Id == id);
if (color == null) if (color == null)
{ {
return HttpNotFound(); return HttpNotFound();
@ -61,14 +61,14 @@ namespace Yavsc.Controllers
} }
// GET: Colors/Edit/5 // GET: Colors/Edit/5
public async Task<IActionResult> Edit(byte? id) public async Task<IActionResult> Edit(long? id)
{ {
if (id == null) if (id == null)
{ {
return HttpNotFound(); return HttpNotFound();
} }
Color color = await _context.Color.SingleAsync(m => m.Red == id); Color color = await _context.Color.SingleAsync(m => m.Id == id);
if (color == null) if (color == null)
{ {
return HttpNotFound(); return HttpNotFound();
@ -92,14 +92,14 @@ namespace Yavsc.Controllers
// GET: Colors/Delete/5 // GET: Colors/Delete/5
[ActionName("Delete")] [ActionName("Delete")]
public async Task<IActionResult> Delete(byte? id) public async Task<IActionResult> Delete(long? id)
{ {
if (id == null) if (id == null)
{ {
return HttpNotFound(); return HttpNotFound();
} }
Color color = await _context.Color.SingleAsync(m => m.Red == id); Color color = await _context.Color.SingleAsync(m => m.Id == id);
if (color == null) if (color == null)
{ {
return HttpNotFound(); return HttpNotFound();
@ -111,9 +111,9 @@ namespace Yavsc.Controllers
// POST: Colors/Delete/5 // POST: Colors/Delete/5
[HttpPost, ActionName("Delete")] [HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken] [ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(byte id) public async Task<IActionResult> DeleteConfirmed(long id)
{ {
Color color = await _context.Color.SingleAsync(m => m.Red == id); Color color = await _context.Color.SingleAsync(m => m.Id == id);
_context.Color.Remove(color); _context.Color.Remove(color);
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
return RedirectToAction("Index"); return RedirectToAction("Index");

View File

@ -6,7 +6,7 @@ using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Rendering; using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.Data.Entity; using Microsoft.Data.Entity;
using Yavsc.Models; using Yavsc.Models;
using Yavsc.Models.Booking.Profiles; using Yavsc.Models.Musical.Profiles;
namespace Yavsc.Controllers namespace Yavsc.Controllers
{ {

View File

@ -4,7 +4,7 @@ using Microsoft.AspNet.Mvc;
namespace Yavsc.Controllers namespace Yavsc.Controllers
{ {
using Models; using Models;
using Models.Booking; using Models.Musical;
public class InstrumentsController : Controller public class InstrumentsController : Controller
{ {
private ApplicationDbContext _context; private ApplicationDbContext _context;

View File

@ -4,7 +4,7 @@ using Microsoft.AspNet.Mvc;
namespace Yavsc.Controllers namespace Yavsc.Controllers
{ {
using Models; using Models;
using Models.Booking; using Models.Musical;
public class MusicalTendenciesController : Controller public class MusicalTendenciesController : Controller
{ {
private ApplicationDbContext _context; private ApplicationDbContext _context;

View File

@ -17,7 +17,7 @@ namespace Yavsc.Models
using YavscLib; using YavscLib;
using Auth; using Auth;
using Billing; using Billing;
using Booking; using Musical;
using OAuth; using OAuth;
using Workflow; using Workflow;
using Identity; using Identity;
@ -25,7 +25,7 @@ namespace Yavsc.Models
using Chat; using Chat;
using Messaging; using Messaging;
using Access; using Access;
using Booking.Profiles; using Musical.Profiles;
using Workflow.Profiles; using Workflow.Profiles;
using Drawing; using Drawing;
public class ApplicationDbContext : IdentityDbContext<ApplicationUser> public class ApplicationDbContext : IdentityDbContext<ApplicationUser>

View File

@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Yavsc.Models.Booking namespace Yavsc.Models.Musical
{ {
public class Instrument public class Instrument
{ {

View File

@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Models.Workflow; using Yavsc.Models.Workflow;
namespace Yavsc.Models.Booking namespace Yavsc.Models.Musical
{ {
public class InstrumentRating public class InstrumentRating
{ {

View File

@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Yavsc.Models.Booking namespace Yavsc.Models.Musical
{ {
public class MusicalPreference { public class MusicalPreference {

View File

@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Yavsc.Models.Booking { namespace Yavsc.Models.Musical {

View File

@ -2,7 +2,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Models.Workflow; using Yavsc.Models.Workflow;
namespace Yavsc.Models.Booking namespace Yavsc.Models.Musical
{ {
public class DjPerformerProfile : SpecializationSettings public class DjPerformerProfile : SpecializationSettings
{ {

View File

@ -2,7 +2,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using YavscLib; using YavscLib;
namespace Yavsc.Models.Booking.Profiles namespace Yavsc.Models.Musical.Profiles
{ {
public class DjSettings : ISpecializationSettings public class DjSettings : ISpecializationSettings
{ {

View File

@ -2,7 +2,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Models.Workflow; using Yavsc.Models.Workflow;
namespace Yavsc.Models.Booking.Profiles namespace Yavsc.Models.Musical.Profiles
{ {
public class FormationPerformerProfile public class FormationPerformerProfile
{ {

View File

@ -2,7 +2,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using YavscLib; using YavscLib;
namespace Yavsc.Models.Booking.Profiles namespace Yavsc.Models.Musical.Profiles
{ {
public class GeneralSettings : ISpecializationSettings public class GeneralSettings : ISpecializationSettings
{ {

View File

@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Models.Workflow; using Yavsc.Models.Workflow;
using YavscLib; using YavscLib;
namespace Yavsc.Models.Booking.Profiles namespace Yavsc.Models.Musical.Profiles
{ {
public class Instrumentation : ISpecializationSettings public class Instrumentation : ISpecializationSettings
{ {

View File

@ -2,7 +2,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Models.Workflow; using Yavsc.Models.Workflow;
namespace Yavsc.Models.Booking namespace Yavsc.Models.Musical
{ {
public class MusicianPerformerProfile : PerformerProfile public class MusicianPerformerProfile : PerformerProfile
{ {

View File

@ -2,7 +2,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Models.Workflow; using Yavsc.Models.Workflow;
namespace Yavsc.Models.Booking.Profiles namespace Yavsc.Models.Musical.Profiles
{ {
public class StarPerformerProfile : PerformerProfile public class StarPerformerProfile : PerformerProfile
{ {

View File

@ -25,7 +25,6 @@
<div class="col-md-10"> <div class="col-md-10">
@await Html.PartialAsync("ColorEditor",Model) @await Html.PartialAsync("ColorEditor",Model)
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

View File

@ -15,11 +15,13 @@
@Html.DisplayNameFor(model => model.Name) @Html.DisplayNameFor(model => model.Name)
</dt> </dt>
<dd> <dd>
@Html.DisplayFor(model => model)
@Html.DisplayFor(model => model.Name) @Html.DisplayFor(model => model.Name)
</dd> </dd>
</dl> </dl>
<form asp-action="Delete"> <form asp-action="Delete">
<input type="hidden" asp-for="Id" />
<div class="form-actions no-color"> <div class="form-actions no-color">
<input type="submit" value="Delete" class="btn btn-default" /> | <input type="submit" value="Delete" class="btn btn-default" /> |
<a asp-action="Index">Back to List</a> <a asp-action="Index">Back to List</a>

View File

@ -14,13 +14,13 @@
@Html.DisplayNameFor(model => model.Name) @Html.DisplayNameFor(model => model.Name)
</dt> </dt>
<dd> <dd>
@Html.DisplayFor(model => model.Color) @Html.DisplayFor(model => model)
@Html.DisplayFor(model => model.Name) @Html.DisplayFor(model => model.Name)
</dd> </dd>
</dl> </dl>
</div> </div>
<p> <p>
@Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) | @Html.ActionLink("Edit", "Edit", new { id = Model.Id }) |
<a asp-action="Index">Back to List</a> <a asp-action="Index">Back to List</a>
</p> </p>

View File

@ -21,6 +21,15 @@
<span asp-validation-for="Name" class="text-danger" /> <span asp-validation-for="Name" class="text-danger" />
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-md-2 control-label">
Indication de couleur
</label>
<div class="col-md-10">
@await Html.PartialAsync("ColorEditor",Model)
</div>
</div>
<input type="hidden" asp-for="Id" />
<div class="form-group"> <div class="form-group">
<div class="col-md-offset-2 col-md-10"> <div class="col-md-offset-2 col-md-10">
<input type="submit" value="Save" class="btn btn-default" /> <input type="submit" value="Save" class="btn btn-default" />

View File

@ -24,9 +24,9 @@
@Html.DisplayFor(l => item.Name) @Html.DisplayFor(l => item.Name)
</td> </td>
<td> <td>
@Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) | @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
@Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) | @Html.ActionLink("Details", "Details", new {id = item.Id }) |
@Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ }) @Html.ActionLink("Delete", "Delete", new { id = item.Id })
</td> </td>
</tr> </tr>
} }

View File

@ -18,8 +18,23 @@
var green = @Model.Green; var green = @Model.Green;
var blue = @Model.Blue; var blue = @Model.Blue;
$(".slider").slider( $("#sred").slider(
{ {
value: red,
min: 0,
max: 255,
animate: "fast"
});
$("#sgreen").slider(
{
value: green,
min: 0,
max: 255,
animate: "fast"
});
$("#sblue").slider(
{
value: blue,
min: 0, min: 0,
max: 255, max: 255,
animate: "fast" animate: "fast"
@ -43,6 +58,7 @@
blue=ui.value; blue=ui.value;
updateColor(); updateColor();
}); });
updateColor();
}); });
</script> </script>

View File

@ -18,7 +18,6 @@
<script src="~/js/jquery-ui.js"></script> <script src="~/js/jquery-ui.js"></script>
<script src="~/js/bootstrap.js"></script> <script src="~/js/bootstrap.js"></script>
<script src="~/js/site.js"></script> <script src="~/js/site.js"></script>
<script src="~/js/jquery.signalR-2.2.1.js"></script>
</environment> </environment>
<environment names="Staging,Production,yavsc,yavscpre,zicmoove,lua"> <environment names="Staging,Production,yavsc,yavscpre,zicmoove,lua">
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.4.min.js" <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.4.min.js"
@ -29,10 +28,10 @@
asp-fallback-src="~/bower_components/bootstrap/dist/js/bootstrap.min.js" asp-fallback-src="~/bower_components/bootstrap/dist/js/bootstrap.min.js"
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"> asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal">
</script> </script>
<script src="~/js/site.js"></script>
<script src="~/js/jquery-ui.js"></script> <script src="~/js/jquery-ui.js"></script>
<script src="~/js/jquery.signalR-2.2.1.js"></script> <script src="~/js/site.js"></script>
</environment> </environment>
<script src="~/js/jquery.signalR-2.2.1.js"></script>
@RenderSection("header", required: false) @RenderSection("header", required: false)
</head> </head>
<body> <body>