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