Add currency attribute
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Web.Mvc;
|
||||
using AutoMapper;
|
||||
using MileageTraker.Web.Attributes;
|
||||
using MileageTraker.Web.ViewModels.Log;
|
||||
|
||||
namespace MileageTraker.Web.ViewModels.FuelLog
|
||||
@@ -44,6 +45,7 @@ namespace MileageTraker.Web.ViewModels.FuelLog
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Total Price")]
|
||||
[Currency]
|
||||
public decimal TotalPrice { get; set; }
|
||||
|
||||
// Matched log
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace MileageTraker.Web.ViewModels.VehicleService
|
||||
|
||||
[Required]
|
||||
[InputSize("small")]
|
||||
[Units("$")]
|
||||
[Currency]
|
||||
public decimal Price { get; set; }
|
||||
|
||||
[StringLength(64, MinimumLength = 3, ErrorMessage = "Minimum 3 characters")]
|
||||
@@ -45,7 +45,8 @@ namespace MileageTraker.Web.ViewModels.VehicleService
|
||||
static VehicleServiceViewModel()
|
||||
{
|
||||
Mapper.CreateMap<VehicleServiceViewModel, Models.VehicleService>();
|
||||
Mapper.CreateMap<Models.VehicleService, VehicleServiceViewModel>();
|
||||
Mapper.CreateMap<Models.VehicleService, VehicleServiceViewModel>()
|
||||
.ForMember(dest => dest.VehicleId, opt => opt.MapFrom(src => src.Vehicle.VehicleId));
|
||||
}
|
||||
|
||||
public VehicleServiceViewModel(Models.VehicleService vehicleService)
|
||||
|
||||
Reference in New Issue
Block a user