This commit is contained in:
2013-02-17 14:30:25 -05:00
parent 07a7577d2d
commit 84e460bb51
7 changed files with 57 additions and 28 deletions
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace MileageTraker.Web.ViewModels.Vehicle
{
@@ -10,5 +12,8 @@ namespace MileageTraker.Web.ViewModels.Vehicle
public double GasPurchased { get; set; }
public string Prog { get; set; }
public IEnumerable<Tuple<Models.Log, Models.Log>> LogPairs { get; set; }
public int TripCount { get { return LogPairs.Count(); } }
[DisplayFormat(DataFormatString = "{0:0.000}")]
public double MilesPerGallon { get { return GasPurchased == 0 || Miles == 0 ? 0 : Miles / GasPurchased; } }
}
}