public ActionResult Combo2() { instructorBLL = new InstructorBLLImp(); List <InstructorGym> instructoresList; instructoresList = instructorBLL.BuscarTodos(Session["empresa"].ToString()); String htmlCode = "<select name=\"Instructor\" class=\"form - control\" data-title=\"Seleccione Opcion\" data-style=\"btn-default btn- block\" data-menu-style=\"dropdown-blue\" id=\"InstructoresIng2\">"; foreach (InstructorGym ins in instructoresList) { htmlCode += "<option value = \"" + ins.idInstructor + "\" > " + string.Format("{0} {1}", ins.nombre, ins.apellido1) + " </option >"; } htmlCode += "</select>"; return(Json(new { result = htmlCode }, JsonRequestBehavior.AllowGet)); }
public ActionResult Tabla() { instructorBLL = new InstructorBLLImp(); List <InstructorGym> resultado = instructorBLL.BuscarTodos(Session["empresa"].ToString()); String htmlCode = String.Empty; foreach (InstructorGym ins in resultado) { htmlCode += "<tr>" + "<td>" + ins.idInstructor + "</td>" + "<td>" + string.Format("{0} {1} {2}", ins.nombre, ins.apellido1, ins.apellido2) + "</td>" + "<td>" + ins.telefono + "</td>" + "<td>" + ins.usuario + "</td>" + "<td class=\"text - right\" > " + "<a href = \"#\" class=\"btn btn-simple btn-warning btn-icon \" data-toggle=\"modal\" data-target=\"#myModal1\" onclick=\"EditarAjax('" + ins.idInstructor + "')\"><i class=\"fa fa-edit\"></i></a>" + "<a href = \"#\" onclick=\"warninMessage(); EliminarCargar('" + ins.idInstructor + "')\" class=\"btn btn-simple btn-danger btn-icon\"><i class=\"fa fa-times\" ></i></a>" + "</td>" + "<tr>"; } return(Json(new { result = htmlCode }, JsonRequestBehavior.AllowGet)); }