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
{
using Models;
using Models.Booking.Profiles;
using Models.Musical.Profiles;
public class DjProfileApiController : ProfileApiController<DjSettings>
{

View File

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

View File

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

View File

@ -24,14 +24,14 @@ namespace Yavsc.Controllers
}
// GET: Colors/Details/5
public async Task<IActionResult> Details(byte? id)
public async Task<IActionResult> Details(long? id)
{
if (id == null)
{
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)
{
return HttpNotFound();
@ -61,14 +61,14 @@ namespace Yavsc.Controllers
}
// GET: Colors/Edit/5
public async Task<IActionResult> Edit(byte? id)
public async Task<IActionResult> Edit(long? id)
{
if (id == null)
{
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)
{
return HttpNotFound();
@ -92,14 +92,14 @@ namespace Yavsc.Controllers
// GET: Colors/Delete/5
[ActionName("Delete")]
public async Task<IActionResult> Delete(byte? id)
public async Task<IActionResult> Delete(long? id)
{
if (id == null)
{
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)
{
return HttpNotFound();
@ -111,9 +111,9 @@ namespace Yavsc.Controllers
// POST: Colors/Delete/5
[HttpPost, ActionName("Delete")]
[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);
await _context.SaveChangesAsync();
return RedirectToAction("Index");

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
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 Yavsc.Models.Workflow;
namespace Yavsc.Models.Booking
namespace Yavsc.Models.Musical
{
public class DjPerformerProfile : SpecializationSettings
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -14,13 +14,13 @@
@Html.DisplayNameFor(model => model.Name)
</dt>
<dd>
@Html.DisplayFor(model => model.Color)
@Html.DisplayFor(model => model)
@Html.DisplayFor(model => model.Name)
</dd>
</dl>
</div>
<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>
</p>

View File

@ -21,6 +21,15 @@
<span asp-validation-for="Name" class="text-danger" />
</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="col-md-offset-2 col-md-10">
<input type="submit" value="Save" class="btn btn-default" />

View File

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

View File

@ -18,8 +18,23 @@
var green = @Model.Green;
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,
max: 255,
animate: "fast"
@ -43,6 +58,7 @@
blue=ui.value;
updateColor();
});
updateColor();
});
</script>

View File

@ -18,7 +18,6 @@
<script src="~/js/jquery-ui.js"></script>
<script src="~/js/bootstrap.js"></script>
<script src="~/js/site.js"></script>
<script src="~/js/jquery.signalR-2.2.1.js"></script>
</environment>
<environment names="Staging,Production,yavsc,yavscpre,zicmoove,lua">
<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-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal">
</script>
<script src="~/js/site.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>
<script src="~/js/jquery.signalR-2.2.1.js"></script>
@RenderSection("header", required: false)
</head>
<body>