GetFormsnetTablaCommand.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Data;
4 using System.Linq;
5 using System.Text;
6 using sage.ew.db;
7 using sage.ew.interficies;
8 
9 namespace Sage.ES.S50.Addons
10 {
11  internal class GetFormsnetTablaCommand : Command
12  {
13  DataTable dtMante = null;
14  string Pantalla = "";
15 
16  public GetFormsnetTablaCommand(IAddonsManager addons, string pantalla) : base(addons)
17  {
18  Name = "CheckMante";
19  Pantalla = pantalla;
20  }
21 
22  protected override void CommandModulo(IModulo modulo, params object[] parameters)
23  {
24  if (DB._SQLExisteTablaBBDD(modulo._NombreConexion, "FORMSNET") && dtMante == null)
25  {
26  string lcAliasDb = modulo._AliasDB;
27  Func<string, string, DataTable> _GetFormsnetTablaAddons = parameters[0] as Func<string, string, DataTable>;
28  DataTable loDt = _GetFormsnetTablaAddons(Pantalla, lcAliasDb);
29  dtMante = loDt is DataTable && loDt.Rows.Count > 0 ? loDt : null;
30  }
31  }
32 
33  protected override object Return(params object[] parameters)
34  {
35  return dtMante;
36  }
37 
38  protected override ExpectedParameters GetExpectedParameters()
39  {
40  return new ExpectedParameters(new Type[] { typeof(Func<string, string, DataTable>) });
41  }
42 
43  protected override bool Exit()
44  {
45  return dtMante != null;
46  }
47  }
48 }
PE-93426 Interficie para los módulos de la aplicación
Definition: IModulo.cs:22
string _NombreConexion
Nombre real de la base de datos
Definition: IModulo.cs:59
string _AliasDB
Alias de la Base de datos
Definition: IModulo.cs:29