Replace previous log search for log detail page
This commit is contained in:
@@ -73,10 +73,7 @@ namespace MileageTraker.Web.DAL
|
||||
{
|
||||
var log = _db.Logs.Find(id);
|
||||
|
||||
var nextLog =
|
||||
(from l in _db.Logs
|
||||
where l.VehiclePreviousLogId == log.LogId
|
||||
select l).FirstOrDefault();
|
||||
var nextLog = GetNextLog(log.LogId);
|
||||
if (nextLog != null)
|
||||
nextLog.VehiclePreviousLog = log.VehiclePreviousLog;
|
||||
|
||||
@@ -96,6 +93,14 @@ namespace MileageTraker.Web.DAL
|
||||
return _db.Logs.Find(id);
|
||||
}
|
||||
|
||||
public Log GetNextLog(int id)
|
||||
{
|
||||
return
|
||||
(from l in _db.Logs
|
||||
where l.VehiclePreviousLogId == id
|
||||
select l).FirstOrDefault();
|
||||
}
|
||||
|
||||
public IEnumerable<int> GetValidLogYears()
|
||||
{
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user