LoadListadoDBCommand.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using sage.ew.db;
6 using sage.ew.interficies;
7 
8 namespace Sage.ES.S50.Addons
9 {
10  internal class LoadListadoDBCommand : Command
11  {
12  int ret = 0;
13  public LoadListadoDBCommand(IAddonsManager addons) : base(addons)
14  {
15  Name = "LoadListadoDB";
16  }
17 
18  protected override void CommandModulo(IModulo modulo, params object[] parameters)
19  {
20  Func<string, string, string, object[], bool> _LoadListadoDb = parameters[0] as Func<string, string, string, object[], bool>;
21  string tcFormularioFox = parameters[1].ToString();
22  string lcFiltro = parameters[2].ToString();
23  object[] toParametros = parameters[3] as object[];
24  if (DB._SQLExisteTablaBBDD(modulo._NombreConexion, "LISTADOS"))
25  {
26  if (_LoadListadoDb(tcFormularioFox, lcFiltro, modulo._AliasDB, toParametros))
27  {
28  ret = 1;
29  }
30  }
31  }
32 
33  protected override ExpectedParameters GetExpectedParameters()
34  {
35  return new ExpectedParameters(new Type[] {
36  typeof(Func<string, string, string, object[], bool>),
37  typeof(string),
38  typeof(string),
39  typeof(object[])
40  });
41  }
42  protected override object Return(params object[] parameters)
43  {
44  return ret;
45  }
46  protected override bool Condition(KeyValuePair<string, object> addon)
47  {
48  return base.Condition(addon) && ret == 0;
49  }
50  protected override bool Exit()
51  {
52  return ret == 1;
53  }
54  }
55 }
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