MergeListadosCommand.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 MergeListadosCommand : Command
12  {
13  public MergeListadosCommand(IAddonsManager addons) : base(addons)
14  {
15  Name = "MergeListados";
16  }
17 
18  protected override void CommandModulo(IModulo modulo, params object[] parameters)
19  {
20  if (DB._SQLExisteTablaBBDD(modulo._NombreConexion, "LISTADOS"))
21  {
22  string lcSql = "Select nombre from " + DB.SQLDatabase(modulo._AliasDB, "listados") + " WHERE TIPO = " + parameters[2].ToString(); // 3";
23  DataTable ldtTemp = parameters[0] as DataTable;
24  DataTable ldtResultado = parameters[1] as DataTable;
25  if (DB.SQLExec(lcSql, ref ldtTemp ))
26  ldtResultado.Merge(ldtTemp);
27  }
28 
29  }
30 
31  protected override ExpectedParameters GetExpectedParameters()
32  {
33  return new ExpectedParameters(new Type[] { typeof(DataTable), typeof(DataTable), typeof(int) });
34  }
35  }
36 }
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