CheckManteCommand.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 CheckManteCommand : Command
12  {
13  DataTable dtMante = null;
14  public CheckManteCommand(IAddonsManager addons) : base(addons)
15  {
16  Name = "CheckMante";
17  }
18 
19  protected override void CommandModulo(IModulo modulo, params object[] parameters)
20  {
21  if (DB._SQLExisteTablaBBDD(modulo._NombreConexion, "MANTES") && dtMante == null)
22  {
23  string lcAliasDb = modulo._AliasDB;
24  Func<string, DataTable> _checkMante = parameters[0] as Func<string, DataTable>;
25  DataTable loDt = _checkMante(lcAliasDb);
26  dtMante = loDt is DataTable && loDt.Rows.Count > 0 ? loDt : null;
27  }
28  }
29 
30  protected override object Return(params object[] parameters)
31  {
32  return dtMante;
33  }
34  protected override ExpectedParameters GetExpectedParameters()
35  {
36  return new ExpectedParameters(new Type[] { typeof(Func<string, DataTable>) });
37  }
38  protected override bool Exit()
39  {
40  return dtMante != null;
41  }
42  }
43 }
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