Example #1
0
 public void EditCompetency(CompetencyViewModel model)
 {
     var competency = CompetencyModel.ToDomainModel(model.Competency);
     if (competency.Id > 0) {
         masterService.UpdateCompetency(competency);
     } else {
         masterService.AddCompetencies(new[] { competency });
         //Add New Competency to CompetencyProfileMap
         var manpowerIds =
             dealerManpowerService.GetAllDealerManpowers().Select(x => x.Id);
         var list = manpowerIds.Select(id => new CompetencyProfileMap { Id = 0, CompetencyId = competency.Id, DealerManpowerId = id, Score = 0 }).ToList();
         competencyProfileMapService.AddCompetencyProfileMap(list);
     }
 }
Example #2
0
 public ActionResult EditCompetency(int id)
 {
     var model = new CompetencyViewModel {
         Competency = id > 0 ? CompetencyModel.FromDomainModel(masterService.GetCompetency(id)) : new CompetencyModel(),
         Designations = Enumeration.GetAll<Designation>()
     };
     return PartialView("EditCompetency", model);
 }