30 #region ENUMERACIONES INTERNAS
78 #endregion ENUMERACIONES INTERNAS
100 #region PROPIEDADES PRIVATE
124 private int _lnAny = Convert.ToInt32(EW_GLOBAL._GetVariable(
"wc_any"));
130 private string _lcAny = Convert.ToString(EW_GLOBAL._GetVariable(
"wc_any"));
136 private string _cMonedaEmpresa = Convert.ToString(EW_GLOBAL._GetVariable(
"wc_moneda"));
142 private string _cEmpresa = Convert.ToString(EW_GLOBAL._GetVariable(
"wc_empresa"));
148 private bool _lEmpresaNormal = Convert.ToBoolean(EW_GLOBAL._GetVariable(
"wl_normal"));
154 private bool _llEjercicioPartido = Convert.ToBoolean(EW_GLOBAL._GetVariable(
"wl_parti"));
160 private DateTime _dFechaIniEjer = Convert.ToDateTime(EW_GLOBAL._GetVariable(
"wd_periodoini"));
166 private DateTime _dFechaFinEjer = Convert.ToDateTime(EW_GLOBAL._GetVariable(
"wd_periodofin"));
169 #endregion PROPIEDADES PRIVATE
172 #region PROPIEDADES PÚBLICAS
175 #region PROPIEDADES CABECERA
181 [FieldName(
"Empresa")]
182 [DisplayName(
"EMPRESA")]
183 [ReportProperty(
"Empresa",
"",
"Empresa::")]
185 [DataType(DataType.Text)]
190 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_Empresa))));
194 this._Campo(this.GetFieldName(nameof(this.
_Empresa)), value);
202 [FieldName(
"Numero")]
203 [DisplayName(
"Ejercicio:")]
204 [ReportProperty(
"Numero",
"",
"Número::")]
206 [DataType(DataType.Text)]
211 string lcValor = Convert.ToString(_Campo(GetFieldName(nameof(this.
_Numero)))).Trim().PadRight(8,
' ');
212 if (lcValor.Trim() ==
"0")
223 value = value.PadRight(8);
225 this._Campo(this.GetFieldName(nameof(this.
_Numero)), value );
234 [DisplayName(
"Fecha solicitud:")]
235 [ReportProperty(
"Fecha",
"dd/MM/yyyy",
"Fecha::")]
236 [DataType(DataType.DateTime)]
241 return Convert.ToDateTime(this._Campo(this.GetFieldName(nameof(this.
_Fecha))));
245 string lcNombreCampo = this.GetFieldName(nameof(this.
_Fecha)).ToUpper();
247 this._Campo(lcNombreCampo, value);
255 [FieldName(
"Retencion")]
256 [DisplayName(
"Solicita retención:")]
257 [ReportProperty(
"Solicita retención",
"",
"Solicita retención::")]
258 [DefaultValue(
false)]
263 return Convert.ToBoolean(this._Campo(this.GetFieldName(nameof(this.
_SolicitaRetencion))));
275 [FieldName(
"Ruta_dest")]
281 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_RutaGeneracion))));
290 #endregion PROPIEDADES CABECERA
293 #region PROPIEDADES EMPRESARIO
299 [FieldName(
"Emp_nom")]
300 [DisplayName(
"Nombre empresario:")]
301 [ReportProperty(
"Nombre empresario",
"",
"Nombre empresario::")]
307 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_NombreEmpresario))));
319 [FieldName(
"Emp_ap1")]
320 [DisplayName(
"Apellido 1 empresario:")]
321 [ReportProperty(
"Apellido 1 empresario",
"",
"Apellido 1 empresario::")]
339 [FieldName(
"Emp_ap2")]
340 [DisplayName(
"Apellido 2 empresario:")]
341 [ReportProperty(
"Apellido 2 empresario",
"",
"Apellido 2 empresario::")]
359 [FieldName(
"Emp_cif")]
360 [DisplayName(
"Cif empresario:")]
361 [ReportProperty(
"Cif empresario",
"",
"Cif empresario::")]
367 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_CifEmpresario))));
371 this._Campo(this.GetFieldName(nameof(this.
_CifEmpresario)), value);
379 [FieldName(
"Emp_direc")]
380 [DisplayName(
"Dirección empresario:")]
381 [ReportProperty(
"Dirección empresario",
"",
"Dirección empresario::")]
399 [FieldName(
"Emp_codpos")]
400 [DisplayName(
"Código postal empresario:")]
401 [ReportProperty(
"Código postal empresario",
"",
"Código postal empresario::")]
407 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_CodposEmpresario))));
419 [FieldName(
"Emp_ciudad")]
420 [DisplayName(
"Ciudad empresario:")]
421 [ReportProperty(
"Ciudad empresario",
"",
"Ciudad empresario::")]
427 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_CiudadEmpresario))));
439 [FieldName(
"Emp_provin")]
440 [DisplayName(
"Provincia empresario:")]
441 [ReportProperty(
"Provincia empresario",
"",
"Provincia empresario::")]
459 [FieldName(
"Emp_tel")]
460 [DisplayName(
"Teléfono empresario:")]
461 [ReportProperty(
"Teléfono empresario",
"",
"Teléfono empresario::")]
479 [FieldName(
"Emp_fax")]
480 [DisplayName(
"Fax empresario:")]
481 [ReportProperty(
"Fax empresario",
"",
"Fax empresario::")]
487 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_FaxEmpresario))));
491 this._Campo(this.GetFieldName(nameof(this.
_FaxEmpresario)), value);
496 #endregion PROPIEDADES EMPRESARIO
499 #region PROPIEDADES PRESENTADOR
505 [FieldName(
"Prs_nom")]
506 [DisplayName(
"Nombre presentador:")]
507 [ReportProperty(
"Nombre presentador",
"",
"Nombre presentador::")]
513 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_NombrePresentador))));
525 [FieldName(
"Prs_ap1")]
526 [DisplayName(
"Apellido 1 presentador:")]
527 [ReportProperty(
"Apellido 1 presentador",
"",
"Apellido 1 presentador::")]
545 [FieldName(
"Prs_ap2")]
546 [DisplayName(
"Apellido 2 presentador:")]
547 [ReportProperty(
"Apellido 2 presentador",
"",
"Apellido 2 presentador::")]
565 [FieldName(
"Prs_cif")]
566 [DisplayName(
"Cif presentador:")]
567 [ReportProperty(
"Cif presentador",
"",
"Cif presentador::")]
573 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_CifPresentador))));
585 [FieldName(
"Prs_direc")]
586 [DisplayName(
"Dirección presentador:")]
587 [ReportProperty(
"Dirección presentador",
"",
"Dirección presentador::")]
605 [FieldName(
"Prs_codpos")]
606 [DisplayName(
"Código postal presentador:")]
607 [ReportProperty(
"Código postal presentador",
"",
"Código postal presentador::")]
613 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_CodposPresentador))));
625 [FieldName(
"Prs_ciudad")]
626 [DisplayName(
"Ciudad presentador:")]
627 [ReportProperty(
"Ciudad presentador",
"",
"Ciudad presentador::")]
633 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_CiudadPresentador))));
645 [FieldName(
"Prs_provin")]
646 [DisplayName(
"Provincia presentador:")]
647 [ReportProperty(
"Provincia presentador",
"",
"Provincia presentador::")]
665 [FieldName(
"Prs_tel")]
666 [DisplayName(
"Teléfono presentador:")]
667 [ReportProperty(
"Teléfono presentador",
"",
"Teléfono presentador::")]
685 [FieldName(
"Prs_fax")]
686 [DisplayName(
"Fax presentador:")]
687 [ReportProperty(
"Fax presentador",
"",
"Fax presentador::")]
693 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_FaxPresentador))));
705 [FieldName(
"Prs_email")]
706 [DisplayName(
"Email presentador:")]
707 [ReportProperty(
"Email presentador",
"",
"Email presentador::")]
713 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_EmailPresentador))));
722 #endregion PROPIEDADES PRESENTADOR
725 #region PROPIEDADES REGISTRO
731 [FieldName(
"Rgs_codigo")]
732 [DisplayName(
"Código de Registro:")]
733 [ReportProperty(
"Código de registro",
"",
"Código de registro::")]
739 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_CodigoRegistro))));
751 [FieldName(
"Rgs_tomo")]
752 [DisplayName(
"Número de tomo registro:")]
753 [ReportProperty(
"Número de tomo registro",
"",
"Número de tomo registro::")]
771 [FieldName(
"Rgs_libro")]
772 [DisplayName(
"Número de libro registro:")]
773 [ReportProperty(
"Número de libro registro",
"",
"Número de libro registro::")]
791 [FieldName(
"Rgs_sec")]
792 [DisplayName(
"Número de sección registro:")]
793 [ReportProperty(
"Número de sección registro",
"",
"Número de sección registro::")]
811 [FieldName(
"Rgs_folio")]
812 [DisplayName(
"Número de folio:")]
813 [ReportProperty(
"Número de folio registro",
"",
"Número de folio registro::")]
831 [FieldName(
"Rgs_hoja")]
832 [DisplayName(
"Número de hoja registro:")]
833 [ReportProperty(
"Número de hoja registro",
"",
"Número de hoja registro::")]
850 [FieldName(
"Rgs_irus")]
851 [DisplayName(
"Identificador registral único de la sociedad:")]
852 [ReportProperty(
"Identificador registral único de la sociedad",
"",
"Identificador registral único de la sociedad::")]
858 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_IRUS))));
862 this._Campo(this.GetFieldName(nameof(this.
_IRUS)), value);
870 [FieldName(
"Rgs_trp")]
871 [DisplayName(
"Tipo de registro mercantil:")]
872 [ReportProperty(
"Tipo de registro mercantil",
"",
"Tipo de registro mercantil::")]
890 [FieldName(
"Rgs_otros")]
891 [DisplayName(
"Otros:")]
892 [ReportProperty(
"Otros",
"",
"Otros::")]
910 [FieldName(
"Rgs_rm")]
911 [DisplayName(
"Registro mercantil:")]
912 [ReportProperty(
"Registro mercantil",
"",
"Registro mercantil::")]
918 return Convert.ToString(this._Campo(this.GetFieldName(nameof(this.
_RegistroMercantil))));
935 [FieldName(
"Tot_libr")]
936 [DisplayName(
"Nº de libros presentados:")]
937 [ReportProperty(
"Número libros presentados",
"",
"Nº libros presentados::")]
952 #endregion PROPIEDADES REGISTRO
955 #region PROPIEDADES IDOCUMENTOIMPRIMIBLE SOBREESCRITAS
976 #endregion PROPIEDADES IDOCUMENTOIMPRIMIBLE SOBREESCRITAS
979 #region PROPIEDADES VARIAS
1005 get {
return _cError_message; }
1006 set { _cError_message = value; }
1008 private string _cError_message =
"";
1016 get {
return _cWarning_Message; }
1017 set { this._cWarning_Message = value; }
1019 private string _cWarning_Message =
"";
1030 get {
return _cError_Message_Linea; }
1033 _cError_Message_Linea = value;
1035 if (!
string.IsNullOrWhiteSpace(_cError_Message_Linea))
1037 if (this._Error_Message_Linea_After !=
null)
1042 private string _cError_Message_Linea =
"";
1062 get {
return "LegalizaciónLibros."+this._lcAny.Trim(); }
1075 #endregion PROPIEDADES VARIAS
1078 #region PROPIEDADES SOBREESCRITAS DE DOCUMENTOBASE
1093 bool llLectura = base._Solo_Lectura;
1099 llLectura = this._EnUso ||
1101 lnSoloLectura ==
formul._TiposAccesosPantalla.SoloLectura;
1109 #endregion PROPIEDADES SOBREESCRITAS DE DOCUMENTOBASE
1112 #endregion PROPIEDADES PÚBLICAS
1115 #region CONSTRUCTORES
1156 base(legalizacionLibrosDA)
1158 if (legalizacionLibrosDA ==
null)
1160 throw new ArgumentNullException(nameof(legalizacionLibrosDA),
"El parámetro de acceso a datos legalizacionLibrosDA no puede tener valor null.");
1165 this.legalizacionLibrosConstructor();
1170 if (!
string.IsNullOrWhiteSpace(tcEjercicio))
1174 this._Numero = tcEjercicio.Trim().PadRight(8,
' ');
1187 private void legalizacionLibrosConstructor()
1191 if (!this._lEmpresaNormal)
1201 this._Mantenimiento_Estado_Change += this.legalizacionLibros_Actualizar_Estado_Documento;
1207 this.Navegacion._Condicion =
"EMPRESA=" + this._dataAccessLegalizacionLibros.
SQLString(this._cEmpresa);
1213 #endregion CONSTRUCTORES
1216 #region MÉTODOS PROTECTED OVERRIDE SOBREESCRITOS DE CLASE BASE 'DOCUMENTOBASE'
1229 this._Clave =
"EMPRESA,NUMERO";
1230 this._DataBase =
"COMUNES";
1231 this._Tabla =
"C_LEGLBR";
1232 this._TituloMantenimiento =
"Legalización de libros";
1233 this._TituloCabecera =
"Legalización de libros";
1234 this._TituloMenu =
"Legalizacion de libros";
1235 this._Campo_Nombre =
"EMP_NOM";
1236 this._Browser_Campos =
"";
1237 this._Browser_Titulos_Campos =
"";
1238 this._Browser_Campo_Predet =
"";
1241 this._Pantalla =
"LEGALIBR";
1247 this._ReportTitlePreview = this._TituloMantenimiento;
1248 this._ReportBase =
"DocumentoLegalizacion";
1259 if (
string.IsNullOrWhiteSpace(this.
_Empresa))
1260 this._Empresa = this._cEmpresa;
1266 #endregion MÉTODOS PROTECTED OVERRIDE SOBREESCRITOS DE CLASE BASE 'DOCUMENTOBASE'
1269 #region MÉTODOS PUBLIC OVERRIDE SOBREESCRITOS DE CLASE BASE 'DOCUMENTOBASE'
1276 [ExcludeFromCodeCoverage]
1283 this._FormMante._Show();
1285 if (!
string.IsNullOrWhiteSpace(this.
_Codigo))
1287 if (this._FormMante !=
null)
1288 this._FormMante._Cargar_Documento();
1300 [ExcludeFromCodeCoverage]
1315 Dictionary<string, object> ldicFiltros =
new Dictionary<string, object>();
1317 switch (this._TipoImpresion)
1332 ldicFiltros.Add(
"wc_nomape1ape2_empresario", this.
_NombreEmpresario.Trim() +
" " +
this._Apellido1Empresario.Trim() +
this._Apellido2Empresario.Trim());
1333 ldicFiltros.Add(
"wc_cif_empresario", this.
_CifEmpresario.Trim());
1338 ldicFiltros.Add(
"wc_fax_empresario", this.
_FaxEmpresario.Trim());
1341 string lcFechaEnDtos = this.getDtosFecha(this.
_Fecha);
1342 if (!
string.IsNullOrWhiteSpace(lcFechaEnDtos))
1343 lcFechaEnDtos = lcFechaEnDtos.Substring(0, 2) +
" " + lcFechaEnDtos.Substring(2, 2) +
" " + lcFechaEnDtos.Substring(4);
1346 ldicFiltros.Add(
"wc_fecha_socilitud", lcFechaEnDtos.Trim());
1353 ldicFiltros.Add(
"wc_irus_registro", this.
_IRUS.Trim());
1355 ldicFiltros.Add(
"wc_numlibros", Convert.ToString(
this._NumeroLibros));
1371 DataTable loDt =
new DataTable();
1373 switch (this._TipoImpresion)
1385 loDt.Columns.Add(
"registro_mercantil", typeof(String)).Caption =
"Registro mercantil";
1389 loDt.Columns.Add(
"solicita_retencion", typeof(String)).Caption =
"Solicita retención";
1390 loDt.Columns.Add(
"fecha_solicitud", typeof(String)).Caption =
"Fecha solicitud";
1391 loDt.Columns.Add(
"num_libros", typeof(
int)).Caption =
"Número libros";
1395 loDt.Columns.Add(
"nombre_empresario", typeof(String)).Caption =
"Nombre empresario";
1396 loDt.Columns.Add(
"cif_empresario", typeof(String)).Caption =
"Cif empresario";
1397 loDt.Columns.Add(
"direccion_empresario", typeof(String)).Caption =
"Dirección empresario";
1398 loDt.Columns.Add(
"ciudad_empresario", typeof(String)).Caption =
"Ciudad empresario";
1399 loDt.Columns.Add(
"codpos_empresario", typeof(String)).Caption =
"Codpos empresario";
1403 loDt.Columns.Add(
"nombre_presentador", typeof(String)).Caption =
"Nombre presentador";
1404 loDt.Columns.Add(
"cif_presentador", typeof(String)).Caption =
"Cif presentador";
1405 loDt.Columns.Add(
"direccion_presentador", typeof(String)).Caption =
"Direccion presentador";
1406 loDt.Columns.Add(
"ciudad_presentador", typeof(String)).Caption =
"Ciudad presentador";
1407 loDt.Columns.Add(
"codpos_presentador", typeof(String)).Caption =
"C.Postal presentador";
1408 loDt.Columns.Add(
"provincia_presentador", typeof(String)).Caption =
"Provincia presentador";
1409 loDt.Columns.Add(
"fax_presentador", typeof(String)).Caption =
"Fax presentador";
1410 loDt.Columns.Add(
"telefono_presentador", typeof(String)).Caption =
"Teléfono presentador";
1411 loDt.Columns.Add(
"email_presentador", typeof(String)).Caption =
"Email presentador";
1416 DataRow loRow = loDt.NewRow();
1418 loRow[
"solicita_retencion"] = this._SolicitaRetencion ?
"SI" :
"NO";
1420 string lcFechaEnDtos = this.getDtosFecha(this.
_Fecha);
1421 if (!
string.IsNullOrWhiteSpace(lcFechaEnDtos))
1422 loRow[
"fecha_solicitud"] = lcFechaEnDtos.Substring(0, 2) +
" " + lcFechaEnDtos.Substring(2, 2) +
" " + lcFechaEnDtos.Substring(4);
1424 loRow[
"fecha_solicitud"] =
"";
1444 loDt.Rows.Add(loRow);
1450 loDt.Columns.Add(
"tipo_libro", typeof(String)).Caption =
"Tipo libro";
1451 loDt.Columns.Add(
"num_libro", typeof(
int)).Caption =
"Nº libro";
1452 loDt.Columns.Add(
"fec_apertura", typeof(String)).Caption =
"Fecha apert.";
1453 loDt.Columns.Add(
"fec_cierre", typeof(String)).Caption =
"Fecha cierre";
1454 loDt.Columns.Add(
"firma", typeof(String)).Caption =
"Firma";
1458 DataRow loRowLibro = loDt.NewRow();
1460 loRowLibro[
"tipo_libro"] = loLinea._TipoLibro;
1461 loRowLibro[
"num_libro"] = Convert.ToInt32(loLinea._NumLibro);
1462 if (loLinea._FecApertura !=
null)
1463 loRowLibro[
"fec_apertura"] = Convert.ToDateTime(loLinea._FecApertura).ToShortDateString();
1465 loRowLibro[
"fec_apertura"] =
"";
1467 if (loLinea._FecCierre !=
null)
1468 loRowLibro[
"fec_cierre"] = Convert.ToDateTime(loLinea._FecCierre).ToShortDateString();
1470 loRowLibro[
"fec_cierre"] =
"";
1472 loRowLibro[
"firma"] = loLinea._Firma;
1474 loDt.Rows.Add(loRowLibro);
1491 return this._dataAccessLegalizacionLibros._Comprobar_Existe_Documento(this._DataBase, this.
_Tabla, this._cEmpresa, tcEjercicio);
1499 [ExcludeFromCodeCoverage]
1509 #endregion MÉTODOS PÚBLIC OVERRIDE SOBREESCRITOS DE CLASE BASE 'DOCUMENTOBASE'
1512 #region MÉTODOS PROTECTED OVERRIDE SOBREESCRITOS DE CLASE BASE 'EWMANTE'
1523 if (!
string.IsNullOrWhiteSpace(this.
_Numero))
1527 if (this.
_Fecha.Hour != 0 ||
this._Fecha.Minute != 0 ||
this._Fecha.Second != 0)
1529 DateTime ldFecha =
new DateTime(this.
_Fecha.Year,
this._Fecha.Month,
this._Fecha.Day);
1530 this._Fecha = ldFecha;
1543 #endregion MÉTODOS PROTECTED OVERRIDE SOBREESCRITOS DE CLASE BASE 'EWMANTE'
1546 #region MÉTODOS PRIVADOS
1549 #region MÉTODOS PRIVADOS PARA IMPORTAR LEGALIZACION DE FICHERO ZIP
1556 private bool algunDatoDeclaradoDatosPresentacion()
1593 if (!
string.IsNullOrWhiteSpace(this.
_IRUS))
1605 [ExcludeFromCodeCoverage]
1606 private bool seleccionarArchivoZipValido(out
string tcRutaArchivoZip)
1608 string lcCarpetaImportacion =
"";
1609 tcRutaArchivoZip =
"";
1611 OpenFileDialog openFileDialog1 =
new OpenFileDialog();
1612 openFileDialog1.Filter =
"Archivos Zip (*.zip)|*.zip|Todos los archivos (*.*)|*.*";
1613 openFileDialog1.FilterIndex = 0;
1614 openFileDialog1.RestoreDirectory =
true;
1618 if (openFileDialog1.ShowDialog() != DialogResult.OK)
1620 this._Error_Message =
"No ha seleccionado ningún fichero ZIP de legalizacíón para importar.";
1624 if (
string.IsNullOrWhiteSpace(openFileDialog1.FileName))
1626 this._Error_Message =
"No ha seleccionado ningún fichero ZIP de legalizacíón para importar.";
1630 if (Path.GetExtension(openFileDialog1.FileName).Trim().ToUpper() !=
".ZIP")
1632 this._Error_Message =
"El archivo de legalización a importar debe ser de tipo ZIP.";
1637 if (!this.esNombreArchivoZipValido(openFileDialog1.FileName))
1644 if (!this.asegurarCarpetaImportacionVacia(out lcCarpetaImportacion))
1647 tcRutaArchivoZip = openFileDialog1.FileName.Trim();
1649 string lcNombreFicheroDestino = Path.Combine(lcCarpetaImportacion, Path.GetFileName(tcRutaArchivoZip));
1651 File.Copy(tcRutaArchivoZip, lcNombreFicheroDestino);
1653 if (!File.Exists(lcNombreFicheroDestino))
1655 this._Error_Message =
"No se ha podido copiar el fichero ZIP de legalización '" + tcRutaArchivoZip +
"' a la carpeta de importación '" + lcCarpetaImportacion +
"'.";
1659 if (!this.verificarRecuperarArchivoZip(lcNombreFicheroDestino,
false))
1674 private bool esNombreArchivoZipValido(
string tcRutaArchivoZip)
1676 int lnCodRegistro = -2;
1678 string lcNombreArchivo = Path.GetFileNameWithoutExtension(tcRutaArchivoZip);
1679 if (lcNombreArchivo.Substring(0, 2) !=
"LL")
1681 this._Error_Message =
"No es un fichero de legalización válido, debe comenzar por LL";
1685 if (lcNombreArchivo.Length < 7)
1687 this._Error_Message =
"No es un fichero de legalización válido, debe comenzar por LL y tener 5 dígitos numéricos a continuación con el código de registro.";
1691 if (!
int.TryParse(lcNombreArchivo.Substring(2, 5), out lnCodRegistro) || lnCodRegistro <= 0)
1693 this._Error_Message =
"No es un fichero de legalización válido, debe comenzar por LL y tener 5 dígitos numéricos a continuación con el código de registro.";
1718 [ExcludeFromCodeCoverage]
1719 private bool verificarRecuperarArchivoZip(
string tcArchivoZipImportar,
bool tlActualizar)
1723 if (
string.IsNullOrWhiteSpace(tcArchivoZipImportar))
1726 string lcCarpetaExtraccion = Path.GetDirectoryName(tcArchivoZipImportar);
1730 using (ZipFile zip =
new ZipFile(tcArchivoZipImportar))
1733 zip.Encryption = EncryptionAlgorithm.None;
1735 zip.CompressionMethod = CompressionMethod.Deflate;
1736 zip.UseZip64WhenSaving = Zip64Option.Never;
1738 zip.ExtractAll(lcCarpetaExtraccion);
1740 string lcArchivoNombresTxt = Path.Combine(lcCarpetaExtraccion,
"NOMBRES.TXT");
1741 string lcArchivoDatosTxt = Path.Combine(lcCarpetaExtraccion,
"DATOS.TXT");
1743 if (!File.Exists(lcArchivoNombresTxt))
1745 this._Error_Message =
"Al descomprimir el fichero ZIP de legalización '" + tcArchivoZipImportar +
"' en la carpeta '" + lcCarpetaExtraccion +
"' no se ha obtenido un fichero NOMBRES.TXT." +
1746 Environment.NewLine + Environment.NewLine +
"EL fichero ZIP de legalización es incorrecto."+
1747 Environment.NewLine + Environment.NewLine +
"Imposible realizar importación de fichero ZIP de legalización.";
1752 if (!File.Exists(lcArchivoDatosTxt))
1754 this._Error_Message =
"Al descomprimir el fichero ZIP de legalización '" + tcArchivoZipImportar +
"' en la carpeta '" + lcCarpetaExtraccion +
"' no se ha obtenido un fichero DATOS.TXT." +
1755 Environment.NewLine + Environment.NewLine +
"El fichero ZIP de legalización es incorrecto."+
1756 Environment.NewLine + Environment.NewLine +
"Imposible realizar importación de fichero ZIP de legalización.";
1762 StreamReader archivoNombresTxt =
new StreamReader(lcArchivoNombresTxt);
1763 string lcNombreFichero =
"";
1764 string lcRutaCompletaFichero =
"";
1766 while ((lcNombreFichero = archivoNombresTxt.ReadLine()) !=
null)
1768 lcRutaCompletaFichero = Path.Combine(lcCarpetaExtraccion, lcNombreFichero);
1769 if (!File.Exists(lcArchivoDatosTxt))
1771 this._Error_Message =
"Al descomprimir el fichero ZIP de legalización '" + tcArchivoZipImportar +
"' en la carpeta '" + lcCarpetaExtraccion +
"' no se ha obtenido el fichero '"+ lcNombreFichero +
"'" +
1772 "tal como consta en el archivo NOMBRES.TXT obtenido del fichero ZIP de la legalización."+Environment.NewLine + Environment.NewLine +
"El fichero ZIP de legalización es incorrecto." +
1773 Environment.NewLine + Environment.NewLine +
"Imposible realizar importación de fichero ZIP de legalización.";
1779 archivoNombresTxt.Close();
1791 if (!this.importarVaciarCamposPresentacion())
1796 if (!this.importarCargarCamposPresentacion(lcArchivoDatosTxt))
1801 if (!this.importarCargarLibrosPresentados(lcArchivoNombresTxt, lcArchivoDatosTxt))
1808 this._Error_Message =
"No se ha podido " + (tlActualizar ?
"importar correctamente el" :
"verificar el formato del") +
" fichero ZIP de legalización '" + tcArchivoZipImportar +
"'." +
1809 Environment.NewLine + Environment.NewLine + e.Message + Environment.NewLine + Environment.NewLine +
1810 "Imposible realizar importación de fichero ZIP de legalización.";
1823 [ExcludeFromCodeCoverage]
1824 private bool asegurarCarpetaImportacionVacia(out
string tcCarpetaImportacion)
1828 tcCarpetaImportacion = Path.Combine(lcRutaCompletaExportacion,
"Import");
1830 if (!Directory.Exists(tcCarpetaImportacion))
1831 Directory.CreateDirectory(tcCarpetaImportacion);
1833 if (!Directory.Exists(tcCarpetaImportacion))
1835 this._Error_Message =
"No se ha podido crear la carpeta de importación '" + tcCarpetaImportacion +
"'." + Environment.NewLine + Environment.NewLine +
1836 "Imposible realizar importación de fichero ZIP de legalización.";
1840 int lnNumFicheros = 0;
1841 if (this.algunFicheroEnRutaGeneracion(tcCarpetaImportacion, out lnNumFicheros))
1843 if (!this.borrarTodosArchivosRuta(tcCarpetaImportacion))
1845 this._Error_Message =
"La carpeta destino de la importación ('" + tcCarpetaImportacion +
"') ya contiene ficheros y no ha sido " +
1846 "posible eliminarlos todos." + Environment.NewLine + Environment.NewLine +
"Imposible realizar importación de fichero ZIP " +
1862 private bool algunFicheroEnRutaGeneracion(
string tcRutaGeneracion, out
int tnNumFicheros)
1864 bool llExistenFicheros =
false;
1866 string[] laFicheros = Directory.GetFiles(tcRutaGeneracion);
1867 tnNumFicheros = laFicheros.Count();
1869 llExistenFicheros = (tnNumFicheros > 0);
1871 return llExistenFicheros;
1880 [ExcludeFromCodeCoverage]
1881 private bool borrarTodosArchivosRuta(
string tcRuta)
1883 bool llTodosArchivosBorrados =
true;
1887 string[] laFicheros = Directory.GetFiles(tcRuta);
1888 foreach (
string lcFichero
in laFicheros)
1890 if (File.Exists(lcFichero))
1892 File.Delete(lcFichero);
1893 if (File.Exists(lcFichero))
1895 llTodosArchivosBorrados =
false;
1903 llTodosArchivosBorrados =
false;
1906 return llTodosArchivosBorrados;
1914 private bool importarVaciarCamposPresentacion()
1922 this._Fecha = DateTime.Today;
1923 this._SolicitaRetencion =
false;
1927 this._NombreEmpresario =
"";
1928 this._Apellido1Empresario =
"";
1929 this._Apellido2Empresario =
"";
1930 this._CifEmpresario =
"";
1931 this._DireccionEmpresario =
"";
1932 this._CodposEmpresario =
"";
1933 this._CiudadEmpresario =
"";
1934 this._ProvinciaEmpresario =
"";
1935 this._TelefonoEmpresario =
"";
1936 this._FaxEmpresario =
"";
1940 this._NombrePresentador =
"";
1941 this._Apellido1Presentador =
"";
1942 this._Apellido2Presentador =
"";
1943 this._CifPresentador =
"";
1944 this._DireccionPresentador =
"";
1945 this._CodposPresentador =
"";
1946 this._CiudadPresentador =
"";
1947 this._ProvinciaPresentador =
"";
1948 this._TelefonoPresentador =
"";
1949 this._FaxPresentador =
"";
1950 this._EmailPresentador =
"";
1954 this._CodigoRegistro =
"";
1955 this._NumeroTomoRegistro =
"";
1956 this._NumeroLibroRegistro =
"";
1957 this._NumeroSeccionRegistro =
"";
1958 this._NumeroFolioRegistro =
"";
1959 this._NumeroHojaRegistro =
"";
1960 this._TipoRegistroMercantil =
"";
1961 this._OtrosRegistroMercantil =
"";
1962 this._RegistroMercantil =
"";
1967 this._Error_Message =
"Se ha producido un error el vaciar los campos de presentación de la legalización." + Environment.NewLine + Environment.NewLine +
1968 "Mensaje de error: " + e.Message;
1980 [ExcludeFromCodeCoverage]
1981 private bool importarCargarCamposPresentacion(
string tcRutaFicheroDatosTxt)
1989 List<string> lstFileLines = File.ReadAllLines(tcRutaFicheroDatosTxt).ToList();
1993 this.importarCargarCamposPresentacion_Cabecera(lstFileLines);
1997 this.importarCargarCamposPresentacion_Empresario(lstFileLines);
2001 this.importarCargarCamposPresentacion_Presentador(lstFileLines);
2005 this.importarCargarCamposPresentacion_DatosRegistrales(lstFileLines);
2009 this._Error_Message =
"Se ha producido un error al cargar los campos de presentación de la legalización con los procedentes del archivo ZIP " +
2010 "que se está importando." + Environment.NewLine + Environment.NewLine +
"Mensaje de error: " + e.Message;
2022 private void importarCargarCamposPresentacion_Cabecera(List<string> tlstLineas)
2026 string lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"101");
2027 DateTime? ldtFecha = this.setDtosToFecha(lcValorCampo);
2028 if (ldtFecha ==
null)
2029 this._Fecha = DateTime.Today;
2031 this._Fecha = Convert.ToDateTime(ldtFecha);
2035 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"401");
2036 this._SolicitaRetencion = lcValorCampo.Trim().ToUpper() ==
"SI";
2046 private void importarCargarCamposPresentacion_Empresario(List<string> tlstLineas)
2048 string lcValorCampo =
"";
2052 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"102");
2053 this._NombreEmpresario = lcValorCampo;
2057 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"103");
2058 this._Apellido1Empresario = lcValorCampo;
2062 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"104");
2063 this._Apellido2Empresario = lcValorCampo;
2067 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"105");
2068 this._CifEmpresario = lcValorCampo;
2072 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"106");
2073 this._DireccionEmpresario = lcValorCampo;
2077 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"107");
2078 this._CiudadEmpresario = lcValorCampo;
2082 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"108");
2083 this._CodposEmpresario = lcValorCampo;
2087 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"109");
2088 this._ProvinciaEmpresario = FUNCTIONS._GetProvinciaFromCodigoProvincia(lcValorCampo);
2092 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"110");
2093 this._FaxEmpresario = lcValorCampo;
2097 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"111");
2098 this._TelefonoEmpresario = lcValorCampo;
2108 private void importarCargarCamposPresentacion_Presentador(List<string> tlstLineas)
2110 string lcValorCampo =
"";
2114 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"301");
2115 this._NombrePresentador = lcValorCampo;
2119 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"302");
2120 this._Apellido1Presentador = lcValorCampo;
2124 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"303");
2125 this._Apellido2Presentador = lcValorCampo;
2129 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"304");
2130 this._CifPresentador = lcValorCampo;
2134 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"305");
2135 this._DireccionPresentador = lcValorCampo;
2139 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"306");
2140 this._CiudadPresentador = lcValorCampo;
2144 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"307");
2145 this._CodposPresentador = lcValorCampo;
2149 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"308");
2150 this._ProvinciaPresentador = lcValorCampo;
2154 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"309");
2155 this._FaxPresentador = lcValorCampo;
2159 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"310");
2160 this._TelefonoPresentador = lcValorCampo;
2164 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"311");
2165 this._EmailPresentador = lcValorCampo;
2175 private void importarCargarCamposPresentacion_DatosRegistrales(List<string> tlstLineas)
2177 string lcValorCampo =
"";
2181 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"112");
2182 this._CodigoRegistro = lcValorCampo;
2186 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"201");
2187 this._NumeroTomoRegistro = lcValorCampo;
2191 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"202");
2192 this._NumeroLibroRegistro = lcValorCampo;
2196 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"203");
2197 this._NumeroSeccionRegistro = lcValorCampo;
2201 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"204");
2202 this._NumeroFolioRegistro = lcValorCampo;
2206 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"205");
2207 this._TipoRegistroMercantil = lcValorCampo;
2211 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"206");
2212 this._NumeroHojaRegistro = lcValorCampo;
2216 lcValorCampo = this.importarGetCampoDatosTxt(tlstLineas,
"207");
2217 this._OtrosRegistroMercantil = lcValorCampo;
2233 private string importarGetCampoDatosTxt(List<string> tlstLista,
string codigoCampo)
2235 string lcRegistroBuscado =
"", lcValorCampo =
"";
2237 lcRegistroBuscado = tlstLista.Where(x => x.Length >= codigoCampo.Length && x.Substring(0, codigoCampo.Length) == codigoCampo).FirstOrDefault();
2239 lcRegistroBuscado = lcRegistroBuscado.Trim();
2241 if (!
string.IsNullOrWhiteSpace(lcRegistroBuscado) && lcRegistroBuscado.Length > codigoCampo.Length)
2242 lcValorCampo = lcRegistroBuscado.Substring(codigoCampo.Length);
2244 return lcValorCampo;
2254 private int importarNumLiniasFicheroEnDatosTxt(List<string> tlstLista,
string codigoCampo)
2256 int lnNumLinias = tlstLista.Where(x => x.Length >= codigoCampo.Length && x.Substring(0, codigoCampo.Length) == codigoCampo).Count();
2268 [ExcludeFromCodeCoverage]
2269 private bool importarCargarLibrosPresentados(
string tcRutaFicheroNombresTxt,
string tcRutaFicheroDatosTxt)
2273 int lnLiniaFichero = 1, lnNumLineasFicheroEnDatosTxt = 0;
2274 string lcCodigoCampo =
"", lcValorCampo =
"", lcPrefijoCodigoCampo =
"", lcNombreFichero =
"", lcRutaCompletaFichero =
"", lcCarpetaExtraccion =
"";
2275 DateTime? ldtFecha =
null;
2279 lcCarpetaExtraccion = Path.GetDirectoryName(tcRutaFicheroNombresTxt);
2284 List<string> lstFileLinesDatosTxt = File.ReadAllLines(tcRutaFicheroDatosTxt).ToList();
2291 StreamReader archivoNombresTxt =
new StreamReader(tcRutaFicheroNombresTxt);
2292 while ((lcNombreFichero = archivoNombresTxt.ReadLine()) !=
null)
2294 lcRutaCompletaFichero = Path.Combine(lcCarpetaExtraccion, lcNombreFichero);
2296 if (!File.Exists(lcRutaCompletaFichero))
2298 this._Error_Message =
"Al intentar actualizar los libros a la legalización no se ha detectado la existencia del fichero '" + lcNombreFichero +
"' en la carpeta '" + lcCarpetaExtraccion +
"' " +
2299 "tal como consta en el archivo NOMBRES.TXT obtenido del fichero ZIP de la legalización." + Environment.NewLine + Environment.NewLine +
"El fichero ZIP de legalización es incorrecto." +
2300 Environment.NewLine + Environment.NewLine +
"Imposible realizar importación de fichero ZIP de legalización.";
2306 lnNumLineasFicheroEnDatosTxt = this.importarNumLiniasFicheroEnDatosTxt(lstFileLinesDatosTxt, Convert.ToString(lnLiniaFichero).Trim().PadLeft(3,
'0'));
2307 if (lnNumLineasFicheroEnDatosTxt!=6)
2309 this._Error_Message =
"Al intentar actualizar los libros a la legalización no se ha detectado la existencia del fichero '" + lcNombreFichero +
"' en la carpeta '" + lcCarpetaExtraccion +
"' " +
2310 "tal como consta en el archivo NOMBRES.TXT obtenido del fichero ZIP de la legalización." + Environment.NewLine + Environment.NewLine +
"El fichero ZIP de legalización es incorrecto." +
2311 Environment.NewLine + Environment.NewLine +
"Imposible realizar importación de fichero ZIP de legalización.";
2320 lcPrefijoCodigoCampo = Convert.ToString(lnLiniaFichero).Trim().PadLeft(3,
'0');
2324 lcCodigoCampo = lcPrefijoCodigoCampo +
"01";
2325 lcValorCampo = this.importarGetCampoDatosTxt(lstFileLinesDatosTxt, lcCodigoCampo);
2326 loLinea._TipoLibroVisual = lcValorCampo;
2330 lcCodigoCampo = lcPrefijoCodigoCampo +
"02";
2331 lcValorCampo = this.importarGetCampoDatosTxt(lstFileLinesDatosTxt, lcCodigoCampo);
2332 loLinea._NumLibro = lcValorCampo;
2334 loLinea._RutaArchivo = lcRutaCompletaFichero;
2338 lcCodigoCampo = lcPrefijoCodigoCampo +
"03";
2339 lcValorCampo = this.importarGetCampoDatosTxt(lstFileLinesDatosTxt, lcCodigoCampo);
2340 ldtFecha = this.setDtosToFecha(lcValorCampo);
2341 if (ldtFecha ==
null)
2342 loLinea._FecApertura =
null;
2344 loLinea._FecApertura = Convert.ToDateTime(ldtFecha);
2348 lcCodigoCampo = lcPrefijoCodigoCampo +
"04";
2349 lcValorCampo = this.importarGetCampoDatosTxt(lstFileLinesDatosTxt, lcCodigoCampo);
2350 ldtFecha = this.setDtosToFecha(lcValorCampo);
2351 if (ldtFecha ==
null)
2352 loLinea._FecCierre =
null;
2354 loLinea._FecCierre = Convert.ToDateTime(ldtFecha);
2358 lcCodigoCampo = lcPrefijoCodigoCampo +
"05";
2359 lcValorCampo = this.importarGetCampoDatosTxt(lstFileLinesDatosTxt, lcCodigoCampo);
2360 ldtFecha = this.setDtosToFecha(lcValorCampo);
2361 if (ldtFecha ==
null)
2362 loLinea._FecCierreAnt =
null;
2364 loLinea._FecCierreAnt = Convert.ToDateTime(ldtFecha);
2369 lcCodigoCampo = lcPrefijoCodigoCampo +
"06";
2370 lcValorCampo = this.importarGetCampoDatosTxt(lstFileLinesDatosTxt, lcCodigoCampo);
2371 loLinea._Firma = lcValorCampo;
2378 archivoNombresTxt.Close();
2382 this._Error_Message =
"Se ha producido un error el cargar los libros procedentes del fichero ZIP de legalización." + Environment.NewLine + Environment.NewLine +
2383 "Mensaje de error: " + e.Message;
2391 #endregion MÉTODOS PRIVADOS PARA IMPORTAR LEGALIZACION DE FICHERO ZIP
2394 #region MÉTODOS PRIVADOS PARA EXPORTAR LEGALIZACION A FICHERO ZIP
2402 private bool datosEmpresarioOk(ref
string tcFaltaCampo)
2406 tcFaltaCampo =
"Nombre empresario";
2413 tcFaltaCampo =
"CIF empresario";
2419 tcFaltaCampo =
"Dirección empresario";
2425 tcFaltaCampo =
"Código postal empresario";
2431 tcFaltaCampo =
"Ciudad empresario";
2437 tcFaltaCampo =
"Provincia empresario";
2450 private bool datosPresentadorOk(ref
string tcFaltaCampo)
2454 tcFaltaCampo =
"Nombre presentador";
2461 tcFaltaCampo =
"CIF presentador";
2474 private bool datosRegistroOk(ref
string tcFaltaCampo)
2476 if (!
string.IsNullOrWhiteSpace(this.
_IRUS))
2480 tcFaltaCampo =
"Tipo de registro público";
2488 tcFaltaCampo =
"Código de registro";
2496 tcFaltaCampo =
"Número de tomo registro";
2502 tcFaltaCampo =
"Número de folio registro";
2508 tcFaltaCampo =
"Tipo de registro público";
2514 tcFaltaCampo =
"Registro mercantil de";
2528 [ExcludeFromCodeCoverage]
2529 private bool exportarCopiarFicherosARutaGeneracion()
2538 string lcNombreFicheroOrigen =
"", lcNombreFicheroDestino =
"", lcExtensionFichero =
"";
2539 string lcCheckSum =
"";
2542 if (!
string.IsNullOrWhiteSpace(loLinea._RutaArchivo))
2544 lcNombreFicheroOrigen = loLinea._RutaArchivo.Trim();
2545 lcExtensionFichero = Path.GetExtension(lcNombreFicheroOrigen);
2546 lcNombreFicheroDestino = Path.Combine(lcRutaGeneracion, loLinea._TipoLibro.Trim() +
"_" + loLinea._NumLibro.Trim() + lcExtensionFichero);
2548 File.Copy(lcNombreFicheroOrigen, lcNombreFicheroDestino);
2550 if (!File.Exists(lcNombreFicheroDestino))
2552 this._Error_Message =
"No se ha podido copiar el archivo '" + lcNombreFicheroOrigen +
"' en la carpeta destino de generación '" + lcRutaGeneracion +
"'.";
2557 lcCheckSum = Criptografia.GenerateSHA256ToBase64String(lcNombreFicheroDestino);
2558 if (
string.IsNullOrWhiteSpace(lcCheckSum))
2560 this._Error_Message =
"No se ha podido obtener la firma SHA256 del archivo '" + lcNombreFicheroDestino +
"'.";
2565 loLinea._Firma = lcCheckSum;
2571 this._Error_Message =
"No se han podido copiar los archivos de los libros a la ruta de generación '" + lcRutaGeneracion +
"'." +
2572 Environment.NewLine + Environment.NewLine + e.Message;
2585 [ExcludeFromCodeCoverage]
2586 private bool exportarPrepararFicheroNombresTxt()
2593 string lcFicheroNombres = Path.Combine(lcRutaGeneracion,
"NOMBRES.TXT");
2595 using (StreamWriter sw = File.CreateText(lcFicheroNombres))
2597 string lcExtensionFichero =
"", lcNombreFicheroDestino =
"";
2600 if (!
string.IsNullOrWhiteSpace(loLinea._RutaArchivo))
2602 lcExtensionFichero = Path.GetExtension(loLinea._RutaArchivo.Trim());
2603 lcNombreFicheroDestino = loLinea._TipoLibro.Trim() +
"_" + loLinea._NumLibro.Trim() + lcExtensionFichero;
2604 sw.WriteLine(lcNombreFicheroDestino);
2611 this._Error_Message =
"No se ha podido preparar el fichero NOMBRES.TXT en la carpeta '" + lcRutaGeneracion +
"'." +
2612 Environment.NewLine + Environment.NewLine + e.Message;
2624 [ExcludeFromCodeCoverage]
2625 private bool exportarPrepararFicheroDatosTxt()
2632 string lcFicheroDatos = Path.Combine(lcRutaGeneracion,
"DATOS.TXT");
2634 using (StreamWriter sw = File.CreateText(lcFicheroDatos))
2636 this.exportarPrepararFicheroDatosTxt_DatosEmpresario(sw);
2638 this.exportarPrepararFicheroDatosTxt_DatosRegistrales(sw);
2640 this.exportarPrepararFicheroDatosTxt_DatosPresentador(sw);
2642 this.exportarPrepararFicheroDatosTxt_DatosOtros(sw);
2644 this.exportarPrepararFicheroDatosTxt_DatosLibros(sw);
2649 this._Error_Message =
"No se ha podido preparar el fichero DATOS.TXT en la carpeta '" + lcRutaGeneracion +
"'." +
2650 Environment.NewLine + Environment.NewLine + e.Message;
2662 private void exportarPrepararFicheroDatosTxt_DatosEmpresario(StreamWriter sw)
2675 sw.WriteLine(lcCadena);
2679 lcCadena =
"101" + this.getDtosFecha(this.
_Fecha);
2680 sw.WriteLine(lcCadena);
2685 sw.WriteLine(lcCadena);
2690 sw.WriteLine(lcCadena);
2695 sw.WriteLine(lcCadena);
2699 lcCadena =
"105" + this.getCadenaLongitud(this.
_CifEmpresario, 9);
2700 sw.WriteLine(lcCadena);
2705 sw.WriteLine(lcCadena);
2710 sw.WriteLine(lcCadena);
2715 sw.WriteLine(lcCadena);
2720 sw.WriteLine(lcCadena);
2724 lcCadena =
"110" + this.getCadenaLongitud(this.
_FaxEmpresario, 10);
2725 sw.WriteLine(lcCadena);
2730 sw.WriteLine(lcCadena);
2735 sw.WriteLine(lcCadena);
2745 private void exportarPrepararFicheroDatosTxt_DatosRegistrales(StreamWriter sw)
2750 sw.WriteLine(lcCadena);
2759 sw.WriteLine(lcCadena);
2769 sw.WriteLine(lcCadena);
2775 sw.WriteLine(lcCadena);
2780 sw.WriteLine(lcCadena);
2789 sw.WriteLine(lcCadena);
2795 sw.WriteLine(lcCadena);
2805 private void exportarPrepararFicheroDatosTxt_DatosPresentador(StreamWriter sw)
2810 sw.WriteLine(lcCadena);
2815 sw.WriteLine(lcCadena);
2820 sw.WriteLine(lcCadena);
2825 sw.WriteLine(lcCadena);
2830 sw.WriteLine(lcCadena);
2835 sw.WriteLine(lcCadena);
2840 sw.WriteLine(lcCadena);
2845 sw.WriteLine(lcCadena);
2850 sw.WriteLine(lcCadena);
2855 sw.WriteLine(lcCadena);
2860 sw.WriteLine(lcCadena);
2870 private void exportarPrepararFicheroDatosTxt_DatosOtros(StreamWriter sw)
2874 string lcCadena =
"401" + (this._SolicitaRetencion ?
"SI" :
"NO");
2875 sw.WriteLine(lcCadena);
2879 lcCadena =
"501" + Convert.ToString(this.
_NumeroLibros).Trim().PadLeft(3,
'0');
2880 sw.WriteLine(lcCadena);
2890 [ExcludeFromCodeCoverage]
2891 private void exportarPrepararFicheroDatosTxt_DatosLibros(StreamWriter sw)
2893 int lnContadorReg = 1;
2894 string lcCadena =
"";
2898 if (!
string.IsNullOrWhiteSpace(loLineaLibro._RutaArchivo))
2902 lcCadena = Convert.ToString(lnContadorReg).Trim().PadLeft(3,
'0') +
"01" + this.getCadenaLongitud(loLineaLibro._TipoLibroVisual, 100);
2903 sw.WriteLine(lcCadena);
2907 lcCadena = Convert.ToString(lnContadorReg).Trim().PadLeft(3,
'0') +
"02" + this.getCadenaLongitud(loLineaLibro._NumLibro, 3);
2908 sw.WriteLine(lcCadena);
2912 lcCadena = Convert.ToString(lnContadorReg).Trim().PadLeft(3,
'0') +
"03" + this.getDtosFecha(loLineaLibro._FecApertura);
2913 sw.WriteLine(lcCadena);
2917 lcCadena = Convert.ToString(lnContadorReg).Trim().PadLeft(3,
'0') +
"04" + this.getDtosFecha(loLineaLibro._FecCierre);
2918 sw.WriteLine(lcCadena);
2922 lcCadena = Convert.ToString(lnContadorReg).Trim().PadLeft(3,
'0') +
"05" + this.getDtosFecha(loLineaLibro._FecCierreAnt);
2923 sw.WriteLine(lcCadena);
2927 lcCadena = Convert.ToString(lnContadorReg).Trim().PadLeft(3,
'0') +
"06" + this.getCadenaLongitud(loLineaLibro._Firma, 64);
2928 sw.WriteLine(lcCadena);
2941 [ExcludeFromCodeCoverage]
2942 private bool exportarPrepararFicheroZip()
2950 using (ZipFile zip =
new ZipFile())
2952 List<string> lstFicherosAnadir =
new List<string>();
2956 zip.Encryption = EncryptionAlgorithm.None;
2958 zip.CompressionMethod = CompressionMethod.Deflate;
2959 zip.UseZip64WhenSaving = Zip64Option.Never;
2961 this.obtenerListaFicherosAnadirAZip(ref lstFicherosAnadir, lcRutaGeneracion);
2962 zip.AddFiles(lstFicherosAnadir,
false,
"");
2964 string lcNombreFicheroZip = Path.Combine(lcRutaGeneracion,
"LL" + this.
_CodigoRegistro.Trim() +
this._CifEmpresario.Trim() +
".ZIP");
2965 zip.Save(lcNombreFicheroZip);
2967 if (!File.Exists(lcNombreFicheroZip))
2970 this._Error_Message =
"No se ha podido generar correctamente el fichero ZIP de legalización en la carpeta '" + lcRutaGeneracion +
"'";
2977 this._Error_Message =
"No se ha podido generar correctamente el fichero ZIP de legalización en la carpeta '" + lcRutaGeneracion +
"'." +
2978 Environment.NewLine + Environment.NewLine + e.Message;
2990 private void obtenerListaFicherosAnadirAZip(ref List<string> tlstFicheros,
string tcRutaExportacion)
2992 tlstFicheros.Add(Path.Combine(tcRutaExportacion,
"NOMBRES.TXT"));
2993 tlstFicheros.Add(Path.Combine(tcRutaExportacion,
"DATOS.TXT"));
2995 string lcNombreFicheroOrigen =
"", lcExtensionFichero =
"", lcNombreFicheroDestino =
"";
2999 if (!
string.IsNullOrWhiteSpace(loLinea._RutaArchivo))
3001 lcNombreFicheroOrigen = loLinea._RutaArchivo.Trim();
3002 lcExtensionFichero = Path.GetExtension(lcNombreFicheroOrigen);
3003 lcNombreFicheroDestino = Path.Combine(tcRutaExportacion, loLinea._TipoLibro.Trim() +
"_" + loLinea._NumLibro.Trim() + lcExtensionFichero);
3005 tlstFicheros.Add(lcNombreFicheroDestino);
3013 #endregion MÉTODOS PRIVADOS PARA EXPORTAR LEGALIZACION A FICHERO ZIP
3016 #region MÉTODOS PRIVADOS VARIOS
3026 private string getCadenaLongitud(
string tcCadena,
int lnLongitud)
3028 string lcCadenaRetorno = (tcCadena.Length >= lnLongitud ? tcCadena.Substring(0, lnLongitud) : tcCadena.Trim().PadRight(lnLongitud,
' '));
3030 return lcCadenaRetorno;
3039 private string getDtosFecha(DateTime? dtFecha)
3041 string fechaRetorno =
"";
3043 if (dtFecha ==
null)
3044 fechaRetorno =
new string(
' ', 8);
3047 DateTime dtFecha2 = Convert.ToDateTime(dtFecha);
3048 fechaRetorno = Convert.ToString(dtFecha2.Day).Trim().PadLeft(2,
'0') +
3049 Convert.ToString(dtFecha2.Month).Trim().PadLeft(2,
'0') +
3050 Convert.ToString(dtFecha2.Year).Trim();
3052 return fechaRetorno;
3062 private DateTime? setDtosToFecha(
string tcFecha)
3064 DateTime? fechaRetorno =
null;
3066 if (tcFecha.Trim().Length != 8)
3071 fechaRetorno =
new DateTime(Convert.ToInt32(tcFecha.Substring(4, 4)), Convert.ToInt32(tcFecha.Substring(2, 2)) , Convert.ToInt32(tcFecha.Substring(0, 2)));
3075 fechaRetorno =
null;
3078 return fechaRetorno;
3086 [ExcludeFromCodeCoverage]
3087 private void ajustesVisualesGrid(ewgrid toGrid)
3089 if (toGrid.Columns.Contains(
"_TipoLibro"))
3091 toGrid.Columns[
"_TipoLibro"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
3092 toGrid.Columns[
"_TipoLibro"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleLeft;
3095 if (toGrid.Columns.Contains(
"_RutaArchivo"))
3097 toGrid.Columns[
"_RutaArchivo"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
3098 toGrid.Columns[
"_RutaArchivo"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleLeft;
3101 if (toGrid.Columns.Contains(
"_NumLibro"))
3103 toGrid.Columns[
"_NumLibro"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
3104 toGrid.Columns[
"_NumLibro"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
3107 if (toGrid.Columns.Contains(
"_FecApertura"))
3109 toGrid.Columns[
"_FecApertura"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
3110 toGrid.Columns[
"_FecApertura"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
3113 if (toGrid.Columns.Contains(
"_FecCierre"))
3115 toGrid.Columns[
"_FecCierre"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
3116 toGrid.Columns[
"_FecCierre"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
3119 if (toGrid.Columns.Contains(
"_FecCierreAnt"))
3121 toGrid.Columns[
"_FecCierreAnt"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
3122 toGrid.Columns[
"_FecCierreAnt"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
3125 if (toGrid.Columns.Contains(
"_FicheroFirmado"))
3127 toGrid.Columns[
"_FicheroFirmado"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
3128 toGrid.Columns[
"_FicheroFirmado"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
3131 if (toGrid.Columns.Contains(
"_VerFichero"))
3133 toGrid.Columns[
"_VerFichero"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
3134 toGrid.Columns[
"_VerFichero"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
3146 private void legalizacionLibros_Actualizar_Estado_Documento(_EstadosMantenimiento teEstado)
3148 if (this._FormMante ==
null)
3151 formul.EstadosDocumento estadosDocumento = formul.EstadosDocumento.NoHayDocumento;
3155 case _EstadosMantenimiento.EsperandoCodigo:
3156 estadosDocumento = formul.EstadosDocumento.NoHayDocumento;
3159 case _EstadosMantenimiento.MostrandoRegistro:
3160 estadosDocumento = formul.EstadosDocumento.HayDocumento;
3163 case _EstadosMantenimiento.EntrandoNuevo:
3164 estadosDocumento = formul.EstadosDocumento.EntrandoNuevo;
3167 case _EstadosMantenimiento.EditandoRegistro:
3168 estadosDocumento = formul.EstadosDocumento.HayDocumento;
3171 case _EstadosMantenimiento.SinRegistro:
3172 estadosDocumento = formul.EstadosDocumento.NoHayDocumento;
3179 ((frmLegalizacionLibros)_FormMante)._EstadoDocumento = estadosDocumento;
3185 #endregion MÉTODOS PRIVADOS VARIOS
3188 #endregion MÉTODOS PRIVADOS
3191 #region MÉTODOS PÚBLICOS
3197 [ExcludeFromCodeCoverage]
3200 this._oDocPrint =
null;
3217 [ExcludeFromCodeCoverage]
3220 string lcRutaGeneracion =
"";
3221 string lcGrupoEmp = this._dataAccessLegalizacionLibros.ObtenerDbComunes.Trim().Substring(4, 4);
3223 lcRutaGeneracion = Path.Combine(this.
_RutaGeneracion.Trim(),
"Grupo" + lcGrupoEmp.Trim());
3224 lcRutaGeneracion = Path.Combine(lcRutaGeneracion, this._cEmpresa);
3225 lcRutaGeneracion = Path.Combine(lcRutaGeneracion, this._lcAny);
3227 if (!tlNoCrearCarpeta)
3231 if (!Directory.Exists(lcRutaGeneracion))
3232 Directory.CreateDirectory(lcRutaGeneracion);
3239 return lcRutaGeneracion;
3253 this._dataAccessLegalizacionLibros._AgruparLineasPorTipoLibro(
this, this._cEmpresa);
3268 bool llEsPrimerLibro =
false;
3270 if (
string.IsNullOrWhiteSpace(tcTipoLibro))
3273 if (
string.IsNullOrWhiteSpace(tcNumLibro))
3277 if (!Int32.TryParse(tcNumLibro.Trim(), out lnNumLibro))
3281 !
string.IsNullOrWhiteSpace(x._RutaArchivo) && !
string.IsNullOrWhiteSpace(x._NumLibro)
3282 && Convert.ToInt32(x._NumLibro) < lnNumLibro).Count() == 0;
3284 return llEsPrimerLibro;
3297 bool llHayMasLibros =
false;
3299 if (
string.IsNullOrWhiteSpace(tcTipoLibro))
3302 if (
string.IsNullOrWhiteSpace(tcNumLibro))
3306 if (!Int32.TryParse(tcNumLibro.Trim(), out lnNumLibro))
3309 llHayMasLibros = this.
_LineasLegalizacionLibros._Items.Where(x => x._TipoLibro.Trim() == tcTipoLibro.Trim() && !
string.IsNullOrWhiteSpace(x._RutaArchivo) && Convert.ToInt32(x._NumLibro) > lnNumLibro).Count() > 0;
3311 return llHayMasLibros;
3323 DateTime? ldtFechaFinAnterior =
null;
3326 if (loLineaAnterior !=
null)
3328 if (loLineaAnterior._FecCierre !=
null)
3329 ldtFechaFinAnterior = loLineaAnterior._FecCierre;
3332 return ldtFechaFinAnterior;
3342 if (
string.IsNullOrWhiteSpace(tcTipoLibro))
3357 loLinea._NumLibro = Convert.ToString(lnNumLibro).Trim().PadLeft(3,
'0');
3372 string lcNumeroNuevoDocumento =
"";
3375 x._TipoLibro.Trim() == tcTipoLibro);
3376 if (lineasDeclaradas.Count() == 0)
3378 lcNumeroNuevoDocumento =
"001";
3382 lcNumeroNuevoDocumento = lineasDeclaradas.Max(x => x._NumLibro);
3383 if (
string.IsNullOrWhiteSpace(lcNumeroNuevoDocumento))
3384 lcNumeroNuevoDocumento =
"000";
3386 lcNumeroNuevoDocumento = Convert.ToString(Convert.ToInt32(lcNumeroNuevoDocumento) + 1).Trim().PadLeft(3,
'0');
3389 if (
string.IsNullOrWhiteSpace(lcNumeroNuevoDocumento))
3390 lcNumeroNuevoDocumento =
"001";
3392 return lcNumeroNuevoDocumento;
3404 int liniasConArchivo = this.
_LineasLegalizacionLibros._Items.Where(x => !
string.IsNullOrWhiteSpace(x._RutaArchivo)).Count();
3406 if (liniasConArchivo == 0)
3412 int liniasConArchivoSinFirma = this.
_LineasLegalizacionLibros._Items.Where(x => !
string.IsNullOrWhiteSpace(x._RutaArchivo) &&
string.IsNullOrWhiteSpace(x._Firma)).Count();
3414 if (liniasConArchivoSinFirma == 0)
3424 if (liniasConArchivoSinFirma == liniasConArchivo)
3430 else if (liniasConArchivoSinFirma < liniasConArchivo)
3439 return loEstadoFirmas;
3469 if (
string.IsNullOrWhiteSpace(this.
_Numero))
3471 this._Error_Message =
"No tiene cargada ninguna legalización de libros en pantalla.";
3479 this._Error_Message =
"La legalización de libros se encuenta en uso desde otro terminal." + Environment.NewLine + Environment.NewLine +
3480 "Imposible cargar datos de empresario, presentador y registro mercantil.";
3499 if (this.algunDatoDeclaradoDatosPresentacion())
3501 this._Warning_Message =
"Atención, existen datos ya declarados en la pestaña 'Datos de presentación'."+Environment.NewLine+Environment.NewLine+
3502 "Si continua con la acción de carga, los datos existentes en dicha pestaña se perderán pues serán sobreescritos por los procedentes de la carga.";
3520 if (
string.IsNullOrWhiteSpace(this.
_Numero))
3522 this._Error_Message =
"No tiene cargada ninguna legalización de libros en pantalla.";
3530 this._Error_Message =
"La legalización de libros se encuenta en uso desde otro terminal." + Environment.NewLine + Environment.NewLine +
3531 "Imposible importar fichero de legalización en el formulario.";
3539 this._Error_Message =
"La ruta de generación no puede estar vacía pues se utiliza para volcar el resultado de la importación." + Environment.NewLine + Environment.NewLine +
3540 "Imposible importar fichero de legalización en el formulario.";
3544 tcArchivoZipLegalizacion =
"";
3545 if (!this.seleccionarArchivoZipValido(out tcArchivoZipLegalizacion))
3564 bool llWarning =
false;
3568 this._Warning_Message =
"Atención, actualmente tiene declarados ya " + Convert.ToString(lnNumLibros).Trim() +
" " + (lnNumLibros > 1 ?
"libros" :
"libro") +
" en la legalización." +
3569 Environment.NewLine+Environment.NewLine+
"Si continúa con la importación de datos a partir de fichero ZIP, perderá estos datos.";
3573 if (this.algunDatoDeclaradoDatosPresentacion())
3576 this._Warning_Message += Environment.NewLine + Environment.NewLine;
3578 this._Warning_Message +=
"Atención, existen datos ya declarados en la pestaña 'Datos de presentación'." + Environment.NewLine + Environment.NewLine +
3579 "Si continua con la importación de datos a partir de fichero ZIP, los datos existentes en dicha pestaña se perderán pues serán sobreescritos por los procedentes de la importación.";
3591 int lnNumFicheros = 0;
3592 if (this.algunFicheroEnRutaGeneracion(lcRutaGeneracion, out lnNumFicheros))
3594 this._Warning_Message =
"Atención, se ha detectado la existencia de " + Convert.ToString(lnNumFicheros).Trim() +
" " + (lnNumFicheros > 1 ?
"archivos" :
"archivo") +
" " +
3595 "en la ruta donde debe generarse el fichero ZIP de la legalización." + Environment.NewLine + Environment.NewLine + lcRutaGeneracion + Environment.NewLine + Environment.NewLine +
3596 "Antes de realizar la creación del fichero ZIP de la legalización se eliminarán todos los archivos existentes en dicha carpeta.";
3612 this._Error_Message =
"";
3614 if (
string.IsNullOrWhiteSpace(this.
_Numero))
3616 this._Error_Message =
"No se ha cargado todavía ninguna legalización.";
3622 this._Error_Message =
"No se ha declarado todavía ningún libro en el apartado 'Relación de libros'.";
3630 this._Error_Message =
"La legalización de libros se encuenta en uso desde otro terminal." + Environment.NewLine + Environment.NewLine +
3631 "Imposible imprimir solicitud de legalización en este momento.";
3636 int liniasSinArchivo = this.
_LineasLegalizacionLibros._Items.Where(x =>
string.IsNullOrWhiteSpace(x._RutaArchivo)).Count();
3637 if (liniasSinArchivo > 0)
3639 this._Error_Message =
"Se ha detectado algún libro en el apartado 'Relación de libros' sin ruta de archivo declarada." + Environment.NewLine + Environment.NewLine +
3640 "Para poder realizar la impresión de la solicitud de legalización es necesario declarar los archivos de todos los libros, y generar ficheros y firmas de todos los libros.";
3644 int liniasArchivoSinFirma = this.
_LineasLegalizacionLibros._Items.Where(x => !
string.IsNullOrWhiteSpace(x._RutaArchivo) &&
string.IsNullOrWhiteSpace(x._Firma)).Count();
3645 if (liniasArchivoSinFirma > 0)
3647 this._Error_Message =
"Se ha detectado algún libro en el apartado 'Relación de libros' sin firma realizada." + Environment.NewLine + Environment.NewLine +
3648 "Para poder realizar la impresión de la solicitud de legalización es necesario generar ficheros y firmas de todos los libros.";
3665 this._Error_Message =
"";
3669 if (
string.IsNullOrWhiteSpace(this.
_Numero))
3671 this._Error_Message =
"No se ha cargado todavía ninguna legalización.";
3679 this._Error_Message =
"No se ha declarado todavía ningún libro en el apartado 'Relación de libros'.";
3687 this._Error_Message =
"La legalización de libros se encuenta en uso desde otro terminal." + Environment.NewLine + Environment.NewLine +
3688 "Imposible generar fichero ZIP de legalización en este momento.";
3696 this._Error_Message =
"La ruta de generación no puede estar vacía." + Environment.NewLine + Environment.NewLine +
3697 "Imposible generar fichero ZIP de legalización.";
3703 int liniasSinArchivo = this.
_LineasLegalizacionLibros._Items.Where(x =>
string.IsNullOrWhiteSpace(x._RutaArchivo)).Count();
3704 if (liniasSinArchivo > 0)
3706 this._Error_Message =
"Se ha detectado algún libro en el apartado 'Relación de libros' sin ruta de archivo declarada." + Environment.NewLine + Environment.NewLine +
3707 "Para poder realizar la creación de ficheros y firmas todos los libros deben tener ruta de archivo declarada.";
3713 string lcFichero =
"";
3714 string lcFicherosFaltan =
"";
3715 int lnFicherosInexistentes = 0;
3718 lcFichero = loLinea._RutaArchivo.Trim();
3719 if (!File.Exists(lcFichero))
3721 lnFicherosInexistentes++;
3722 lcFicherosFaltan += lcFichero + Environment.NewLine;
3725 if (lnFicherosInexistentes>0)
3727 this._Error_Message =
"No se ha detectado la existencia de " + (lnFicherosInexistentes == 1 ?
"el fichero" :
"los ficheros siguientes") +
":" +
3728 Environment.NewLine + Environment.NewLine + lcFicherosFaltan + Environment.NewLine + Environment.NewLine +
3729 "Para poder realizar la creación de ficheros de la legalización, todos los libros deben tener como ruta un archivo existente.";
3737 this._Error_Message =
"Falta declarar la ruta donde generar los ficheros.";
3745 if (!Directory.Exists(lcRutaGeneracion))
3749 Directory.CreateDirectory(lcRutaGeneracion);
3754 if (!Directory.Exists(lcRutaGeneracion))
3756 this._Error_Message =
"No ha sido posible crear el directorio de exportación '"+ lcRutaGeneracion.Trim()+
"'.";
3764 string lcFaltaCampo =
"";
3765 if (!this.datosEmpresarioOk(ref lcFaltaCampo))
3767 this._Error_Message =
"Falta declarar el campo '"+lcFaltaCampo+
"' en el apartado 'Datos del empresario' de la pestaña 'Datos de presentación'.";
3771 if (!this.datosPresentadorOk(ref lcFaltaCampo))
3773 this._Error_Message =
"Falta declarar el campo '" + lcFaltaCampo +
"' en el apartado 'Datos del presentador' de la pestaña 'Datos de presentación'.";
3777 if (!this.datosRegistroOk(ref lcFaltaCampo))
3779 this._Error_Message =
"Falta declarar el campo '" + lcFaltaCampo +
"' en el apartado 'Datos registrales' de la pestaña 'Datos de presentación'.";
3800 int lnNumFicheros = 0;
3801 if (this.algunFicheroEnRutaGeneracion(lcRutaGeneracion, out lnNumFicheros))
3803 this._Warning_Message =
"Atención, se ha detectado la existencia de "+Convert.ToString(lnNumFicheros).Trim() +
" "+(lnNumFicheros > 1 ?
"archivos" :
"archivo") +
" " +
3804 "en la ruta donde debe generarse el fichero ZIP de la legalización."+Environment.NewLine+Environment.NewLine+lcRutaGeneracion + Environment.NewLine + Environment.NewLine +
3805 "Antes de realizar la creación del fichero ZIP de la legalización se eliminarán todos los archivos existentes en dicha carpeta.";
3816 [ExcludeFromCodeCoverage]
3825 if (!
string.IsNullOrWhiteSpace(this.
_Codigo))
3827 if (this._FormMante !=
null)
3828 this._FormMante._CargarDocumento();
3841 [ExcludeFromCodeCoverage]
3844 this._LineasLegalizacionLibros._Grid = mantegrid;
3848 this.ajustesVisualesGrid(loGrid);
3858 [ExcludeFromCodeCoverage]
3861 this._FormMante = formMante;
3869 [ExcludeFromCodeCoverage]
3874 if (!
string.IsNullOrWhiteSpace(EW_GLOBAL._Empresa._NombreTC))
3876 this._NombreEmpresario = EW_GLOBAL._Empresa._NombreTC;
3882 this._NombreEmpresario = EW_GLOBAL._Empresa._ApellidosTC;
3885 if (!
string.IsNullOrWhiteSpace(EW_GLOBAL._Empresa._NombreTC))
3891 string lcApellidos = EW_GLOBAL._Empresa._ApellidosTC.Trim();
3892 int lnPosEspacio = lcApellidos.IndexOf(
' ');
3893 if (lnPosEspacio > 0)
3898 this._Apellido1Empresario = lcApellidos.Substring(0, lnPosEspacio);
3899 this._Apellido2Empresario = lcApellidos.Substring(lnPosEspacio + 1);
3904 this._Apellido1Empresario = lcApellidos;
3905 this._Apellido2Empresario =
"";
3909 this._CifEmpresario = EW_GLOBAL._Empresa._CifTC;
3914 this._CodigoRegistro = EW_GLOBAL._Empresa._CodigoAdministracion;
3915 this._NumeroTomoRegistro = EW_GLOBAL._Empresa._NumeroTomoRegistro;
3916 this._NumeroLibroRegistro = EW_GLOBAL._Empresa._NumeroLibroRegistro;
3917 this._NumeroSeccionRegistro = EW_GLOBAL._Empresa._NumeroSeccionRegistro;
3918 this._NumeroFolioRegistro = EW_GLOBAL._Empresa._NumeroFolioRegistro;
3919 this._NumeroHojaRegistro = EW_GLOBAL._Empresa._NumeroHojaRegistro;
3920 this._TipoRegistroMercantil = EW_GLOBAL._Empresa._TipoRegistroPublico;
3921 this._OtrosRegistroMercantil = EW_GLOBAL._Empresa._OtrosRegistro;
3922 this._RegistroMercantil = EW_GLOBAL._Empresa._RegistroMercantil;
3923 this._IRUS = EW_GLOBAL._Empresa._IRUS;
3932 [ExcludeFromCodeCoverage]
3935 string lcDireccion = EW_GLOBAL._Empresa._SiglaTC.Trim() +
" " +
3936 EW_GLOBAL._Empresa._NombreViaTC.Trim() +
3937 (!
string.IsNullOrWhiteSpace(EW_GLOBAL._Empresa._NumeroTC) ?
" " + EW_GLOBAL._Empresa._NumeroTC.Trim() :
"") +
3938 (!
string.IsNullOrWhiteSpace(EW_GLOBAL._Empresa._EscaleraTC) ?
" " + EW_GLOBAL._Empresa._EscaleraTC.Trim() :
"") +
3939 (!
string.IsNullOrWhiteSpace(EW_GLOBAL._Empresa._PisoTC) ?
" " + EW_GLOBAL._Empresa._PisoTC.Trim() :
"") +
3940 (!
string.IsNullOrWhiteSpace(EW_GLOBAL._Empresa._PuertaTC) ?
" " + EW_GLOBAL._Empresa._PuertaTC.Trim() :
"");
3942 lcDireccion = lcDireccion.Trim();
3943 if (lcDireccion.Length > 32)
3944 lcDireccion = lcDireccion.Substring(0, 32);
3946 this._DireccionEmpresario = lcDireccion;
3947 this._CodposEmpresario = EW_GLOBAL._Empresa._CodigoPostalTC;
3948 this._CiudadEmpresario = EW_GLOBAL._Empresa._MunicipioTC;
3949 this._ProvinciaEmpresario = EW_GLOBAL._Empresa._ProvinciaTC;
3950 this._TelefonoEmpresario = EW_GLOBAL._Empresa._TelefonoTC;
3951 this._FaxEmpresario = EW_GLOBAL._Empresa._FaxTC;
3955 this._NombrePresentador = EW_GLOBAL._Empresa._NombreContactoTC;
3957 string lcApellidos = EW_GLOBAL._Empresa._ApellidosContactoTC.Trim();
3958 int lnPosEspacio = lcApellidos.IndexOf(
' ');
3959 if (lnPosEspacio > 0)
3964 this._Apellido1Presentador = lcApellidos.Substring(0, lnPosEspacio);
3965 this._Apellido2Presentador = lcApellidos.Substring(lnPosEspacio + 1);
3971 this._Apellido1Presentador = lcApellidos;
3972 this._Apellido2Presentador =
"";
3974 this._CifPresentador = EW_GLOBAL._Empresa._CifContactoTC;
3976 this._DireccionPresentador = EW_GLOBAL._Empresa._NombreViaContactoTC;
3977 this._CodposPresentador = EW_GLOBAL._Empresa._CodigoPostalContactoTC;
3978 this._CiudadPresentador = EW_GLOBAL._Empresa._MunicipioContactoTC;
3979 this._ProvinciaPresentador = EW_GLOBAL._Empresa._ProvinciaContactoTC;
3980 this._TelefonoPresentador = EW_GLOBAL._Empresa._TelefonoContactoTC;
3981 this._FaxPresentador = EW_GLOBAL._Empresa._FaxContactoTC;
3982 this._EmailPresentador = EW_GLOBAL._Empresa._C_emailTC;
3991 [ExcludeFromCodeCoverage]
3994 string lcDireccion = EW_GLOBAL._Empresa._SiglaCanarias.Trim() +
" " +
3995 EW_GLOBAL._Empresa._NombreViaCanarias.Trim() +
3996 (!
string.IsNullOrWhiteSpace(EW_GLOBAL._Empresa._NumeroCanarias) ?
" " + EW_GLOBAL._Empresa._NumeroCanarias.Trim() :
"") +
3997 (!
string.IsNullOrWhiteSpace(EW_GLOBAL._Empresa._EscaleraCanarias) ?
" " + EW_GLOBAL._Empresa._EscaleraCanarias.Trim() :
"") +
3998 (!
string.IsNullOrWhiteSpace(EW_GLOBAL._Empresa._PisoCanarias) ?
" " + EW_GLOBAL._Empresa._PisoCanarias.Trim() :
"") +
3999 (!
string.IsNullOrWhiteSpace(EW_GLOBAL._Empresa._PuertaCanarias) ?
" " + EW_GLOBAL._Empresa._PuertaCanarias.Trim() :
"");
4001 lcDireccion = lcDireccion.Trim();
4002 if (lcDireccion.Length > 32)
4003 lcDireccion = lcDireccion.Substring(0, 32);
4005 this._DireccionEmpresario = lcDireccion;
4006 this._CodposEmpresario = EW_GLOBAL._Empresa._CodigoPostalCanarias;
4007 this._CiudadEmpresario = EW_GLOBAL._Empresa._MunicipioCanarias;
4008 this._ProvinciaEmpresario = EW_GLOBAL._Empresa._ProvinciaCanarias;
4009 this._TelefonoEmpresario = EW_GLOBAL._Empresa._TelefonoCanarias;
4010 this._FaxEmpresario = EW_GLOBAL._Empresa._FaxCanarias;
4014 this._NombrePresentador = EW_GLOBAL._Empresa._NombreContactoCanarias;
4016 string lcApellidos = EW_GLOBAL._Empresa._ApellidosContactoCanarias.Trim();
4017 int lnPosEspacio = lcApellidos.IndexOf(
' ');
4018 if (lnPosEspacio > 0)
4023 this._Apellido1Presentador = lcApellidos.Substring(0, lnPosEspacio);
4024 this._Apellido2Presentador = lcApellidos.Substring(lnPosEspacio + 1);
4030 this._Apellido1Presentador = lcApellidos;
4031 this._Apellido2Presentador =
"";
4033 this._CifPresentador = EW_GLOBAL._Empresa._CifContactoCanarias;
4035 this._DireccionPresentador = EW_GLOBAL._Empresa._NombreViaContactoCanarias;
4036 this._CodposPresentador = EW_GLOBAL._Empresa._CodigoPostalContactoCanarias;
4037 this._CiudadPresentador = EW_GLOBAL._Empresa._MunicipioContactoCanarias;
4038 this._ProvinciaPresentador = EW_GLOBAL._Empresa._ProvinciaContactoCanarias;
4039 this._TelefonoPresentador = EW_GLOBAL._Empresa._TelefonoContactoCanarias;
4040 this._FaxPresentador = EW_GLOBAL._Empresa._FaxContactoCanarias;
4041 this._EmailPresentador = EW_GLOBAL._Empresa._EmailContactoCanarias;
4055 [ExcludeFromCodeCoverage]
4058 this._Error_Message =
"";
4064 string lcCarpetaImportacion =
"";
4065 if (!this.asegurarCarpetaImportacionVacia(out lcCarpetaImportacion))
4068 string lcNombreFicheroDestino = Path.Combine(lcCarpetaImportacion, Path.GetFileName(tcFicheroZipLegalizacion));
4070 File.Copy(tcFicheroZipLegalizacion, lcNombreFicheroDestino);
4072 if (!File.Exists(lcNombreFicheroDestino))
4074 this._Error_Message =
"No se ha podido copiar el fichero ZIP de legalización '" + tcFicheroZipLegalizacion +
"' a la carpeta de importación '" + lcCarpetaImportacion +
"'.";
4078 if (!this.verificarRecuperarArchivoZip(lcNombreFicheroDestino,
true))
4092 [ExcludeFromCodeCoverage]
4095 this._Error_Message =
"";
4096 bool llRetorno =
true;
4102 bool llTodosArchivosBorrados = this.borrarTodosArchivosRuta(lcRutaGeneracion);
4103 if (!llTodosArchivosBorrados)
4105 this._Error_Message =
"No se han podido borrar todos los archivos existentes en la carpeta '" + lcRutaGeneracion +
"'." + Environment.NewLine + Environment.NewLine +
4106 "Imposible realizar la creación de fichero ZIP de la legalización.";
4113 bool llOk = this.exportarCopiarFicherosARutaGeneracion();
4120 llOk = this.exportarPrepararFicheroNombresTxt();
4127 llOk = this.exportarPrepararFicheroDatosTxt();
4134 llOk = this.exportarPrepararFicheroZip();
4143 #endregion MÉTODOS PÚBLICOS
4146 #region CLASE DE LINEAS DE LIBROS PRESENTADOS EN LA LEGALIZACION
4154 #region PROPIEDADES PRIVADAS
4160 private string _lcEmpresa = Convert.ToString(EW_GLOBAL._GetVariable(
"wc_empresa"));
4169 #endregion PROPIEDADES PRIVADAS
4172 #region PROPIEDADES PUBLICAS
4194 #endregion PROPIEDADES PUBLICAS
4222 this(null, legalizacionLibrosDA)
4241 base(legalizacionLibrosDA)
4251 this.cargarDicLstTiposLibro();
4253 this.crearEstructura();
4255 if (!
string.IsNullOrEmpty(tcEjercicio))
4257 this._Claves._Empresa._Valor = this._lcEmpresa;
4258 this._Claves._Numero._Valor = tcEjercicio;
4268 private void crearEstructura()
4270 this._DataBase =
"COMUNES";
4271 this._Tabla =
"D_LEGLBR";
4272 this._OrdenarPor =
"LINEA";
4273 this._Condicion =
"";
4277 ewCampoTRel def_Empresa = this._AddCampoTRel(
"_Empresa",
"Empresa");
4278 def_Empresa._AnchoColumna = 7;
4279 def_Empresa._AutoModeSizeColumna = DataGridViewAutoSizeColumnMode.None;
4280 def_Empresa._Editable =
false;
4281 def_Empresa._Error_Duplicados =
"";
4282 def_Empresa._Error_Validar_Dato =
"";
4283 def_Empresa._ExpandirPunto =
false;
4284 def_Empresa._FormatString =
"";
4285 def_Empresa._PermiteDuplicados =
true;
4286 def_Empresa._TipoColumna = gridColumnsTypes.Texto;
4287 def_Empresa._Titulo =
"Empresa";
4288 def_Empresa._Updatable =
true;
4289 def_Empresa._Validar_Asignar_Cargando =
false;
4290 def_Empresa._Validar_Dato_BaseDatos =
"";
4291 def_Empresa._Validar_Dato_Campos =
"";
4292 def_Empresa._Validar_Dato_CampoTRel_Asignar =
"";
4293 def_Empresa._Validar_Dato_Clave =
"";
4294 def_Empresa._Validar_Dato_Tabla =
"";
4295 def_Empresa._Visible =
false;
4300 ewCampoTRel def_Numero = this._AddCampoTRel(
"_Numero",
"Numero");
4301 def_Numero._AnchoColumna = 7;
4302 def_Numero._AutoModeSizeColumna = DataGridViewAutoSizeColumnMode.None;
4303 def_Numero._Editable =
false;
4304 def_Numero._Error_Duplicados =
"Ha introducido un valor que ya está asignado a otro registro. No se permiten valores duplicados en este campo.";
4305 def_Numero._Error_Validar_Dato =
"Ha introducido un valor que no se ha encontrado en su mantenimiento origen.";
4306 def_Numero._ExpandirPunto =
false;
4307 def_Numero._FormatString =
"";
4308 def_Numero._PermiteDuplicados =
true;
4309 def_Numero._TipoColumna = gridColumnsTypes.Texto;
4310 def_Numero._Titulo =
"Ejercicio";
4311 def_Numero._Updatable =
true;
4312 def_Numero._Validar_Asignar_Cargando =
false;
4313 def_Numero._Validar_Dato_BaseDatos =
"";
4314 def_Numero._Validar_Dato_Campos =
"";
4315 def_Numero._Validar_Dato_CampoTRel_Asignar =
"";
4316 def_Numero._Validar_Dato_Clave =
"";
4317 def_Numero._Validar_Dato_Tabla =
"";
4318 def_Numero._Visible =
false;
4323 this._AddCampoTRel(
"_Linia",
"Linea", ewCampoTRel.Visible.No, ewCampoTRel.Updatable.Si, ewCampoTRel.Editable.No,
"", gridColumnsTypes.Número);
4328 this._AddCampoTRel(
"_TipoLibro",
"Tipo",
false,
true,
false);
4334 ewCampoTRel def_TipoLibro = this._AddCampoTRel(
"_TipoLibroVisual",
"",
true,
false,
true,
"Tipo de libro", gridColumnsTypes.Combo, toComboValues:
this._lstTiposLibro, tnAnchoColumna : 24);
4335 def_TipoLibro._AutoModeSizeColumna = DataGridViewAutoSizeColumnMode.None;
4336 def_TipoLibro._Error_Duplicados =
"";
4337 def_TipoLibro._Error_Validar_Dato =
"";
4338 def_TipoLibro._ExpandirPunto =
false;
4339 def_TipoLibro._FormatString =
"";
4340 def_TipoLibro._PermiteDuplicados =
false;
4345 ewCampoTRel def_RutaArchivo = this._AddCampoTRel(
"_RutaArchivo",
"Ruta_fich");
4346 def_RutaArchivo._AnchoColumna = 0;
4347 def_RutaArchivo._AutoModeSizeColumna = DataGridViewAutoSizeColumnMode.Fill;
4348 def_RutaArchivo._Editable =
true;
4349 def_RutaArchivo._Error_Duplicados =
"";
4350 def_RutaArchivo._Error_Validar_Dato =
"";
4351 def_RutaArchivo._ExpandirPunto =
false;
4352 def_RutaArchivo._FormatString =
"";
4353 def_RutaArchivo._PermiteDuplicados =
true;
4354 def_RutaArchivo._TipoColumna = gridColumnsTypes.Texto;
4355 def_RutaArchivo._Titulo =
"Fichero";
4356 def_RutaArchivo._Updatable =
true;
4357 def_RutaArchivo._Validar_Asignar_Cargando =
false;
4358 def_RutaArchivo._Validar_Dato_BaseDatos =
"";
4359 def_RutaArchivo._Validar_Dato_Campos =
"";
4360 def_RutaArchivo._Validar_Dato_CampoTRel_Asignar =
"";
4361 def_RutaArchivo._Validar_Dato_Clave =
"";
4362 def_RutaArchivo._Validar_Dato_Tabla =
"";
4363 def_RutaArchivo._Visible =
true;
4368 this._AddCampoTRel(
"",
"", ewCampoTRel.Visible.Si, ewCampoTRel.Updatable.No, ewCampoTRel.Editable.No,
"", gridColumnsTypes.Boton,
null, 2,
null,
"...");
4373 ewCampoTRel def_NumLibro = this._AddCampoTRel(
"_NumLibro",
"Num_libro");
4374 def_NumLibro._AnchoColumna = 5;
4375 def_NumLibro._AutoModeSizeColumna = DataGridViewAutoSizeColumnMode.None;
4376 def_NumLibro._Editable =
true;
4377 def_NumLibro._Error_Duplicados =
"";
4378 def_NumLibro._Error_Validar_Dato =
"";
4379 def_NumLibro._ExpandirPunto =
false;
4380 def_NumLibro._FormatString =
"";
4381 def_NumLibro._PermiteDuplicados =
true;
4382 def_NumLibro._TipoColumna = gridColumnsTypes.Texto;
4383 def_NumLibro._Titulo =
"Número";
4384 def_NumLibro._Updatable =
true;
4385 def_NumLibro._Validar_Asignar_Cargando =
false;
4386 def_NumLibro._Validar_Dato_BaseDatos =
"";
4387 def_NumLibro._Validar_Dato_Campos =
"";
4388 def_NumLibro._Validar_Dato_CampoTRel_Asignar =
"";
4389 def_NumLibro._Validar_Dato_Clave =
"";
4390 def_NumLibro._Validar_Dato_Tabla =
"";
4391 def_NumLibro._Visible =
true;
4396 ewCampoTRel def_FechaApertura = this._AddCampoTRel(
"_FecApertura",
"Fec_aper");
4397 def_FechaApertura._AnchoColumna = 7;
4398 def_FechaApertura._AutoModeSizeColumna = DataGridViewAutoSizeColumnMode.None;
4399 def_FechaApertura._Editable =
true;
4400 def_FechaApertura._Error_Duplicados =
"";
4401 def_FechaApertura._Error_Validar_Dato =
"";
4402 def_FechaApertura._ExpandirPunto =
false;
4403 def_FechaApertura._FormatString =
"";
4404 def_FechaApertura._PermiteDuplicados =
true;
4405 def_FechaApertura._TipoColumna = gridColumnsTypes.Fecha;
4406 def_FechaApertura._Titulo =
"Fecha apertura";
4407 def_FechaApertura._Updatable =
true;
4408 def_FechaApertura._Validar_Asignar_Cargando =
false;
4409 def_FechaApertura._Validar_Dato_BaseDatos =
"";
4410 def_FechaApertura._Validar_Dato_Campos =
"";
4411 def_FechaApertura._Validar_Dato_CampoTRel_Asignar =
"";
4412 def_FechaApertura._Validar_Dato_Clave =
"";
4413 def_FechaApertura._Validar_Dato_Tabla =
"";
4414 def_FechaApertura._Visible =
true;
4419 ewCampoTRel def_FechaCierre = this._AddCampoTRel(
"_FecCierre",
"Fec_cierre");
4420 def_FechaCierre._AnchoColumna = 6;
4421 def_FechaCierre._AutoModeSizeColumna = DataGridViewAutoSizeColumnMode.None;
4422 def_FechaCierre._Editable =
true;
4423 def_FechaCierre._Error_Duplicados =
"";
4424 def_FechaCierre._Error_Validar_Dato =
"";
4425 def_FechaCierre._ExpandirPunto =
false;
4426 def_FechaCierre._FormatString =
"";
4427 def_FechaCierre._PermiteDuplicados =
true;
4428 def_FechaCierre._TipoColumna = gridColumnsTypes.Fecha;
4429 def_FechaCierre._Titulo =
"Fecha cierre";
4430 def_FechaCierre._Updatable =
true;
4431 def_FechaCierre._Validar_Asignar_Cargando =
false;
4432 def_FechaCierre._Validar_Dato_BaseDatos =
"";
4433 def_FechaCierre._Validar_Dato_Campos =
"";
4434 def_FechaCierre._Validar_Dato_CampoTRel_Asignar =
"";
4435 def_FechaCierre._Validar_Dato_Clave =
"";
4436 def_FechaCierre._Validar_Dato_Tabla =
"";
4437 def_FechaCierre._Visible =
true;
4442 ewCampoTRel def_FechaCierreAnt = this._AddCampoTRel(
"_FecCierreAnt",
"Fec_cie_an");
4443 def_FechaCierreAnt._AnchoColumna = 7;
4444 def_FechaCierreAnt._AutoModeSizeColumna = DataGridViewAutoSizeColumnMode.None;
4445 def_FechaCierreAnt._Editable =
true;
4446 def_FechaCierreAnt._Error_Duplicados =
"";
4447 def_FechaCierreAnt._Error_Validar_Dato =
"";
4448 def_FechaCierreAnt._ExpandirPunto =
false;
4449 def_FechaCierreAnt._FormatString =
"";
4450 def_FechaCierreAnt._PermiteDuplicados =
true;
4451 def_FechaCierreAnt._TipoColumna = gridColumnsTypes.Fecha;
4452 def_FechaCierreAnt._Titulo =
"F.Cierre Lib.Ant.";
4453 def_FechaCierreAnt._Updatable =
true;
4454 def_FechaCierreAnt._Validar_Asignar_Cargando =
false;
4455 def_FechaCierreAnt._Validar_Dato_BaseDatos =
"";
4456 def_FechaCierreAnt._Validar_Dato_Campos =
"";
4457 def_FechaCierreAnt._Validar_Dato_CampoTRel_Asignar =
"";
4458 def_FechaCierreAnt._Validar_Dato_Clave =
"";
4459 def_FechaCierreAnt._Validar_Dato_Tabla =
"";
4460 def_FechaCierreAnt._Visible =
true;
4464 ewCampoTRel def_Firma = this._AddCampoTRel(
"_Firma",
"Firma");
4465 def_Firma._AnchoColumna = 0;
4466 def_Firma._AutoModeSizeColumna = DataGridViewAutoSizeColumnMode.None;
4467 def_Firma._Editable =
false;
4468 def_Firma._Error_Duplicados =
"";
4469 def_Firma._Error_Validar_Dato =
"";
4470 def_Firma._ExpandirPunto =
false;
4471 def_Firma._FormatString =
"";
4472 def_Firma._PermiteDuplicados =
true;
4473 def_Firma._TipoColumna = gridColumnsTypes.Texto;
4474 def_Firma._Titulo =
"Firma";
4475 def_Firma._Updatable =
true;
4476 def_Firma._Validar_Asignar_Cargando =
false;
4477 def_Firma._Validar_Dato_BaseDatos =
"";
4478 def_Firma._Validar_Dato_Campos =
"";
4479 def_Firma._Validar_Dato_CampoTRel_Asignar =
"";
4480 def_Firma._Validar_Dato_Clave =
"";
4481 def_Firma._Validar_Dato_Tabla =
"";
4482 def_Firma._Visible =
false;
4488 ewCampoTRel def_Verfichero = this._AddCampoTRel(
"_VerFichero",
"", ewCampoTRel.Visible.Si, ewCampoTRel.Updatable.No, ewCampoTRel.Editable.No,
"", gridColumnsTypes.Imagen);
4489 def_Verfichero._AnchoColumna = 3;
4490 def_Verfichero._AutoModeSizeColumna = DataGridViewAutoSizeColumnMode.None;
4491 def_Verfichero._Titulo =
"Ver";
4496 ewCampoTRel def_Firmado = this._AddCampoTRel(
"_FicheroFirmado",
"", ewCampoTRel.Visible.Si, ewCampoTRel.Updatable.No, ewCampoTRel.Editable.No,
"", gridColumnsTypes.Imagen);
4497 def_Firmado._AnchoColumna = 5;
4498 def_Firmado._AutoModeSizeColumna = DataGridViewAutoSizeColumnMode.None;
4499 def_Firmado._Titulo =
"Firmado";
4508 private void cargarDicLstTiposLibro()
4510 this._dicTiposLibro.Clear();
4514 this._dicTiposLibro.Add(
"Diario",
"DIARIO");
4515 this._dicTiposLibro.Add(
"Inventario y cuentas anuales" ,
"INV_CUEN");
4516 this._dicTiposLibro.Add(
"Balances de comprobación (sumas y saldos)",
"BAL_SUMS");
4517 this._dicTiposLibro.Add(
"Inventario",
"INVENTAR");
4518 this._dicTiposLibro.Add(
"Balances",
"BALANCES");
4519 this._dicTiposLibro.Add(
"Memoria",
"MEMORIA");
4520 this._dicTiposLibro.Add(
"Mayor",
"MAYOR");
4521 this._dicTiposLibro.Add(
"Libro de Pérdidas y Ganancias",
"PER_GAN");
4522 this._dicTiposLibro.Add(
"IVA",
"IVA");
4523 this._dicTiposLibro.Add(
"Facturas emitidas",
"FAC_EMIT");
4524 this._dicTiposLibro.Add(
"Facturas recibidas",
"FAC_RECI");
4525 this._dicTiposLibro.Add(
"Detalle del Diario",
"DET_DIA");
4526 this._dicTiposLibro.Add(
"Registro de Acciones Nominativas",
"ACCIONES");
4527 this._dicTiposLibro.Add(
"Registro de Socios",
"SOCIOS");
4528 this._dicTiposLibro.Add(
"Libro de Actas" ,
"ACTASCON");
4529 this._dicTiposLibro.Add(
"Libro de Detalle de Actas",
"ACTASDET");
4530 this._dicTiposLibro.Add(
"Libro de Actas del Consejo",
"ACTALCON");
4531 this._dicTiposLibro.Add(
"Libro de Detalle de Actas del Consejo",
"ACTACODE");
4532 this._dicTiposLibro.Add(
"Libro de Contratos del Socio Único con la Sociedad Unipersonal",
"SOCUNICO");
4533 this._dicTiposLibro.Add(
"Otros",
"OTROS");
4535 this._lstTiposLibro.Clear();
4536 foreach (KeyValuePair<string, string> loKeyValuePair
in this._dicTiposLibro)
4537 this._lstTiposLibro.Add(loKeyValuePair.Key);
4543 #endregion CONSTRUCTOR
4546 #region MÉTODOS PUBLIC OVERRIDE SOBREESCRITOS DE EWMANTTREL
4559 this._bIsLoading =
true;
4563 this._bIsLoading =
false;
4572 [ExcludeFromCodeCoverage]
4580 bool llOk = base._Save();
4586 #endregion MÉTODOS PUBLIC OVERRIDE SOBREESCRITOS DE EWMANTTREL
4621 this._Empresa =
new ClaveTRel();
4622 this._Empresa._EsFiltro =
true;
4623 this._Empresa._EsCampoLinea =
false;
4628 this._Numero =
new ClaveTRel();
4629 this._Numero._EsFiltro =
true;
4630 this._Numero._EsCampoLinea =
false;
4635 this._Linia =
new ClaveTRel();
4636 this._Linia._EsCampoLinea =
true;
4637 this._Linia._Valor = 0;
4647 #region PROPIEDADES PRIVADAS
4662 #endregion PROPIEDADES PRIVADAS
4665 #region PROPIEDADES PUBLICAS
4676 return this._cEmpresa;
4680 this._cEmpresa = value;
4686 private string _cEmpresa =
"";
4697 return this._cNumero;
4701 this._cNumero = value;
4707 private string _cNumero =
"";
4715 get {
return _nLinia; }
4716 set { _nLinia = value; }
4718 private int _nLinia = 0;
4728 if (_cTipoLibro ==
null)
4735 _cTipoLibro = value;
4738 private string _cTipoLibro =
"";
4748 string lcTipoLibroVisual = this._oLineasLegalizacion._dicTiposLibro.FirstOrDefault(x => x.Value ==
this._TipoLibro.Trim()).Key;
4750 return lcTipoLibroVisual;
4757 string lcTipoLibro =
"";
4759 this._oLineasLegalizacion._dicTiposLibro.TryGetValue(value.Trim(), out lcTipoLibro);
4761 this._TipoLibro = lcTipoLibro;
4773 return _cRutaArchivo;
4777 _cRutaArchivo = value;
4780 private string _cRutaArchivo =
"";
4797 private string _cNumLibro =
"";
4808 return this._dFecApertura;
4812 if (loParent !=
null && !loParent._bIsLoading)
4814 bool llCambio = (this._dFecApertura != value);
4818 if (value !=
null && this._dFecCierre !=
null && value >= this._dFecCierre)
4820 this._oLineasLegalizacion._oLegalizacion._Error_Message_Linea =
"La fecha de apertura (" + Convert.ToDateTime(value).ToShortDateString() +
") debe ser inferior a la fecha de cierre (" + Convert.ToDateTime(this._dFecCierre).ToShortDateString() +
").";
4826 this._dFecApertura = value;
4832 private DateTime? _dFecApertura =
null;
4843 return this._dFecCierre;
4847 if (loParent !=
null && !loParent._bIsLoading)
4849 bool llCambio = (this._dFecCierre != value);
4853 if (value !=
null && this._dFecApertura !=
null && this._dFecApertura >= value)
4855 this._oLineasLegalizacion._oLegalizacion._Error_Message_Linea =
"La fecha de cierre (" + Convert.ToDateTime(value).ToShortDateString() +
") debe ser superior a la fecha de apertura (" + Convert.ToDateTime(this._dFecApertura).ToShortDateString() +
").";
4861 this._dFecCierre = value;
4867 private DateTime? _dFecCierre =
null;
4873 [
ReportProperty(
"FecCierreAnt",
"dd/MM/yyyy",
"Fecha cierre libro anterior:")]
4878 return this._dFecCierreAnt;
4882 if (loParent !=
null && !loParent._bIsLoading && value !=
null)
4884 bool llCambio = (this._dFecCierreAnt != value);
4888 if (value !=
null && this._dFecApertura !=
null && value >= this._dFecApertura)
4890 this._oLineasLegalizacion._oLegalizacion._Error_Message_Linea =
"La fecha de cierre anterior (" + Convert.ToDateTime(value).ToShortDateString() +
") debe ser inferior a la fecha de apertura (" + Convert.ToDateTime(this._dFecApertura).ToShortDateString() +
").";
4896 this._dFecCierreAnt = value;
4902 private DateTime? _dFecCierreAnt =
null;
4919 private string _cFirma =
"";
4927 get {
return loParent; }
4933 #endregion PROPIEDADES PUBLICAS
4947 #endregion CONSTRUCTOR
4950 #region MÉTODOS PÚBLICOS.
4967 #endregion MÉTODOS PÚBLICOS.
4972 #endregion CLASE DE LINEAS DE LIBROS PRESENTADOS EN LA LEGALIZACION