Fuel Log Import basic functionality

This commit is contained in:
2015-09-18 13:02:15 -04:00
parent 4987215f0b
commit e3590b29e5
18 changed files with 438 additions and 59 deletions
@@ -1,30 +0,0 @@
using System.Collections.Generic;
using MileageTraker.Web.Models;
using MileageTraker.Web.ViewModels.Log;
namespace MileageTraker.Web.ViewModels.FuelLog
{
public class FuelLogResultsViewModel
{
public IEnumerable<Models.FuelLog> Logs { get; set; }
public Dictionary<string, List<string>> AvailableYearMonths { get; set; }
public IEnumerable<string> SelectedYearMonths{get
{
if (!string.IsNullOrEmpty(Year))
return AvailableYearMonths[Year];
return new List<string>();
}}
// filter parameters
public string Year { get; set; }
public string Month { get; set; }
public FuelLogResultsViewModel(IEnumerable<Models.FuelLog> logs, FuelLogQueryViewModel query, Dictionary<string, List<string>> availableYearMonths)
{
Logs = logs;
AvailableYearMonths = availableYearMonths;
Year = query.Year.HasValue ? query.Year.Value.ToString() : string.Empty;
Month = query.Month.HasValue ? query.Month.Value.ToString() : string.Empty;
}
}
}