public void Training(TrainingProfileViewModel model) { var training = TrainingProfileModel.ToDomainModel(model.Training); if (training.TrainingId <= 0 || !training.LastTrainingDate.HasValue || training.LastTrainingDate.Value.Ticks <= 0) { return; } training.DealerManpowerId = model.ProfileId; trainingProfileMapService.AddTrainingProfileMap(new[] { training }); }
public PartialViewResult Training(int id) { var manpower = manpowerService.GetDealerManpower(id); var model = new TrainingProfileViewModel { Trainings = masterService.FindTraining(x => x.Designation.ToLower() == manpower.Type.ToLower()).Select(x => new KeyValuePair<int, string>(x.Id, x.Name)), ProfileId = id, Training = new TrainingProfileModel() }; return PartialView("TrainingPartial", model); }