Vehicle Recall integrated into Vehicle Service
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using AutoMapper;
|
||||
using MileageTraker.Web.Attributes;
|
||||
@@ -13,12 +14,7 @@ namespace MileageTraker.Web.ViewModels.VehicleService
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public int? VehicleServiceId { get; set; }
|
||||
|
||||
[Required]
|
||||
[Remote("Exists", "Vehicle", ErrorMessage = "ID not found")]
|
||||
[StringLength(6, MinimumLength = 4, ErrorMessage = "Must be at least a 4 digit number")]
|
||||
[Display(Name = "Vehicle ID")]
|
||||
[RegularExpression(@"\d+", ErrorMessage = "Vehicle ID must be all numbers")]
|
||||
[InputSize("mini")]
|
||||
[HiddenInput(DisplayValue = true)]
|
||||
public string VehicleId { get; set; }
|
||||
|
||||
[DataType(DataType.DateTime)]
|
||||
@@ -43,15 +39,15 @@ namespace MileageTraker.Web.ViewModels.VehicleService
|
||||
[Currency]
|
||||
public decimal Price { get; set; }
|
||||
|
||||
[StringLength(64, MinimumLength = 3, ErrorMessage = "Minimum 3 characters")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[Display(Name = "Vehicle Recall")]
|
||||
[OptionLabel("Not a recall")]
|
||||
[UIHint("VehicleRecallSelectListViewModel")]
|
||||
public SelectListViewModel VehicleRecall { get; set; }
|
||||
|
||||
[StringLength(64, MinimumLength = 3, ErrorMessage = "Minimum 3 characters")]
|
||||
public string Description { get; set; }
|
||||
|
||||
static VehicleServiceViewModel()
|
||||
static VehicleServiceViewModel()
|
||||
{
|
||||
Mapper.CreateMap<VehicleServiceViewModel, Models.VehicleService>();
|
||||
Mapper.CreateMap<Models.VehicleService, VehicleServiceViewModel>()
|
||||
|
||||
Reference in New Issue
Block a user