Remesa.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using sage.ew.ewbase;
6 using sage.ew.db;
7 using System.Data;
8 using System.ComponentModel;
9 using sage.ew.global;
10 
11 namespace sage.ew.contabilidad
12 {
17 
22  public class Remesa : ewMante
23  {
24 
25  #region PROPIEDADES PRIVADAS
26 
27  internal string _lcEmpresa = EW_GLOBAL._GetVariable("wc_empresa").ToString().Trim();
28 
29  #endregion PROPIEDADES PRIVADAS
30 
31 
32  #region PROPIEDADES PUBLICAS
33 
37  [DefaultValue("")]
38  public string _Empresa
39  {
40  get { return Convert.ToString(_Campo("EMPRESA")); }
41  set { _Campo("EMPRESA", value); }
42  }
43 
47  [DefaultValue("")]
48  public int _Numero
49  {
50  get
51  {
52  return Convert.ToInt32(_Campo("NUMERO"));
53  }
54  set
55  {
56  _Campo("NUMERO", value);
57  _Campo("EMPRESA", _lcEmpresa);
58  }
59  }
60 
64  [DefaultValue("")]
65  public string _Emesa
66  {
67  get { return Convert.ToString(_Campo("EMESA")); }
68  set { _Campo("EMESA", value); }
69  }
70 
71  #endregion PROPIEDADES PUBLICAS
72 
73 
74  #region CONSTRUCTORES
75 
79  public Remesa()
80  {
81  this._CargaPropiedades();
82  }
83 
88  public Remesa(int tnNumero)
89  {
90  this._CargaPropiedades();
91  }
92 
93  #endregion CONSTRUCTORES
94 
95 
96  #region METODOS PRIVADOS
97 
101  private void _CargaPropiedades()
102  {
103  // Asignamos las propiedades para la remesa
104  this._lTodos = true;
105  this._Clave = "EMPRESA,NUMERO";
106  this._DataBase = "GESTION";
107  this._Tabla = "REMESA";
108  this._TituloMantenimiento = "Remesas de cobro";
109  this._TituloCabecera = "Remesa de cobro";
110  this._TituloMenu = "Remesa de cobro";
111 
112  // this._FormManteBaseType = typeof(Forms.frmPrevisionMante);
113  // this.Navegacion._Condicion = "EMPRESA = " + DB.SQLString(_lcEmpresa);
114 
115  this._Pantalla = "REM_BANC";
116  }
117 
118  #endregion METODOS PRIVADOS
119 
120 
121  #region METODOS OVERRIDE
122 
126  public override void _Load()
127  {
128  base._Load();
129  }
130 
131  #endregion METODOS OVERRIDE
132 
133 
134  #region METODOS PUBLICOS
135 
140  public decimal _Importe(int tnRemesa=0)
141  {
142  decimal lnImporte = 0;
143  string lcSql = "";
144  bool llOk = false;
145  DataTable ldtRemesa = new DataTable();
146 
147  if (tnRemesa > 0)
148  this._Numero = tnRemesa;
149 
150  lcSql = "SELECT SUM(p.importe) AS importe " +
151  "FROM " + DB.SQLDatabase("comunes", "previ_cl") + " p " +
152  "WHERE p.empresa =" + DB.SQLString(this._Empresa) + " " +
153  "AND p.remesa =" + DB.SQLString(this._Numero) + " " +
154  "GROUP BY p.empresa,p.remesa";
155 
156  llOk = DB.SQLExec(lcSql, ref ldtRemesa);
157  if (llOk && ldtRemesa.Rows.Count > 0)
158  {
159  lnImporte = Convert.ToDecimal(ldtRemesa.Rows[0]["importe"]);
160  }
161 
162  return lnImporte;
163  }
164 
165  #endregion METODOS PUBLICOS
166  }
167 }
Clase de negocio base para mantenimientos
Definition: clsEwBase.cs:1643
override void _Load()
Realiza la carga de los datos de la remesa en base a EMPRESA y NUMERO que tenga asignado el objeto...
Definition: Remesa.cs:126
Clase de negocio para remesas de cobro (PE-103582) De momento sólo de implementa lo que se necesita d...
Definition: Remesa.cs:22
Remesa(int tnNumero)
Constructor
Definition: Remesa.cs:88
Remesa()
Constructor vacío
Definition: Remesa.cs:79
decimal _Importe(int tnRemesa=0)
Método para consultar el importe de la remesa
Definition: Remesa.cs:140