-
Notifications
You must be signed in to change notification settings - Fork 0
/
_ConsultaSPARQL_topproyectos$$$9eaba1bb-9308-4c6e-b879-19559a5b0a53.cshtml
120 lines (95 loc) · 3.21 KB
/
_ConsultaSPARQL_topproyectos$$$9eaba1bb-9308-4c6e-b879-19559a5b0a53.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@using System.Reflection
@model CMSComponentQuerySPARQL
@{
CommunityModel Comunidad = Html.GetComunidad();
UserIdentityModel IdentidadActual = Html.GetIdentidadActual();
System.Data.DataTable col = Model.DataSetResult.Tables[0];
listaProyects = new List<Proyect>();
@foreach (System.Data.DataRow fila in Model.DataSetResult.Tables[0].Rows)
{
Proyect proyect = new Proyect(fila);
listaProyects.Add(proyect);
}
}
@if (Model != null)
{
<div class="grupo-top">
<div class="wrapCol grupo-proyectos">
<h2 class="section-title">@Html.Translate("TOP_PROYECTOS")</h2>
<div class="resource-list proyectos con-borde">
@foreach (Proyect proyect in listaProyects)
{
<article class="resource resource-grupo">
<div class="user-miniatura">
@{
string urlProyect =Comunidad.Url+"/"+Html.GetText("URLSEM", "RECURSO")+"/"+ Es.Riam.Util.UtilCadenas.EliminarCaracteresUrlSem(proyect.title)+"/"+proyect.id.Split('_')[1];
}
<div class="imagen-usuario-wrap">
<a href="@urlProyect" target="_blank" >
<div class="imagen sinImagen">
<span class="material-icons">work</span>
</div>
</a>
</div>
<div class="nombre-usuario-wrap">
<a href="@urlProyect" target="_blank">
<p class="nombre">@proyect.title</p>
<p class="nombre-completo">@proyect.tituloOrg</p>
</a>
</div>
</div>
</article>
}
<a href="@Comunidad.Url/@Html.Translate("BUSQUEDA_URL_PROYECTOS")" target="_blank" class="ver-mas ver-mas-icono con-icono-after">@Html.Translate("VER_TODOS")</a>
</div>
</div>
</div>
}
@functions
{
public static List<Proyect> listaProyects = new List<Proyect>();
public class Proyect
{
public string id { get; set; }
public string title { get; set; }
public string tituloOrg { get; set; }
public string numDoc { get; set; }
public Proyect()
{
id = "";
title = "";
tituloOrg = "";
numDoc = "";
}
public Proyect(System.Data.DataRow fila)
{
try
{
this.id = fila["project"].ToString();
this.title = fila["title"].ToString();
this.numDoc = fila["numDoc"].ToString();
} catch (Exception e ) {}
try
{
if (!fila.IsNull("tituloOrg"))
{
this.tituloOrg = fila["tituloOrg"].ToString();
}
} catch (Exception e ) {}
}
private string GetFecha(string fecha)
{
if (!string.IsNullOrEmpty(fecha) && fecha.Length == 14)
{
string anio = fecha.Substring(0, 4);
string mes = fecha.Substring(4, 2);
string dia = fecha.Substring(6, 2);
string hora = fecha.Substring(8, 2);
string min = fecha.Substring(10, 2);
string segs = fecha.Substring(12, 2);
fecha = dia + "/" + mes + "/" + anio + " " + hora + ":" + min + ":" + segs;
}
return fecha;
}
}
}