public ActionResult VerReporteTienda(DatosVerTienda datos) { try { DataReporte reporte = idalTienda.ObtenerReporte(datos.tienda); string resultado = "<table class=\"table table-hover\">"; resultado += "<tr class=\"active\" style=\"font-weight : bold\">"; resultado += "<td>Usuarios : </td>"; resultado += "<td>" + reporte.cantUsuarios + "</td>"; resultado += "</tr>"; resultado += "<tr class=\"primary\" style=\"font-weight : bold\">"; resultado += "<td>Transacciones : </td>"; resultado += "<td>" + reporte.cantTransacciones + "</td>"; resultado += "</tr>"; resultado += "</table>"; var result = new { Success = "True", Message = resultado }; return(Json(result, JsonRequestBehavior.AllowGet)); } catch (Exception e) { var result = new { Success = "False", Message = "Error" }; return(Json(result, JsonRequestBehavior.AllowGet)); } }
public ActionResult VerTienda(DatosVerTienda datos) { string pagina = ""; string line = ""; System.IO.StreamReader file = new System.IO.StreamReader(AppDomain.CurrentDomain.BaseDirectory + "/Views/Tienda/VerTienda.cshtml"); while ((line = file.ReadLine()) != null) { pagina += line; } file.Close(); AtributoSesion atr = new AtributoSesion(); atr.Datos = datos.tienda; atr.AdministradorID = User.Identity.Name; atr.AtributoSesionID = "tienda"; idalTienda.AgregarAtributoSesion(atr); Debug.WriteLine("La tienda seleccionada es : " + datos.tienda); var result = new { Success = "True", Message = pagina }; return(Json(result, JsonRequestBehavior.AllowGet)); }