refactoring
This commit is contained in:
parent
fab5854f8b
commit
16df0a199a
26 changed files with 62 additions and 37 deletions
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue