public JsonResult Add(Skills skill) { MTSHRDataLayer.Skills data_skills = new MTSHRDataLayer.Skills(); int result = data_skills.Create(skill.Skill); return(Json(new { success = result }, JsonRequestBehavior.AllowGet)); }
// // GET: /UserSkills/ public object GetAllSkills() { MTSHRDataLayer.Skills Skilldata = new MTSHRDataLayer.Skills(); var Skills = Skilldata.Read(); List <SelectListItem> Skillslist = new List <SelectListItem>(); for (int i = 0; i < Skills.Rows.Count; i++) { SelectListItem li = new SelectListItem(); li.Value = Skills.Rows[i]["id"].ToString(); li.Text = Skills.Rows[i]["Skills"].ToString(); Skillslist.Add(li); } return(JsonConvert.SerializeObject(Skillslist)); }
public JsonResult Read() { MTSHRDataLayer.Skills skills = new MTSHRDataLayer.Skills(); return(Json(JsonConvert.SerializeObject(skills.Read()), JsonRequestBehavior.AllowGet)); }