New style partially complete
This commit is contained in:
@@ -17,12 +17,14 @@ namespace MileageTraker.Web.Models
|
||||
[Remote("Exists", "Vehicle", ErrorMessage = "ID not found")]
|
||||
[StringLength(6, MinimumLength = 4, ErrorMessage = "Enter 4 digit number")]
|
||||
[Display(Name = "Vehicle ID")]
|
||||
[InputSize("mini")]
|
||||
[RegularExpression(@"\d+", ErrorMessage = "Enter only numbers")]
|
||||
public string VehicleId { get; set; }
|
||||
|
||||
[Required]
|
||||
[Range(1, 500000, ErrorMessage = "Between 1 and 500k")]
|
||||
[Display(Name = "End Odometer")]
|
||||
[InputSize("small")]
|
||||
[Units("Miles")]
|
||||
public int EndOdometer { get; set; }
|
||||
|
||||
@@ -33,17 +35,20 @@ namespace MileageTraker.Web.Models
|
||||
|
||||
[Required]
|
||||
[StringLength(64, MinimumLength = 3, ErrorMessage = "Minimum 3 characters")]
|
||||
[InputSize("medium")]
|
||||
public string CityName { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Employee / Driver")]
|
||||
[RegularExpression(@"[A-Za-z().]+(\s+[A-Za-z().]+)+", ErrorMessage = "Need complete name")]
|
||||
[InputSize("medium")]
|
||||
public string EmployeeName { get; set; }
|
||||
|
||||
[Range(0, 50)]
|
||||
[DisplayFormat(DataFormatString = "{0:0.000}", ApplyFormatInEditMode = true)]
|
||||
[Units("Gallons")]
|
||||
[FormatHint("n.nnnn")]
|
||||
[InputSize("mini")]
|
||||
public double GasPurchased { get; set; }
|
||||
|
||||
[Required]
|
||||
@@ -51,6 +56,7 @@ namespace MileageTraker.Web.Models
|
||||
[DisplayFormat(DataFormatString = @"{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)]
|
||||
[DenyFutureDate(ErrorMessage = "Future date")]
|
||||
[FormatHint("mm/dd/yyyy")]
|
||||
[InputSize("small")]
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
[Display(Name = "Time Created")]
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace MileageTraker.Web.Models
|
||||
public class Vehicle
|
||||
{
|
||||
[Required]
|
||||
[InputSize("mini")]
|
||||
public int Key { get; set; }
|
||||
|
||||
[Key]
|
||||
@@ -14,36 +15,46 @@ namespace MileageTraker.Web.Models
|
||||
[StringLength(6, MinimumLength = 4, ErrorMessage = "Must be at least a 4 digit number")]
|
||||
[Display(Name = "EHTRA ID")]
|
||||
[RegularExpression(@"\d+", ErrorMessage = "Vehicle ID must be all numbers")]
|
||||
[InputSize("mini")]
|
||||
public string VehicleId { get; set; }
|
||||
|
||||
[Required]
|
||||
[RegularExpression(@"\d{4}", ErrorMessage = "Must be 4 numbers")]
|
||||
[InputSize("mini")]
|
||||
public string ModelYear { get; set; }
|
||||
|
||||
[Required]
|
||||
[InputSize("medium")]
|
||||
public string Make { get; set; }
|
||||
|
||||
[Display(Name = "Model")]
|
||||
[Required]
|
||||
[InputSize("medium")]
|
||||
public string CarModel { get; set; }
|
||||
|
||||
[InputSize("small")]
|
||||
public string Color { get; set; }
|
||||
|
||||
[Required]
|
||||
[RegularExpression(@"Car|Truck|SUV|Van", ErrorMessage = "Must be Car, Truck, SUV, or Van")]
|
||||
[FormatHint("Car, Truck, SUV or Van")]
|
||||
[InputSize("mini")]
|
||||
public string Type { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "VIN")]
|
||||
[RegularExpression(@"[0-9A-HJ-NPR-Z]{17}", ErrorMessage = "VIN must be 17-characters, not including letters I, O or Q")]
|
||||
[InputSize("large")]
|
||||
public string Vin { get; set; }
|
||||
|
||||
[Required]
|
||||
[InputSize("small")]
|
||||
public decimal Price { get; set; }
|
||||
|
||||
[Required]
|
||||
[RegularExpression(@"\d{1,2}/\d{2}", ErrorMessage = "PurDate must be in mm/yy format")]
|
||||
[InputSize("small")]
|
||||
[FormatHint("mm/yy")]
|
||||
public string PurDate { get; set; }
|
||||
|
||||
[Required]
|
||||
@@ -51,16 +62,19 @@ namespace MileageTraker.Web.Models
|
||||
public string TagNumber { get; set; }
|
||||
|
||||
[Required]
|
||||
[InputSize("small")]
|
||||
public string Prog { get; set; }
|
||||
|
||||
[RegularExpression(@"Unassigned|[A-Za-z().]+(\s+[A-Za-z().]+)+", ErrorMessage = "Please enter the full name")]
|
||||
[DisplayFormat(NullDisplayText = "Unassigned")]
|
||||
public string Assigned { get; set; }
|
||||
|
||||
[InputSize("medium")]
|
||||
public string Notes { get; set; }
|
||||
|
||||
[Display(Name = "Current Odometer", ShortName= "ODO")]
|
||||
[DisplayFormat(NullDisplayText = "?")]
|
||||
[InputSize("small")]
|
||||
public int? CurrentOdometer { get; set; }
|
||||
|
||||
public virtual ICollection<Log> Logs { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user