refactoring

This commit is contained in:
Paul Schneider 2017-02-12 22:20:57 +01:00
commit 16df0a199a
26 changed files with 62 additions and 37 deletions

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;