Replace Log.EmployeeName with Log.User, drop from database
This commit is contained in:
@@ -18,8 +18,7 @@ namespace MileageTraker.Web.ViewModels.CreateLog
|
||||
static ConfirmCreateLogViewModel()
|
||||
{
|
||||
Mapper.CreateMap<CreateLogViewModel, ConfirmCreateLogViewModel>()
|
||||
.ForMember(c => c.CityName, opt => opt.AddFormatter(new TitleCaseFormatter()))
|
||||
.ForMember(c => c.EmployeeName, opt => opt.AddFormatter(new TitleCaseFormatter()));
|
||||
.ForMember(c => c.CityName, opt => opt.AddFormatter(new TitleCaseFormatter()));
|
||||
}
|
||||
|
||||
public ConfirmCreateLogViewModel(CreateLogViewModel createLogViewModel)
|
||||
@@ -41,11 +40,6 @@ namespace MileageTraker.Web.ViewModels.CreateLog
|
||||
Miles = endOdometer - previousLog.EndOdometer;
|
||||
}
|
||||
|
||||
var matchingEmployeeName = dataService.GetEmployeeNameCorrected(EmployeeName);
|
||||
|
||||
if (!string.IsNullOrEmpty(matchingEmployeeName))
|
||||
EmployeeName = matchingEmployeeName;
|
||||
|
||||
var matchingCity = dataService.GetCitiesCorrected(CityName);
|
||||
|
||||
if (!string.IsNullOrEmpty(matchingCity))
|
||||
|
||||
@@ -32,13 +32,7 @@ namespace MileageTraker.Web.ViewModels.CreateLog
|
||||
[Display(Name = "Type")]
|
||||
[NoEditLabel]
|
||||
public MileageLogTypeWrapper LogType { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Required")]
|
||||
[Display(Name = "Employee / Driver")]
|
||||
[RegularExpression(@"[A-Za-z().]+(\s+[A-Za-z().]+)+", ErrorMessage = "Need complete name")]
|
||||
[InputSize("medium")]
|
||||
public string EmployeeName { get; set; }
|
||||
|
||||
|
||||
[Required(ErrorMessage = "Required")]
|
||||
[Display(Name = "City Name")]
|
||||
[InputSize("medium")]
|
||||
|
||||
Reference in New Issue
Block a user