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")]
|
||||
|
||||
Reference in New Issue
Block a user