primer commit de toda la solucion y proyecto Factura Negociable
This commit is contained in:
commit
bbc9fedba6
27 files changed
+5092
No files matched your search
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="DocumentFormat.OpenXml" publicKeyToken="8fb06cb64d019a17" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.2.0" newVersion="3.0.2.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="DocumentFormat.OpenXml" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.5.5631.0" newVersion="2.5.5631.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,190 @@
|
||||
namespace FacturaNegociable
|
||||
{
|
||||
#region 'Menu SAP'
|
||||
public static class SAPMenu
|
||||
{
|
||||
public const string New = "1282";
|
||||
public const string Find = "1281";
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 'Archivos de Formularios'
|
||||
public static class Archivos
|
||||
{
|
||||
|
||||
public const string ArchivoFormularioFacturaNegociable = "formularioFacturaNegociable.srf";
|
||||
public const string ArchivoFormularioWebBrowser = "formularioWebBrowser.srf";
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 'Menu Usuario'
|
||||
public static class MenuUsuario
|
||||
{
|
||||
public const string MenuPrincipal = "mnuFRN00";
|
||||
public const string MenuFacturaNegociable = "mnuFRN01";
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 'Tipos Formulario de Usuario'
|
||||
public static class UserFormType
|
||||
{
|
||||
public const string FormularioFacturaNegociable = "fn001";
|
||||
public const string FormularioWebBrowser = "wb365";
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 'Codigos de Documento Electronico'
|
||||
public static class CodigosDocumentoElectronico
|
||||
{
|
||||
public const string FacturaElectronica = "33";
|
||||
public const string FacturaNoAfectaElectronica = "34";
|
||||
public const string BoletaElectronica = "39";
|
||||
public const string BoletaNoAfectaElectronica = "41";
|
||||
public const string LiquidacionFacturaElectronica = "43";
|
||||
public const string FacturaDeCompraElectronica = "46";
|
||||
public const string GuiaDespachoElectronica = "52";
|
||||
public const string NotaDebitoElectronica = "56";
|
||||
public const string NotaCreditoElectronica = "61";
|
||||
public const string FacturaExportacionElectronica = "110";
|
||||
public const string NotaDebitoExportacionElectronica = "111";
|
||||
public const string NotaCreditoExportacionElectronica = "112";
|
||||
|
||||
public static string[] All = { FacturaElectronica, FacturaNoAfectaElectronica, BoletaElectronica, BoletaNoAfectaElectronica,
|
||||
LiquidacionFacturaElectronica, FacturaDeCompraElectronica, GuiaDespachoElectronica, NotaDebitoElectronica,
|
||||
NotaCreditoElectronica, FacturaExportacionElectronica, NotaDebitoExportacionElectronica,
|
||||
NotaCreditoExportacionElectronica };
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 'Formularios SAP'
|
||||
public static class SAPFormType
|
||||
{
|
||||
public const string OfertaVentas = "149";
|
||||
public const string PedidoCliente = "139";
|
||||
public const string Entrega = "140";
|
||||
public const string Devolucion = "180";
|
||||
public const string SolicitudAnticipoCliente = "65308";
|
||||
public const string FacturaAnticipoCliente = "65300";
|
||||
public const string FacturaDeudores = "133";
|
||||
public const string FacturaExentaDeudores = "65302";
|
||||
public const string NotaDebitoCliente = "65303";
|
||||
public const string Boleta = "65304";
|
||||
public const string BoletaExenta = "65305";
|
||||
public const string FacturaExportacion = "65307";
|
||||
public const string NotaCreditoCliente = "179";
|
||||
public const string FacturaReservaCliente = "60091";
|
||||
public const string FacturaDeudorPago = "60090";
|
||||
|
||||
public const string SolicitudCompra = "1470000200";
|
||||
public const string OfertaCompra = "540000988";
|
||||
public const string Pedido = "142";
|
||||
public const string EntradaMercancias = "143";
|
||||
public const string DevolucionMercancias = "182";
|
||||
public const string SolicitudAnticipoProveedor = "65309";
|
||||
public const string FacturaAnticipoProveedor = "65301";
|
||||
public const string FacturaProveedor = "141";
|
||||
public const string NotaDebitoProveedor = "65306";
|
||||
public const string NotaCreditoProveedor = "181";
|
||||
public const string FacturaReservaProveedor = "60092";
|
||||
|
||||
public const string EntradaMercanciasInventario = "721";
|
||||
public const string SalidaMercanciasInventario = "720";
|
||||
public const string SolicitudTraslado = "1250000940";
|
||||
public const string TransferenciaStock = "940";
|
||||
|
||||
public static string[] All = { OfertaVentas, PedidoCliente, Entrega, Devolucion, SolicitudAnticipoCliente, FacturaAnticipoCliente, FacturaDeudores, NotaDebitoCliente, Boleta,
|
||||
FacturaExportacion, NotaCreditoCliente, FacturaReservaCliente,
|
||||
SolicitudCompra, OfertaCompra, Pedido, EntradaMercancias, DevolucionMercancias, SolicitudAnticipoProveedor, FacturaAnticipoProveedor, FacturaProveedor,
|
||||
NotaDebitoProveedor, NotaCreditoProveedor,FacturaReservaProveedor,
|
||||
EntradaMercanciasInventario, SalidaMercanciasInventario, SolicitudTraslado, TransferenciaStock};
|
||||
|
||||
public static string[] WithFolio = {Entrega, FacturaAnticipoCliente, FacturaDeudores, NotaDebitoCliente, Boleta, BoletaExenta, FacturaExportacion, NotaCreditoCliente,
|
||||
FacturaReservaCliente, FacturaDeudorPago, FacturaExentaDeudores,
|
||||
SalidaMercanciasInventario, TransferenciaStock,
|
||||
DevolucionMercancias, FacturaProveedor};
|
||||
|
||||
public static string[] VentasFolio = {Entrega, FacturaAnticipoCliente, FacturaDeudores, NotaDebitoCliente, Boleta, BoletaExenta, FacturaExportacion, NotaCreditoCliente,
|
||||
FacturaReservaCliente, FacturaDeudorPago, FacturaExentaDeudores};
|
||||
|
||||
public static string[] InventarioFolio = { SalidaMercanciasInventario, TransferenciaStock };
|
||||
|
||||
public static string[] ComprasFolio = { DevolucionMercancias, FacturaProveedor };
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 'Colores'
|
||||
public static class Colores
|
||||
{
|
||||
public static int White = (System.Drawing.Color.White.R) | (System.Drawing.Color.White.G << 8) | (System.Drawing.Color.White.B << 16);
|
||||
public static int Black = (System.Drawing.Color.Black.R) | (System.Drawing.Color.Black.G << 8) | (System.Drawing.Color.Black.B << 16);
|
||||
public static int Blue = (System.Drawing.Color.Blue.R) | (System.Drawing.Color.Blue.G << 8) | (System.Drawing.Color.Blue.B << 16);
|
||||
public static int Yellow = (System.Drawing.Color.Yellow.R) | (System.Drawing.Color.Yellow.G << 8) | (System.Drawing.Color.Yellow.B << 16);
|
||||
public static int Red = (System.Drawing.Color.Red.R) | (System.Drawing.Color.Red.G << 8) | (System.Drawing.Color.Red.B << 16);
|
||||
public static int Green = (System.Drawing.Color.Green.R) | (System.Drawing.Color.Green.G << 8) | (System.Drawing.Color.Green.B << 16);
|
||||
public static int Orange = (System.Drawing.Color.Orange.R) | (System.Drawing.Color.Orange.G << 8) | (System.Drawing.Color.Orange.B << 16);
|
||||
public static int LightGray = (System.Drawing.Color.LightGray.R) | (System.Drawing.Color.LightGray.G << 8) | (System.Drawing.Color.LightGray.B << 16);
|
||||
public static int GreenYellow = (System.Drawing.Color.GreenYellow.R) | (System.Drawing.Color.GreenYellow.G << 8) | (System.Drawing.Color.GreenYellow.B << 16);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Recursos
|
||||
public static class B1Resources
|
||||
{
|
||||
public static string MENU1288 = "1288_MENU";
|
||||
public static string MENU1291 = "1291_MENU";
|
||||
public static string MENU1304 = "1304_MENU";
|
||||
public static string MENU1289 = "1289_MENU";
|
||||
|
||||
public static string SBERROR = "SB_ERROR";
|
||||
public static string SBSUCCESS = "SB_SUCCESS";
|
||||
public static string SBWARNING = "SB_WARNING";
|
||||
|
||||
public static string RIGHTBLACKTRIANGLE = "RIGHT_TRIANGLE";
|
||||
|
||||
public static string LUPA = "7427_MENU";
|
||||
|
||||
public static string DISKETE = "516_MENU";
|
||||
public static string IMPRESORA = "520_MENU";
|
||||
public static string BLOQUEAR_PANTALLA = "524_MENU";
|
||||
public static string PARAMETRIZACION_FORMULARIO = "580_MENU";
|
||||
|
||||
public static string EXCEL = "7169_MENU";
|
||||
public static string WORD = "7170_MENU";
|
||||
public static string PDF = "7176_MENU";
|
||||
|
||||
public static string BARCODE = "6163_MENU";
|
||||
|
||||
public static string LICENSELOCK = "BUTTON_LICENSE_LOCK";
|
||||
public static string LICENSEUNLOCK = "BUTTON_LICENSE_UNLOCK";
|
||||
|
||||
public static string ADDSTEPICON = "ADD_STEP_ICON";
|
||||
public static string ADDTENPLATEICON = "ADD_TEMPLATE_ICON";
|
||||
|
||||
public static string NOVACLOSE = "BUTTON_NOVA_CLOSE";
|
||||
public static string NOVAMAXIMIZE = "BUTTON_NOVA_MAXIMIZE";
|
||||
|
||||
public static string EMPTYTASK = "MEMPTYTASK";
|
||||
public static string FULLDOC = "MFULLDOC";
|
||||
public static string FULLSTACK = "MFULLTASK";
|
||||
public static string LOCKT = "MLOCKT";
|
||||
|
||||
public static string MVMARK = "MVMARK";
|
||||
public static string MXMARK = "MXMARK";
|
||||
|
||||
public static string NUMERO_1 = "I20116";
|
||||
public static string NUMERO_2 = "I20117";
|
||||
public static string NUMERO_3 = "I20118";
|
||||
public static string NUMERO_4 = "I20119";
|
||||
|
||||
public static string MENSAJE = "6657_MENU";
|
||||
public static string FLECHA_DERECHA = "6164_MENU";
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using SAPbouiCOM;
|
||||
|
||||
namespace FacturaNegociable.DataModel
|
||||
{
|
||||
public class Columna
|
||||
{
|
||||
public int Posicion
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string Nombre
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public BoFieldsType Tipo { get; set; } = BoFieldsType.ft_AlphaNumeric;
|
||||
public int Largo { get; set; } = 10;
|
||||
public bool RightJustified { get; set; } = false;
|
||||
public bool Editable { get; set; } = false;
|
||||
public BoColumnSumType SumType { get; set; } = BoColumnSumType.bst_None;
|
||||
public bool Sortable { get; set; } = false;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
|
||||
namespace FacturaNegociable.DataModel
|
||||
{
|
||||
[XmlRoot(ElementName = "DataTable")]
|
||||
public class DataTable
|
||||
{
|
||||
|
||||
[XmlElement(ElementName = "Rows")]
|
||||
public Rows Rows
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[XmlAttribute(AttributeName = "Uid")]
|
||||
public string Uid
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[XmlText]
|
||||
public string Text
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlRoot(ElementName = "Row")]
|
||||
public class Row
|
||||
{
|
||||
|
||||
[XmlElement(ElementName = "Cells")]
|
||||
public Cells Cells
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlRoot(ElementName = "Rows")]
|
||||
public class Rows
|
||||
{
|
||||
|
||||
[XmlElement(ElementName = "Row")]
|
||||
public List<Row> Row
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlRoot(ElementName = "Cell")]
|
||||
public class Cell
|
||||
{
|
||||
|
||||
[XmlElement(ElementName = "ColumnUid")]
|
||||
public string ColumnUid
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[XmlElement(ElementName = "Value")]
|
||||
public string Value
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlRoot(ElementName = "Cells")]
|
||||
public class Cells
|
||||
{
|
||||
|
||||
[XmlElement(ElementName = "Cell")]
|
||||
public List<Cell> Cell
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace FacturaNegociable.DataModel
|
||||
{
|
||||
public class Factura
|
||||
{
|
||||
public string Seleccionado { get; set; } = string.Empty;
|
||||
public string DocNum { get; set; } = string.Empty;
|
||||
public string BoeKey { get; set; } = string.Empty;
|
||||
public string DocEntry { get; set; } = string.Empty;
|
||||
public DateTime FechaContabilizacion
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public DateTime FechaVencimiento
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string Moneda { get; set; } = string.Empty;
|
||||
public double Total
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public double PaidSum
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public double PaidToDate
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public double Saldo
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string GroupNum { get; set; } = string.Empty;
|
||||
public string CardCode { get; set; } = string.Empty;
|
||||
public string Cliente { get; set; } = string.Empty;
|
||||
public string LicTradNum { get; set; } = string.Empty;
|
||||
public string Indicator { get; set; } = string.Empty;
|
||||
public string Serie { get; set; } = string.Empty;
|
||||
public string Numero { get; set; } = string.Empty;
|
||||
public int Cargo { get; set; } = 0;
|
||||
public string Xml { get; set; } = string.Empty;
|
||||
public string Banco { get; set; } = string.Empty;
|
||||
public string Cuota { get; set; } = string.Empty;
|
||||
public string Cuotas { get; set; } = string.Empty;
|
||||
public string BankCode { get; set; } = string.Empty;
|
||||
public double Amount
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public DateTime FechaNegociada
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string Correo
|
||||
{
|
||||
get; set;
|
||||
} = string.Empty;
|
||||
public string Direccion
|
||||
{
|
||||
get; set;
|
||||
} = string.Empty;
|
||||
public string Ubigeo { get; set; } = string.Empty;
|
||||
public int MesaPartes { get; set; } = 0;
|
||||
public string FechaMesaPartes { get; set; } = string.Empty;
|
||||
|
||||
public string Planilla { get; set; } = string.Empty;
|
||||
|
||||
public string TipoCobranza { get; set; } = string.Empty;
|
||||
public string TipoVenta { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FacturaNegociable.DataModel
|
||||
{
|
||||
public class FacturaNegociableBBVA
|
||||
{
|
||||
public string TipoComprobante { get; set; } = string.Empty;
|
||||
public string RucProveedor { get; set; } = string.Empty;
|
||||
public string Serie { get; set; } = string.Empty;
|
||||
public string Numeracion { get; set; } = string.Empty;
|
||||
public string FechaVencimiento { get; set; } = string.Empty;
|
||||
public string DepartamentoProveedor { get; set; } = string.Empty;
|
||||
public string ProvinciaProveedor { get; set; } = string.Empty;
|
||||
public string DistritoProveedor { get; set; } = string.Empty;
|
||||
public string DomicilioProveedor { get; set; } = string.Empty;
|
||||
public string DepartamentoAdquiriente { get; set; } = string.Empty;
|
||||
public string ProvinciaAdquiriente { get; set; } = string.Empty;
|
||||
public string DistritoAdquiriente { get; set; } = string.Empty;
|
||||
public string DomicilioAdquiriente { get; set; } = string.Empty;
|
||||
public string TipoPago { get; set; } = string.Empty;
|
||||
public string NumeroCuota { get; set; } = string.Empty;
|
||||
public string FechaComunicacionAdquiriente { get; set; } = string.Empty;
|
||||
public string FechaAceptacion { get; set; } = string.Empty;
|
||||
public string FechaPago { get; set; } = string.Empty;
|
||||
public double ImporteNetoPendientePago { get; set; } = 0.00;
|
||||
public string ClausulasEspeciales { get; set; } = string.Empty;
|
||||
public string Observaciones { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
namespace FacturaNegociable.DataModel
|
||||
{
|
||||
public class FacturaNegociableBCP
|
||||
{
|
||||
public string TipoProducto { get; set; } = string.Empty;
|
||||
public string Moneda { get; set; } = string.Empty;
|
||||
public string NumeroCuentaCorriente { get; set; } = string.Empty;
|
||||
//public double ImporteTotalPlanilla { get; set; } = 0.00;
|
||||
public string TipoComprobante { get; set; } = string.Empty;
|
||||
public string RucProveedor { get; set; } = string.Empty;
|
||||
public string Serie { get; set; } = string.Empty;
|
||||
public string Numeracion { get; set; } = string.Empty;
|
||||
public string FechaVencimiento { get; set; } = string.Empty;
|
||||
public string DepartamentoProveedor { get; set; } = string.Empty;
|
||||
public string ProvinciaProveedor { get; set; } = string.Empty;
|
||||
public string DistritoProveedor { get; set; } = string.Empty;
|
||||
public string DomicilioProveedor { get; set; } = string.Empty;
|
||||
public string DepartamentoAdquiriente { get; set; } = string.Empty;
|
||||
public string ProvinciaAdquiriente { get; set; } = string.Empty;
|
||||
public string DistritoAdquiriente { get; set; } = string.Empty;
|
||||
public string DomicilioAdquiriente { get; set; } = string.Empty;
|
||||
public string TipoPago { get; set; } = string.Empty;
|
||||
public string NumeroCuota { get; set; } = string.Empty;
|
||||
public string FechaComunicacionAdquiriente { get; set; } = string.Empty;
|
||||
public string FechaAceptacion { get; set; } = string.Empty;
|
||||
public string FechaPago { get; set; } = string.Empty;
|
||||
public double ImporteNetoPendientePago { get; set; } = 0.00;
|
||||
public int ClausulaProrroga { get; set; } = 0;
|
||||
public string ClausulasEspeciales { get; set; } = string.Empty;
|
||||
public string Observaciones { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Globalization;
|
||||
|
||||
namespace FacturaNegociable.DataModel
|
||||
{
|
||||
public class State
|
||||
{
|
||||
public CultureInfo Result {
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{84776F11-D2B7-4D6E-9A21-D8AF0E7BF0D9}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>FacturaNegociable</RootNamespace>
|
||||
<AssemblyName>FacturaNegociable</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DocumentFormat.OpenXml.2.5\lib\DocumentFormat.OpenXml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DocumentFormat.OpenXml.Framework, Version=3.0.2.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DocumentFormat.OpenXml.Framework.3.0.2\lib\net46\DocumentFormat.OpenXml.Framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SAPBusinessOneSDK, Version=1.1.0.1, Culture=neutral, PublicKeyToken=c7c3cb60e45d119f, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\Program Files\sap\SAP Business One\SAPBusinessOneSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SpreadsheetLight, Version=3.4.7.0, Culture=neutral, PublicKeyToken=32fbb46dc1730c57, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SpreadsheetLight.3.4.7\lib\SpreadsheetLight.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Drawing.Common.8.0.4\lib\net462\System.Drawing.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Packaging, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Packaging.4.7.0\lib\net46\System.IO.Packaging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Constantes.cs" />
|
||||
<Compile Include="DataModel\Columna.cs" />
|
||||
<Compile Include="DataModel\DataTable.cs" />
|
||||
<Compile Include="DataModel\Factura.cs" />
|
||||
<Compile Include="DataModel\FacturaNegociableBBVA.cs" />
|
||||
<Compile Include="DataModel\FacturaNegociableBCP.cs" />
|
||||
<Compile Include="DataModel\State.cs" />
|
||||
<Compile Include="FolderBrowserDialogWrapper.cs" />
|
||||
<Compile Include="FormularioFacturaNegociable.cs" />
|
||||
<Compile Include="FormularioWebBrowser.cs" />
|
||||
<Compile Include="Funciones.cs" />
|
||||
<Compile Include="Menu.cs" />
|
||||
<Compile Include="OpenFileDialogWrapper.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="WindowWrapper.cs" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,210 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using ThreadState = System.Threading.ThreadState;
|
||||
|
||||
namespace FacturaNegociable
|
||||
{
|
||||
public static class FolderBrowserDialogWrapper
|
||||
{
|
||||
#region Private members
|
||||
|
||||
private const string SapProcessName = "SAP Business One";
|
||||
|
||||
private static string folderName;
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Determina el número de instancias actuales de Business One en la computadora.
|
||||
/// </summary>
|
||||
/// <returns>Número encontrado de instancias</returns>
|
||||
public static int IsBusinessOneRunning()
|
||||
{
|
||||
var returnValue = 0;
|
||||
|
||||
var userName = Environment.UserName;
|
||||
|
||||
folderName = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
var processes = Process.GetProcessesByName(SapProcessName);
|
||||
|
||||
for (var i = 0; i <= processes.Length - 1; i++)
|
||||
{
|
||||
var processUserName = GetProcessUserName(processes[i]);
|
||||
if (processUserName != userName)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
returnValue++;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.sbo_application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Muestra un diálogo estándar FileBrowser para obtener un nombre de archivo del usuario
|
||||
/// </summary>
|
||||
/// <param name="fileFilter">
|
||||
/// The file Filter.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// Nombre de archivo si está seleccionado, más cadena. Vacio
|
||||
/// </returns>
|
||||
public static string SelectPath()
|
||||
{
|
||||
string returnValue = string.Empty;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var showFolderBrowserThread = new Thread(ShowFolderBrowser);
|
||||
if (showFolderBrowserThread.ThreadState == ThreadState.Unstarted)
|
||||
{
|
||||
showFolderBrowserThread.SetApartmentState(ApartmentState.STA);
|
||||
}
|
||||
|
||||
showFolderBrowserThread.Start();
|
||||
showFolderBrowserThread.Join();
|
||||
|
||||
while (showFolderBrowserThread.ThreadState == ThreadState.Running)
|
||||
{
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
if (false == string.IsNullOrEmpty(folderName))
|
||||
{
|
||||
returnValue = folderName;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.sbo_application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
|
||||
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
private static void ShowFolderBrowser()
|
||||
{
|
||||
var userName = Environment.UserName;
|
||||
var folderBrowser = new FolderBrowserDialog();
|
||||
|
||||
folderName = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
Process currentProcess = Process.GetCurrentProcess();
|
||||
|
||||
int parentProcessId = -1;
|
||||
|
||||
Process parentProcess = GetParent(currentProcess);
|
||||
|
||||
if (parentProcess == null)
|
||||
{
|
||||
Program.sbo_application.StatusBar.SetText("No hay proceso padre.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
parentProcessId = parentProcess.Id;
|
||||
|
||||
var myWindow = new WindowWrapper(parentProcess.MainWindowHandle);
|
||||
|
||||
var ret = folderBrowser.ShowDialog(myWindow);
|
||||
|
||||
if (ret == DialogResult.OK)
|
||||
{
|
||||
folderName = folderBrowser.SelectedPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.ExitThread();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Program.sbo_application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
folderBrowser.Dispose();
|
||||
GC.Collect();
|
||||
}
|
||||
}
|
||||
|
||||
public static Process GetParent(this Process process)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var query = new ManagementObjectSearcher(
|
||||
"SELECT * " +
|
||||
"FROM Win32_Process " +
|
||||
"WHERE ProcessId=" + process.Id))
|
||||
{
|
||||
return query
|
||||
.Get()
|
||||
.OfType<ManagementObject>()
|
||||
.Select(p => Process.GetProcessById((int)(uint)p["ParentProcessId"]))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetProcessUserName(Process process)
|
||||
{
|
||||
var returnValue = string.Empty;
|
||||
var query = string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"Select * from Win32_Process Where ProcessID = '{0}'",
|
||||
process.Id);
|
||||
var sq = new ObjectQuery(query);
|
||||
|
||||
using (var searcher = new ManagementObjectSearcher(sq))
|
||||
{
|
||||
ManagementObjectCollection processList = searcher.Get();
|
||||
if (0 == processList.Count)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
foreach (var o in processList)
|
||||
{
|
||||
var managementObject = (ManagementObject)o;
|
||||
var args = new object[2];
|
||||
|
||||
// Invoca el método y rellena el var con el nombre de usuario y el dominio
|
||||
managementObject.InvokeMethod("GetOwner", args);
|
||||
|
||||
if (null != args[0])
|
||||
{
|
||||
returnValue = args[0].ToString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
|
||||
namespace FacturaNegociable
|
||||
{
|
||||
public static class FormularioWebBrowser
|
||||
{
|
||||
#region Formulario
|
||||
public struct Formulario
|
||||
{
|
||||
public struct DataSources
|
||||
{
|
||||
public struct DBDataSources
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public struct UserDataSources
|
||||
{
|
||||
public const string US = "US";
|
||||
}
|
||||
|
||||
public struct DataTables
|
||||
{
|
||||
public const string DataTable = "DT_0";
|
||||
}
|
||||
}
|
||||
|
||||
public struct Items
|
||||
{
|
||||
public struct Item
|
||||
{
|
||||
public const string WebBrowser = "wb";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static void FormLoad(string fullpathfile, string tittle, SAPbobsCOM.Company oCompany, ref SAPbouiCOM.Application oApplication, out bool bBubbleEvent)
|
||||
{
|
||||
bBubbleEvent = true;
|
||||
|
||||
SAPbouiCOM.FormCreationParams oFormCreationPackage;
|
||||
SAPbouiCOM.Form Form;
|
||||
SAPbouiCOM.Item oItem;
|
||||
SAPbouiCOM.WebBrowser oWebBrowser;
|
||||
|
||||
oFormCreationPackage = (SAPbouiCOM.FormCreationParams)oApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams);
|
||||
try
|
||||
{
|
||||
XmlDocument xmlForm = new XmlDocument();
|
||||
|
||||
xmlForm.Load(Archivos.ArchivoFormularioWebBrowser);
|
||||
|
||||
oFormCreationPackage.XmlData = xmlForm.InnerXml;
|
||||
oFormCreationPackage.UniqueID = "UF" + Funciones.Random().ToString();
|
||||
Form = oApplication.Forms.AddEx(oFormCreationPackage);
|
||||
|
||||
if (tittle != string.Empty)
|
||||
Form.Title = tittle;
|
||||
|
||||
oItem = Form.Items.Item(Formulario.Items.Item.WebBrowser);
|
||||
|
||||
oItem.Left = 5;
|
||||
oItem.Top = 5;
|
||||
oItem.Height = Form.ClientHeight - 5;
|
||||
oItem.Width = Form.ClientWidth - 5;
|
||||
|
||||
oWebBrowser = (SAPbouiCOM.WebBrowser)oItem.Specific;
|
||||
|
||||
oWebBrowser.Url = fullpathfile;
|
||||
|
||||
Form.Visible = true;
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
oApplication.StatusBar.SetText(e.ToString(), SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void HandleItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent oItemEvent, SAPbobsCOM.Company oCompany, ref SAPbouiCOM.Application oApplication, out bool bBubbleEvent)
|
||||
{
|
||||
bBubbleEvent = true;
|
||||
switch (oItemEvent.EventType)
|
||||
{
|
||||
case SAPbouiCOM.BoEventTypes.et_FORM_RESIZE:
|
||||
FormResize(FormUID, ref oItemEvent, oCompany, ref oApplication, out bBubbleEvent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void FormResize(string FormUID, ref SAPbouiCOM.ItemEvent oItemEvent, SAPbobsCOM.Company oCompany, ref SAPbouiCOM.Application oApplication, out bool bBubbleEvent)
|
||||
{
|
||||
bBubbleEvent = true;
|
||||
|
||||
SAPbouiCOM.Form Form;
|
||||
SAPbouiCOM.Item Item;
|
||||
Form = oApplication.Forms.Item(FormUID);
|
||||
|
||||
if (!oItemEvent.BeforeAction)
|
||||
{
|
||||
for (int i = 0; i < Form.Items.Count; i++)
|
||||
{
|
||||
if (Form.Items.Item(i).UniqueID == Formulario.Items.Item.WebBrowser)
|
||||
{
|
||||
Item = Form.Items.Item(Formulario.Items.Item.WebBrowser);
|
||||
Item.Left = 5;
|
||||
Item.Top = 5;
|
||||
Item.Height = Form.ClientHeight - 5;
|
||||
Item.Width = Form.ClientWidth - 5;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using SAPbouiCOM;
|
||||
using System;
|
||||
using System.Security;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace FacturaNegociable
|
||||
{
|
||||
public static class Funciones
|
||||
{
|
||||
public static long Random()
|
||||
{
|
||||
long _aleatorio = -1;
|
||||
long _minimo = 1;
|
||||
long _maximo = 1000;
|
||||
Random r = new Random();
|
||||
_aleatorio = (_minimo - _maximo) * r.Next() + _maximo;
|
||||
return _aleatorio;
|
||||
}
|
||||
|
||||
public static void LoadComboQuery(string _query, ref SAPbouiCOM.ComboBox oComboBox, string fieldValue, string fieldDesc, SAPbobsCOM.Company oCompany)
|
||||
{
|
||||
SAPbouiCOM.ValidValues oValidValues;
|
||||
SAPbobsCOM.Recordset oRecordset;
|
||||
|
||||
oRecordset = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
|
||||
oRecordset.DoQuery(_query);
|
||||
|
||||
oValidValues = oComboBox.ValidValues;
|
||||
|
||||
while (oComboBox.ValidValues.Count > 0)
|
||||
{
|
||||
oComboBox.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index);
|
||||
}
|
||||
|
||||
if (string.Equals(fieldDesc, string.Empty))
|
||||
{
|
||||
while (!oRecordset.EoF)
|
||||
{
|
||||
oValidValues.Add(oRecordset.Fields.Item(fieldValue).Value.ToString(), "");
|
||||
oRecordset.MoveNext();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (!oRecordset.EoF)
|
||||
{
|
||||
oValidValues.Add(oRecordset.Fields.Item(fieldValue).Value.ToString(), oRecordset.Fields.Item(fieldDesc).Value.ToString());
|
||||
oRecordset.MoveNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static SAPbouiCOM.DataTable GetDataTableFromCLF(SAPbouiCOM.ItemEvent oEvent, SAPbouiCOM.Form oForm)
|
||||
{
|
||||
SAPbouiCOM.ChooseFromListEvent oChooseFromListEvent;
|
||||
SAPbouiCOM.ChooseFromList oChooseFromList;
|
||||
string ItemUid;
|
||||
|
||||
oChooseFromListEvent = (SAPbouiCOM.ChooseFromListEvent)oEvent;
|
||||
ItemUid = oChooseFromListEvent.ChooseFromListUID;
|
||||
oChooseFromList = oForm.ChooseFromLists.Item(ItemUid);
|
||||
|
||||
return oChooseFromListEvent.SelectedObjects;
|
||||
}
|
||||
|
||||
public static string CleanString(string imputText)
|
||||
{
|
||||
string result = string.Empty;
|
||||
|
||||
//string pattern = @"\b[A-Z]\w*\b";
|
||||
|
||||
result = Regex.Replace(imputText, "[^A-Za-z0-9 _]", "");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static SecureString ConvertToSecureString(string password)
|
||||
{
|
||||
if (password == null)
|
||||
throw new ArgumentNullException("password");
|
||||
|
||||
unsafe
|
||||
{
|
||||
fixed (char* passwordChars = password)
|
||||
{
|
||||
var securePassword = new SecureString(passwordChars, password.Length);
|
||||
securePassword.MakeReadOnly();
|
||||
return securePassword;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using SAPbouiCOM.Framework;
|
||||
using System;
|
||||
using System.Xml;
|
||||
|
||||
namespace FacturaNegociable
|
||||
{
|
||||
public class Menu
|
||||
{
|
||||
public void AddMenuItems()
|
||||
{
|
||||
try
|
||||
{
|
||||
RemoveMenus();
|
||||
|
||||
var menuXml = new XmlDocument();
|
||||
|
||||
menuXml.Load("menu.xml");
|
||||
|
||||
Application.SBO_Application.LoadBatchActions(menuXml.InnerXml);
|
||||
|
||||
|
||||
//SAPbouiCOM.MenuItem menu = Application.SBO_Application.Menus.Item(MenuUsuario.MenuPrincipal);
|
||||
//menu.Image = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "creditcard.bmp");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void RemoveMenus()
|
||||
{
|
||||
SAPbouiCOM.Menus oMenus = Application.SBO_Application.Menus;
|
||||
|
||||
if (oMenus.Exists(MenuUsuario.MenuFacturaNegociable))
|
||||
{
|
||||
oMenus.RemoveEx(MenuUsuario.MenuFacturaNegociable);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SBO_Application_MenuEvent(ref SAPbouiCOM.MenuEvent menuEvent, out bool BubbleEvent)
|
||||
{
|
||||
BubbleEvent = true;
|
||||
|
||||
try
|
||||
{
|
||||
switch (menuEvent.MenuUID)
|
||||
{
|
||||
case MenuUsuario.MenuFacturaNegociable:
|
||||
|
||||
FormularioFacturaNegociable.FormLoad(ref menuEvent, Program.sbo_company, ref Program.sbo_application, out BubbleEvent);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.sbo_application.StatusBar.SetText("MenuEvent " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using ThreadState = System.Threading.ThreadState;
|
||||
|
||||
namespace FacturaNegociable
|
||||
{
|
||||
public static class OpenFileDialogWrapper
|
||||
{
|
||||
#region Private members
|
||||
|
||||
private const string SapProcessName = "SAP Business One";
|
||||
|
||||
private static string fileName;
|
||||
|
||||
private static string filter = "All files(*.*)|*.*";
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Determina el número de instancias actuales de Business One en la computadora.
|
||||
/// </summary>
|
||||
/// <returns>Número encontrado de instancias</returns>
|
||||
public static int IsBusinessOneRunning()
|
||||
{
|
||||
var returnValue = 0;
|
||||
|
||||
var userName = Environment.UserName;
|
||||
|
||||
fileName = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
var processes = Process.GetProcessesByName(SapProcessName);
|
||||
|
||||
for (var i = 0; i <= processes.Length - 1; i++)
|
||||
{
|
||||
var processUserName = GetProcessUserName(processes[i]);
|
||||
if (processUserName != userName)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
returnValue++;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.sbo_application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
|
||||
|
||||
//if (Debugger.IsAttached)
|
||||
//{
|
||||
// Debugger.Break();
|
||||
//}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Muestra un diálogo estándar FileBrowser para obtener un nombre de archivo del usuario
|
||||
/// </summary>
|
||||
/// <param name="fileFilter">
|
||||
/// The file Filter.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// Nombre de archivo si está seleccionado, más cadena. Vacio
|
||||
/// </returns>
|
||||
public static string FindFile(string fileFilter = "")
|
||||
{
|
||||
string returnValue = string.Empty;
|
||||
|
||||
if (!string.IsNullOrEmpty(fileFilter))
|
||||
{
|
||||
filter = fileFilter;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var showFolderBrowserThread = new Thread(ShowFolderBrowser);
|
||||
if (showFolderBrowserThread.ThreadState == ThreadState.Unstarted)
|
||||
{
|
||||
showFolderBrowserThread.SetApartmentState(ApartmentState.STA);
|
||||
}
|
||||
|
||||
showFolderBrowserThread.Start();
|
||||
showFolderBrowserThread.Join();
|
||||
|
||||
while (showFolderBrowserThread.ThreadState == ThreadState.Running)
|
||||
{
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
if (false == string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
returnValue = fileName;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.sbo_application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
|
||||
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
private static void ShowFolderBrowser()
|
||||
{
|
||||
var userName = Environment.UserName;
|
||||
var openFile = new OpenFileDialog();
|
||||
|
||||
fileName = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
openFile.Multiselect = false;
|
||||
openFile.Filter = filter;
|
||||
int filterIndex = 0;
|
||||
|
||||
try
|
||||
{
|
||||
filterIndex = 0;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
openFile.FilterIndex = filterIndex;
|
||||
|
||||
openFile.RestoreDirectory = true;
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
|
||||
Process currentProcess = Process.GetCurrentProcess();
|
||||
|
||||
int parentProcessId = -1;
|
||||
|
||||
Process parentProcess = GetParent(currentProcess);
|
||||
|
||||
if (parentProcess == null)
|
||||
{
|
||||
Program.sbo_application.StatusBar.SetText("No hay proceso padre.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
parentProcessId = parentProcess.Id;
|
||||
|
||||
//var myWindow = new WindowWrapper(Process.GetProcessById(parentProcessId).MainWindowHandle);
|
||||
var myWindow = new WindowWrapper(parentProcess.MainWindowHandle);
|
||||
|
||||
var ret = openFile.ShowDialog(myWindow);
|
||||
|
||||
if (ret == DialogResult.OK)
|
||||
{
|
||||
fileName = openFile.FileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.ExitThread();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
|
||||
//Process[] runningProcesses = Process.GetProcesses();
|
||||
|
||||
//int currentSessionID = Process.GetCurrentProcess().SessionId;
|
||||
|
||||
//Program.archivoLog.EscribirLog($"Process.GetCurrentProcess().SessionId = {currentSessionID}");
|
||||
|
||||
//Process[] sameAsThisSession = runningProcesses.Where(p => p.SessionId == currentSessionID).ToArray();
|
||||
|
||||
//Program.archivoLog.EscribirLog($"sameAsThisSession Length = {sameAsThisSession.Length}");
|
||||
|
||||
//foreach (Process p in sameAsThisSession)
|
||||
//{
|
||||
// Program.archivoLog.EscribirLog($"ProcessName = {p.ProcessName} | Id = {p.Id} | SessionId = {p.SessionId} | ProcessUserName = {GetProcessUserName(p)}");
|
||||
|
||||
//}
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Program.sbo_application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
openFile.Dispose();
|
||||
GC.Collect();
|
||||
}
|
||||
}
|
||||
|
||||
public static Process GetParent(this Process process)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var query = new ManagementObjectSearcher(
|
||||
"SELECT * " +
|
||||
"FROM Win32_Process " +
|
||||
"WHERE ProcessId=" + process.Id))
|
||||
{
|
||||
return query
|
||||
.Get()
|
||||
.OfType<ManagementObject>()
|
||||
.Select(p => Process.GetProcessById((int)(uint)p["ParentProcessId"]))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetProcessUserName(Process process)
|
||||
{
|
||||
var returnValue = string.Empty;
|
||||
var query = string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"Select * from Win32_Process Where ProcessID = '{0}'",
|
||||
process.Id);
|
||||
var sq = new ObjectQuery(query);
|
||||
|
||||
using (var searcher = new ManagementObjectSearcher(sq))
|
||||
{
|
||||
ManagementObjectCollection processList = searcher.Get();
|
||||
if (0 == processList.Count)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
foreach (var o in processList)
|
||||
{
|
||||
var managementObject = (ManagementObject)o;
|
||||
var args = new object[2];
|
||||
|
||||
// Invoca el método y rellena el var con el nombre de usuario y el dominio
|
||||
managementObject.InvokeMethod("GetOwner", args);
|
||||
|
||||
if (null != args[0])
|
||||
{
|
||||
returnValue = args[0].ToString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
using System;
|
||||
using SAPbouiCOM;
|
||||
|
||||
namespace FacturaNegociable
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
#region VariablesGlobales
|
||||
public static System.Globalization.NumberFormatInfo oNumberFormatInfo = new System.Globalization.NumberFormatInfo();
|
||||
public static string RightClickColumn = null;
|
||||
public static int RightClickRow = -1;
|
||||
public static string RightClickItemUID = null;
|
||||
public static bool ModalFormIsOpen = false;
|
||||
|
||||
public static SAPbobsCOM.Company sbo_company;
|
||||
public static SAPbouiCOM.Application sbo_application;
|
||||
|
||||
public static SAPbouiCOM.ProgressBar sbo_progressbar = null;
|
||||
|
||||
//public static FileLogger archivoLog = new FileLogger();
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Punto de entrada principal para la aplicación.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
SAPbouiCOM.Framework.Application oApp = null;
|
||||
if (args.Length < 1)
|
||||
{
|
||||
oApp = new SAPbouiCOM.Framework.Application();
|
||||
}
|
||||
else
|
||||
{
|
||||
oApp = new SAPbouiCOM.Framework.Application(args[0]);
|
||||
}
|
||||
|
||||
sbo_application = SAPbouiCOM.Framework.Application.SBO_Application;
|
||||
|
||||
sbo_company = (SAPbobsCOM.Company)sbo_application.Company.GetDICompany();
|
||||
|
||||
|
||||
Program.oNumberFormatInfo.NumberDecimalSeparator = sbo_company.GetCompanyService().GetAdminInfo().DecimalSeparator;
|
||||
Program.oNumberFormatInfo.NumberGroupSeparator = sbo_company.GetCompanyService().GetAdminInfo().ThousandsSeparator;
|
||||
|
||||
Menu MyMenu = new Menu();
|
||||
MyMenu.AddMenuItems();
|
||||
oApp.RegisterMenuEventHandler(MyMenu.SBO_Application_MenuEvent);
|
||||
|
||||
SAPbouiCOM.Framework.Application.SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent);
|
||||
|
||||
SAPbouiCOM.Framework.Application.SBO_Application.ItemEvent += new SAPbouiCOM._IApplicationEvents_ItemEventEventHandler(SBO_Application_ItemEvent);
|
||||
|
||||
SAPbouiCOM.Framework.Application.SBO_Application.FormDataEvent += new SAPbouiCOM._IApplicationEvents_FormDataEventEventHandler(SBO_Application_FormDataEvent);
|
||||
|
||||
SAPbouiCOM.Framework.Application.SBO_Application.ReportDataEvent += new SAPbouiCOM._IApplicationEvents_ReportDataEventEventHandler(SBO_Application_ReportDataEvent);
|
||||
|
||||
SAPbouiCOM.Framework.Application.SBO_Application.PrintEvent += new SAPbouiCOM._IApplicationEvents_PrintEventEventHandler(SBO_Application_PrintEvent);
|
||||
|
||||
SAPbouiCOM.Framework.Application.SBO_Application.RightClickEvent += new SAPbouiCOM._IApplicationEvents_RightClickEventEventHandler(SBO_Application_RightClickEvent);
|
||||
|
||||
SAPbouiCOM.Framework.Application.SBO_Application.ProgressBarEvent += new SAPbouiCOM._IApplicationEvents_ProgressBarEventEventHandler(SBO_Application_ProgressBarEvent);
|
||||
|
||||
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
|
||||
System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
|
||||
|
||||
SAPbouiCOM.Framework.Application.SBO_Application.StatusBar.SetText($"addon factura negociable {fvi.FileVersion} iniciado con éxito.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success);
|
||||
|
||||
oApp.Run();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static void SBO_Application_ProgressBarEvent(ref ProgressBarEvent pVal, out bool BubbleEvent)
|
||||
{
|
||||
BubbleEvent = true;
|
||||
|
||||
if (pVal.EventType == BoProgressBarEventTypes.pbet_ProgressBarStopped && pVal.BeforeAction)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static void SBO_Application_AppEvent(SAPbouiCOM.BoAppEventTypes eventType)
|
||||
{
|
||||
switch (eventType)
|
||||
{
|
||||
case SAPbouiCOM.BoAppEventTypes.aet_ShutDown:
|
||||
//Exit Add-On
|
||||
System.Windows.Forms.Application.Exit();
|
||||
break;
|
||||
case SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged:
|
||||
System.Windows.Forms.Application.Exit();
|
||||
break;
|
||||
case SAPbouiCOM.BoAppEventTypes.aet_FontChanged:
|
||||
break;
|
||||
case SAPbouiCOM.BoAppEventTypes.aet_LanguageChanged:
|
||||
System.Windows.Forms.Application.Exit();
|
||||
break;
|
||||
case SAPbouiCOM.BoAppEventTypes.aet_ServerTerminition:
|
||||
System.Windows.Forms.Application.Exit();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent itemEvent, out bool BubbleEvent)
|
||||
{
|
||||
|
||||
BubbleEvent = true;
|
||||
|
||||
try
|
||||
{
|
||||
switch (itemEvent.FormTypeEx)
|
||||
{
|
||||
|
||||
case UserFormType.FormularioFacturaNegociable:
|
||||
|
||||
FormularioFacturaNegociable.HandleItemEvent(FormUID, ref itemEvent, Program.sbo_company, ref Program.sbo_application, out BubbleEvent);
|
||||
|
||||
break;
|
||||
case UserFormType.FormularioWebBrowser:
|
||||
|
||||
FormularioWebBrowser.HandleItemEvent(FormUID, ref itemEvent, Program.sbo_company, ref Program.sbo_application, out BubbleEvent);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
sbo_application.StatusBar.SetText("ItemEvent " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void SBO_Application_FormDataEvent(ref SAPbouiCOM.BusinessObjectInfo businessObjectInfo, out bool BubbleEvent)
|
||||
{
|
||||
BubbleEvent = true;
|
||||
try
|
||||
{
|
||||
switch (businessObjectInfo.FormTypeEx)
|
||||
{
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
sbo_application.StatusBar.SetText("FormDataEvent " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void SBO_Application_ReportDataEvent(ref SAPbouiCOM.ReportDataInfo reportDataInfo, out bool BubbleEvent)
|
||||
{
|
||||
BubbleEvent = true;
|
||||
|
||||
}
|
||||
|
||||
private static void SBO_Application_PrintEvent(ref SAPbouiCOM.PrintEventInfo printeventInfo, out bool BubbleEvent)
|
||||
{
|
||||
BubbleEvent = true;
|
||||
}
|
||||
|
||||
private static void SBO_Application_RightClickEvent(ref SAPbouiCOM.ContextMenuInfo eventInfo, out bool BubbleEvent)
|
||||
{
|
||||
BubbleEvent = true;
|
||||
|
||||
//SAPbouiCOM.Form form;
|
||||
|
||||
//form = Program.sbo_application.Forms.Item(eventInfo.FormUID);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Program.sbo_application.MessageBox(ex.Message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// La información general de un ensamblado se controla mediante el siguiente
|
||||
// conjunto de atributos. Cambie estos valores de atributo para modificar la información
|
||||
// asociada con un ensamblado.
|
||||
[assembly: AssemblyTitle("FacturaNegociable 3_3_0_0")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("FacturaNegociable")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Si establece ComVisible en false, los tipos de este ensamblado no estarán visibles
|
||||
// para los componentes COM. Si es necesario obtener acceso a un tipo en este ensamblado desde
|
||||
// COM, establezca el atributo ComVisible en true en este tipo.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// El siguiente GUID sirve como id. de typelib si este proyecto se expone a COM.
|
||||
[assembly: Guid("84776f11-d2b7-4d6e-9a21-d8af0e7bf0d9")]
|
||||
|
||||
// La información de versión de un ensamblado consta de los cuatro valores siguientes:
|
||||
//
|
||||
// Versión principal
|
||||
// Versión secundaria
|
||||
// Número de compilación
|
||||
// Revisión
|
||||
//
|
||||
// Puede especificar todos los valores o usar los valores predeterminados de número de compilación y de revisión
|
||||
// utilizando el carácter "*", como se muestra a continuación:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("3.3.0.0")]
|
||||
[assembly: AssemblyFileVersion("3.3.0.0")]
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FacturaNegociable.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FacturaNegociable.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FacturaNegociable.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.12.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace FacturaNegociable
|
||||
{
|
||||
public class WindowWrapper : IWin32Window
|
||||
{
|
||||
private readonly IntPtr hwnd;
|
||||
|
||||
/// <sumary>
|
||||
/// Inicializa una nueva instancia de la clase WindowWrapper.
|
||||
/// </sumary>
|
||||
public WindowWrapper(IntPtr handle)
|
||||
{
|
||||
this.hwnd = handle;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Obtiene el control de la ventana administrada por la clase.
|
||||
/// </summary>
|
||||
public IntPtr Handle => this.hwnd;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="DocumentFormat.OpenXml" version="2.5" targetFramework="net472" />
|
||||
<package id="DocumentFormat.OpenXml.Framework" version="3.0.2" targetFramework="net472" />
|
||||
<package id="SpreadsheetLight" version="3.4.7" targetFramework="net472" />
|
||||
<package id="System.Drawing.Common" version="8.0.4" targetFramework="net472" />
|
||||
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.IO.Packaging" version="4.7.0" targetFramework="net472" />
|
||||
</packages>
|
||||
Reference in new issue
Block a user