public List <TechnicalSkillsSetViewModel> returnList() { List <TechnicalSkillsSetViewModel> model = new List <TechnicalSkillsSetViewModel>(); List <SkillSet> data = _technicalSkillsSetMethod.getAllList(); string FilePath = ConfigurationManager.AppSettings["SkillSetFilePath"].ToString(); foreach (var item in data) { TechnicalSkillsSetViewModel technicalSkillsSetViewModel = new TechnicalSkillsSetViewModel(); technicalSkillsSetViewModel.Id = item.Id; technicalSkillsSetViewModel.Name = item.Name; technicalSkillsSetViewModel.Description = item.Description; if (!string.IsNullOrEmpty(item.Picture)) { technicalSkillsSetViewModel.Picture = item.Picture; } model.Add(technicalSkillsSetViewModel); } return(model); }
public ActionResult AddEditTechnicalSkillsSet(int Id) { string FilePath = ConfigurationManager.AppSettings["SkillSetFilePath"].ToString(); TechnicalSkillsSetViewModel model = new TechnicalSkillsSetViewModel(); model.Id = Id; var technicalSkillList = _otherSettingMethod.getAllSystemValueListByKeyName("Technical Skills"); foreach (var item in technicalSkillList) { model.SkillValueList.Add(new SelectListItem() { Text = @item.Value, Value = @item.Id.ToString() }); } if (Id > 0) { var SkillSets = _technicalSkillsSetMethod.getSkillSetById(Id); model.Name = SkillSets.Name; model.Archived = (bool)SkillSets.Archived; model.Description = SkillSets.Description; model.TechnicalSkillsCSV = SkillSets.TechnicalSkillsCSV; if (SkillSets.TechnicalSkillsCSV.IndexOf(',') > 0) { model.selectedValues = SkillSets.TechnicalSkillsCSV.Split(',').ToList(); } else { if (!string.IsNullOrEmpty(SkillSets.TechnicalSkillsCSV)) { string record = SkillSets.TechnicalSkillsCSV; model.selectedValues.Add(record); } } if (!string.IsNullOrEmpty(SkillSets.Picture)) { model.Picture = SkillSets.Picture; } } return(PartialView("_partialAddTechnicalSkillsSet", model)); }