1: public static DataTable ReedSolutions(MO_NET.ClientContext ctx)
2: {
3: DataTable dtSoluciones = new DataTable();
4: dtSoluciones.Columns.Add("ID");
5: dtSoluciones.Columns.Add("Solución");
6: dtSoluciones.Columns.Add("Estado Activación");
7: DataRow dtrSoluciones;
8:
9: try
10: {
11: using (MO_NET.ClientContext ctxAux = ctx)
12: {
13: if (ctx != null)
14: {
15: //Accessing to the solutions gallery
16: MO_NET.List solutionList = ctx.Site.GetCatalog(121);
17:
18: //Accessing to the solutions collection
19: MO_NET.ListItemCollection licCollection =
20: solutionList.GetItems(MO_NET.CamlQuery.CreateAllItemsQuery());
21:
22: //Defining the operation
23: ctx.Load(licCollection);
24:
25: //Performing the operation
26: ctx.ExecuteQuery();
27:
28: //Processing the results
29: foreach (MO_NET.ListItem li in licCollection)
30: {
31: MO_NET.FieldLookupValue fl = (MO_NET.FieldLookupValue)li.FieldValues["Status"];
32: dtrSoluciones = dtSoluciones.NewRow();
33: dtrSoluciones["ID"] = li["ID"];
34: dtrSoluciones["Solución"] = li["FileRef"];
35: //Solución activada o no
36: if (fl != null)
37: {
38: dtrSoluciones["Estado Activación"] = "Sí";
39: }
40: else
41: {
42: dtrSoluciones["Estado Activación"] = "No";
43: }
44: dtSoluciones.Rows.Add(dtrSoluciones);
45: }
46: }
47: }
48: }
49: catch (Exception ex)
50: {
51: MessageBox.Show(ex.Message);
52: }
53: return dtSoluciones;
54: }