Add vehicle service controller and view

This commit is contained in:
2015-10-07 23:29:10 -04:00
parent 306381b3c6
commit b962ecb119
11 changed files with 269 additions and 2 deletions
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
namespace MileageTraker.Web.ViewModels.VehicleService
{
public class VehicleServiceQueryViewModel
{
public int? Year { get; set; }
public int? Month { get; set; }
public string YearMonthStart {get
{
return string.Format("{0}-{1:00}", Year, Month);
}}
public override string ToString()
{
var v = new List<string>();
if (Year.HasValue && Month.HasValue)
{
var str = YearMonthStart;
v.Add(str);
}
else if (Year.HasValue)
{
v.Add(Year.ToString());
}
return String.Join("_", v).Replace(' ', '-');
}
public bool HasParameters()
{
return Year.HasValue;
}
}
}