20260129 - 01
This commit is contained in:
384
GestionGrupoSanchoToro/Almacen/ucAlbaran.xaml
Normal file
384
GestionGrupoSanchoToro/Almacen/ucAlbaran.xaml
Normal file
@@ -0,0 +1,384 @@
|
|||||||
|
<tsWPFCore:tsUserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
|
||||||
|
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
|
||||||
|
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||||
|
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||||
|
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||||
|
xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" xmlns:Serialization="clr-namespace:DevExpress.Xpf.LayoutControl.Serialization;assembly=DevExpress.Xpf.LayoutControl.v23.2" x:Class="ucAlbaran"
|
||||||
|
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="1366">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
<Style x:Key="RejillaAnidadaStyle" TargetType="{x:Type dxg:RowControl}">
|
||||||
|
<Setter Property="Background" Value="#B0E0E6" />
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</UserControl.Resources>
|
||||||
|
<Grid x:Name="contenido" HorizontalAlignment="Stretch" Width="Auto">
|
||||||
|
<dxlc:LayoutControl x:Name="LayoutControl1" Orientation="Vertical">
|
||||||
|
<dxlc:LayoutGroup Header="Datos Del Albarán" View="GroupBox" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch">
|
||||||
|
<dxlc:LayoutGroup Width="1310">
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical" Width="250" HorizontalAlignment="Left">
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Nº Albarán:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS UsualCorreccion="False" Modificable="NoModificable" />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding NumeroAlbaran, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="100" NullText="« AUTOMÁTICO »" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Nº Contrato:">
|
||||||
|
<dxe:ButtonEdit x:Name="beContrato" EditValue="{Binding NumeroContrato, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="12" DefaultButtonClick="beContrato_DefaultButtonClick">
|
||||||
|
<dxe:ButtonInfo GlyphKind="Search" x:Name="btIrAContrato" Click="btIrAContrato_Click" />
|
||||||
|
<dxe:ButtonInfo GlyphKind="Cancel" x:Name="btQuitarContrato" Click="btQuitarContrato_Click" />
|
||||||
|
</dxe:ButtonEdit>
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Nº Bultos:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS UsualCorreccion="False" />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding NumeroBultos, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="102" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical" Width="500">
|
||||||
|
<dxlc:LayoutGroup>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Fecha Albarán:" Width="230">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:DateEdit EditValue="{Binding Fecha, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="101" Mask="G" MaskUseAsDisplayFormat="True" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Tipo:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:ComboBoxEdit x:Name="cbTipo" AutoComplete="True" DisplayMember="Descripcion" ValueMember="Valor" EditValue="{Binding Tipo, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="4" AllowNullInput="True" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Cliente/Proveedor:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:ComboBoxEdit x:Name="cbRazonSocial" AutoComplete="True" ValidateOnTextInput="False" IsTextEditable="True" DisplayMember="RazonSocial" ValueMember="idEntidad" EditValue="{Binding idEntidad, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" AllowDefaultButton="False" TabIndex="1">
|
||||||
|
<dxe:ComboBoxEdit.Buttons>
|
||||||
|
<dxe:ButtonInfo x:Name="biBuscarCliente" GlyphKind="Search" IsDefaultButton="False" Click="BiBuscarCliente_Click" />
|
||||||
|
</dxe:ComboBoxEdit.Buttons>
|
||||||
|
</dxe:ComboBoxEdit>
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Almacén Origen:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:ComboBoxEdit x:Name="cbAlmacenOrigen" AutoComplete="True" DisplayMember="Descripcion" ValueMember="idAlmacen" EditValue="{Binding idAlmacenOrigen, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="4" AllowNullInput="True" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical">
|
||||||
|
<dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup ItemLabelsAlignment="Local">
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical">
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Nº Vale Transporte:" Width="250" HorizontalAlignment="Left">
|
||||||
|
<Border BorderThickness="1" BorderBrush="Black" Height="22">
|
||||||
|
<TextBlock><Hyperlink x:Name="hlVale" Click="hlVale_Click" Tag="{Binding idValeTransporte}"><InlineUIContainer>
|
||||||
|
<TextBlock Text="{Binding idValeTransporte, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
|
||||||
|
</InlineUIContainer></Hyperlink></TextBlock>
|
||||||
|
</Border>
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Usuario:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS UsualCorreccion="False" Modificable="NoModificable" />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding Usuario, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="100" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Almacén Destino:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:ComboBoxEdit x:Name="cbAlmacenDestino" AutoComplete="True" DisplayMember="Descripcion" ValueMember="idAlmacen" EditValue="{Binding idAlmacenDestino, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="4" AllowNullInput="True" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup Header="Datos de la Carga" View="GroupBox" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch" Orientation="Vertical">
|
||||||
|
<dxlc:LayoutGroup Width="1310" HorizontalAlignment="Left">
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical" Width="455">
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Direccion:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding LugarCarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" x:Name="teDireccionCliente" TabIndex="11" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
<dxlc:LayoutGroup>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Encargado Carga:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding Cargadores, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical" Width="540">
|
||||||
|
<dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical" Width="200">
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Código Postal:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:ButtonEdit x:Name="beCodigoPostalCarga" EditValue="{Binding CodigoPostalCarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="31" DefaultButtonClick="BeCodigoPostalCarga_DefaultButtonClick">
|
||||||
|
<dxe:ButtonInfo GlyphKind="Plus" x:Name="btAñadirCodigoPostalCarga" Click="BtAñadirCodigoPostalCarga_Click" />
|
||||||
|
<dxe:ButtonInfo GlyphKind="Cancel" x:Name="btCancelarCodigoPostalCarga" Click="BtCancelarCodigoPostalCarga_Click" />
|
||||||
|
</dxe:ButtonEdit>
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Teléfono 1:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding Telefono1Carga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical">
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Población:" x:Name="Poblacion">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding PoblacionCarga, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="13" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Teléfono 2:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding Telefono2Carga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical">
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Provincia:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding ProvinciaCarga, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="email:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding EmailCarga, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
|
||||||
|
<dxlc:LayoutGroup Width="1310" HorizontalAlignment="Left">
|
||||||
|
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Fecha Carga:" Width="250">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:DateEdit EditValue="{Binding FechaCarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="101" Mask="G" MaskUseAsDisplayFormat="True" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Observaciones:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS Modificable="NoModificable" UsualCorreccion="False" />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding ObservacionesCarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="20" FontWeight="Bold" Foreground="Red" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup Header="Datos de la Descarga" View="GroupBox" IsLocked="True" Width="Auto" HorizontalAlignment="Stretch" Orientation="Vertical">
|
||||||
|
<dxlc:LayoutGroup Width="1310" HorizontalAlignment="Left">
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical" Width="455">
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Direccion:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding LugarDescarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="11" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
<dxlc:LayoutGroup>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Encargado Descarga:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding Descargadores, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical" Width="540">
|
||||||
|
<dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical" Width="200">
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Código Postal:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:ButtonEdit x:Name="beCodigoPostalDescarga" EditValue="{Binding CodigoPostalDescarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="31" DefaultButtonClick="BeCodigoPostalDescarga_DefaultButtonClick">
|
||||||
|
<dxe:ButtonInfo GlyphKind="Plus" x:Name="btAñadirCodigoPostalDescarga" Click="BtAñadirCodigoPostalDescarga_Click" />
|
||||||
|
<dxe:ButtonInfo GlyphKind="Cancel" x:Name="btCancelarCodigoPostalDescarga" Click="BtCancelarCodigoPostalDescarga_Click" />
|
||||||
|
</dxe:ButtonEdit>
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Teléfono 1:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding Telefono1Descarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical">
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Población:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding PoblacionDescarga, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="13" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Teléfono 2:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding Telefono2Descarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="15" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical">
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Provincia:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding ProvinciaDescarga, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="email:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding EmailDescarga, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="14" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
|
||||||
|
<dxlc:LayoutGroup Width="1310" HorizontalAlignment="Left">
|
||||||
|
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Fecha Descarga:" Width="250">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:DateEdit EditValue="{Binding FechaDescarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="101" Mask="G" MaskUseAsDisplayFormat="True" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Observaciones:">
|
||||||
|
<tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsLayoutItem.PropiedadesTS>
|
||||||
|
<dxe:TextEdit EditValue="{Binding ObservacionesDescarga, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=true, ValidatesOnExceptions=true}" TabIndex="20" FontWeight="Bold" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
|
||||||
|
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<dx:DXTabControl x:Name="DXTabPersonal1" Width="Auto" HorizontalAlignment="Stretch">
|
||||||
|
<dx:DXTabControl.View>
|
||||||
|
<dx:TabControlScrollView />
|
||||||
|
</dx:DXTabControl.View>
|
||||||
|
<dx:DXTabItem Header="Desglose Albarán">
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical">
|
||||||
|
<tsWPFCore:tsGridControl x:Name="gcProductos" TabIndex="29">
|
||||||
|
<tsWPFCore:tsGridControl.PropiedadesTSGC>
|
||||||
|
<tsWPFCore:PropiedadesTSGC CamposObligatorios="Cantidad,idProducto" />
|
||||||
|
</tsWPFCore:tsGridControl.PropiedadesTSGC>
|
||||||
|
<tsWPFCore:tsGridControl.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS />
|
||||||
|
</tsWPFCore:tsGridControl.PropiedadesTS>
|
||||||
|
<tsWPFCore:tsGridControl.View>
|
||||||
|
<tsWPFCore:tsTableView x:Name="tvProductos" ShowGroupPanel="False" NewItemRowPosition="Bottom">
|
||||||
|
</tsWPFCore:tsTableView>
|
||||||
|
</tsWPFCore:tsGridControl.View>
|
||||||
|
|
||||||
|
<tsWPFCore:tsGridColumn FieldName="idProducto" Header="Producto" Width="400">
|
||||||
|
<tsWPFCore:tsGridColumn.EditSettings>
|
||||||
|
<dxe:ComboBoxEditSettings x:Name="cbProducto" ValueMember="idProducto" DisplayMember="Descripcion" AllowDefaultButton="False" AutoComplete="True">
|
||||||
|
<dxe:ComboBoxEditSettings.Buttons>
|
||||||
|
<dxe:ButtonInfo x:Name="biBuscarProducto" GlyphKind="Search" IsDefaultButton="False" Click="BiBuscarProducto_Click" />
|
||||||
|
</dxe:ComboBoxEditSettings.Buttons>
|
||||||
|
</dxe:ComboBoxEditSettings>
|
||||||
|
</tsWPFCore:tsGridColumn.EditSettings>
|
||||||
|
</tsWPFCore:tsGridColumn>
|
||||||
|
<tsWPFCore:tsGridColumn FieldName="Cantidad" Header="Cantidad" IsSmart="True" Width="70">
|
||||||
|
<tsWPFCore:tsGridColumn.EditSettings>
|
||||||
|
<dxe:TextEditSettings MaskType="Numeric" Mask="n0" MaskUseAsDisplayFormat="True" HorizontalContentAlignment="Right" />
|
||||||
|
</tsWPFCore:tsGridColumn.EditSettings>
|
||||||
|
</tsWPFCore:tsGridColumn>
|
||||||
|
<tsWPFCore:tsGridColumn FieldName="IncluidoEnPresupuesto" IsSmart="True" Width="150" SoloLectura="True">
|
||||||
|
<tsWPFCore:tsGridColumn.EditSettings>
|
||||||
|
<dxe:CheckEditSettings IsThreeState="False">
|
||||||
|
</dxe:CheckEditSettings>
|
||||||
|
</tsWPFCore:tsGridColumn.EditSettings>
|
||||||
|
</tsWPFCore:tsGridColumn>
|
||||||
|
<tsWPFCore:tsGridColumn FieldName="EsVenta" IsSmart="True" Width="150" x:Name="gcEsventa">
|
||||||
|
<tsWPFCore:tsGridColumn.EditSettings>
|
||||||
|
<dxe:CheckEditSettings IsThreeState="False">
|
||||||
|
</dxe:CheckEditSettings>
|
||||||
|
</tsWPFCore:tsGridColumn.EditSettings>
|
||||||
|
</tsWPFCore:tsGridColumn>
|
||||||
|
<tsWPFCore:tsGridColumn FieldName="Observaciones" Header="Observaciones" IsSmart="True" Width="500" />
|
||||||
|
|
||||||
|
</tsWPFCore:tsGridControl>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
</dx:DXTabItem>
|
||||||
|
<dx:DXTabItem Header="Registro de cambios">
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical">
|
||||||
|
<tsWPFCore:tsGridControl x:Name="gcLogs" TabIndex="30">
|
||||||
|
<tsWPFCore:tsGridControl.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS Modificable="NoModificable" />
|
||||||
|
</tsWPFCore:tsGridControl.PropiedadesTS>
|
||||||
|
<dxg:GridControl.View>
|
||||||
|
<dxg:TableView x:Name="tvLogs" ShowSearchPanelMode="Default" ShowGroupPanel="False" />
|
||||||
|
</dxg:GridControl.View>
|
||||||
|
<dxg:GridControl.Columns>
|
||||||
|
<tsWPFCore:tsGridColumn FieldName="idLog" Header="Nº Cambio" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||||
|
<tsWPFCore:tsGridColumn FieldName="FechaHora" Header="Fecha Hora Cambio">
|
||||||
|
<tsWPFCore:tsGridColumn.EditSettings>
|
||||||
|
<dxe:TextEditSettings MaskType="DateTime" MaskUseAsDisplayFormat="True" Mask="dd/MM/yyyy HH:mm" />
|
||||||
|
</tsWPFCore:tsGridColumn.EditSettings>
|
||||||
|
</tsWPFCore:tsGridColumn>
|
||||||
|
<tsWPFCore:tsGridColumn FieldName="Usuario" Header="Usuario" Width="250" IsSmart="True" />
|
||||||
|
<tsWPFCore:tsGridColumn FieldName="ip" Header="Dirección IP" IsSmart="True" Width="150" />
|
||||||
|
</dxg:GridControl.Columns>
|
||||||
|
|
||||||
|
</tsWPFCore:tsGridControl>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
</dx:DXTabItem>
|
||||||
|
</dx:DXTabControl>
|
||||||
|
|
||||||
|
</dxlc:LayoutControl>
|
||||||
|
</Grid>
|
||||||
|
</tsWPFCore:tsUserControl>
|
||||||
785
GestionGrupoSanchoToro/Almacen/ucAlbaran.xaml.vb
Normal file
785
GestionGrupoSanchoToro/Almacen/ucAlbaran.xaml.vb
Normal file
@@ -0,0 +1,785 @@
|
|||||||
|
Imports DevExpress.Xpf.Editors
|
||||||
|
Imports DevExpress.Xpf.LayoutControl
|
||||||
|
Imports tsWPFCore
|
||||||
|
Imports System.ComponentModel
|
||||||
|
Imports System.Data
|
||||||
|
Imports DevExpress.Xpf.Editors.Validation
|
||||||
|
Imports DevExpress.Xpf.Editors.Helpers
|
||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
Imports tsWPFCore.modExtensiones
|
||||||
|
Imports System.Data.Common
|
||||||
|
Imports System.Data.Entity
|
||||||
|
Imports bdGrupoSanchoToro.db
|
||||||
|
Imports tsUtilidades.Datos
|
||||||
|
Imports DevExpress.Xpf.Bars
|
||||||
|
Imports DevExpress.Xpf.Grid
|
||||||
|
Imports System.Collections
|
||||||
|
Imports tsUtilidades.Extensiones
|
||||||
|
Imports tsUtilidades.Enumeraciones
|
||||||
|
Imports bdGrupoSanchoToro.db.Utilidades
|
||||||
|
Imports bdGrupoSanchoToro.db.tscGrupoSanchoToro
|
||||||
|
Imports System.Drawing
|
||||||
|
Imports bdGrupoSanchoToro.db.albaranes
|
||||||
|
|
||||||
|
Public Class ucAlbaran
|
||||||
|
Private bd As tscGrupoSanchoToro
|
||||||
|
Friend _idAlbaran As Nullable(Of Integer)
|
||||||
|
Private lProductos As List(Of productos)
|
||||||
|
Private lArticulos As List(Of articulos)
|
||||||
|
Friend idLog As Integer?
|
||||||
|
|
||||||
|
|
||||||
|
Public Overrides Sub Cargado()
|
||||||
|
|
||||||
|
Me.Tipo_ucControlBusqueda = GetType(ucAlbaranes)
|
||||||
|
End Sub
|
||||||
|
Dim ra As albaranes
|
||||||
|
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
|
||||||
|
Try
|
||||||
|
|
||||||
|
lProductos = bd.productos.OrderBy(Function(x) x.Descripcion).ToList
|
||||||
|
Dim lProductosAlb = ra.detallesalbaranes.Select(Function(x) x.idProducto).ToArray
|
||||||
|
lProductos = lProductos.Where(Function(x) x.FechaBaja Is Nothing OrElse lProductosAlb.Contains(x.idProducto)).ToList
|
||||||
|
cbProducto.ItemsSource = lProductos
|
||||||
|
|
||||||
|
cbRazonSocial.ItemsSource = bd.entidades.Where(Function(X) X.FechaBaja.HasValue = False OrElse X.idEntidad = ra.idEntidad).ToList.Select(Function(x) New With {x.idEntidad, x.RazonSocial}).OrderBy(Function(x) x.RazonSocial).ToList
|
||||||
|
|
||||||
|
Dim plantillas As List(Of tsWPFCore.Plantilla) = Comun.ObtienePlantillas(bd, {"GRUPLA.ALBENT"}, False)
|
||||||
|
Me.ContenedorAplicacion.cbPlantillaAImprimir.ItemsSource = plantillas
|
||||||
|
If plantillas.Count > 0 Then
|
||||||
|
Me.ContenedorAplicacion.bePlantilla.EditValue = plantillas.First.idPlantilla
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim Acciones As New List(Of tsWPFCore.Accion)
|
||||||
|
Acciones.Add(New Accion With {
|
||||||
|
.idAccion = 1,
|
||||||
|
.Descripcion = "GENERA ALBARÁN DE RECOGIDA Y FACTURA RÁPIDA (F10)"})
|
||||||
|
Acciones.Add(New Accion With {
|
||||||
|
.idAccion = 3,
|
||||||
|
.Descripcion = "GENERA ALBARÁN DE RECOGIDA DE PRODUCTOS PENDIENTES (F11)"})
|
||||||
|
Acciones.Add(New Accion With {
|
||||||
|
.idAccion = 2,
|
||||||
|
.Descripcion = "ENVIAR ALBARÁN POR CORREO ELECTRÓNICO (F12)"})
|
||||||
|
Me.ContenedorAplicacion.cbAcciones.ItemsSource = Acciones
|
||||||
|
Me.ContenedorAplicacion.beAcciones.EditValue = Acciones.First.idAccion
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
|
||||||
|
Try
|
||||||
|
Dim NuevoEstado As tsUtilidades.EstadosAplicacion
|
||||||
|
|
||||||
|
If idLog.HasValue Then
|
||||||
|
'Try
|
||||||
|
' Dim log = bd.logs.First(Function(x) x.idLog = idLog)
|
||||||
|
' ra = tsUtilidades.Utilidades.DeserializarSinErrores(log.LogXML, GetType(albaranes))
|
||||||
|
' If ra.idUsuario.HasValue Then ra.idUsuarioNavigation = bd.usuarios.FirstOrDefault(Function(x) x.idUsuario = ra.idUsuario.Value)
|
||||||
|
' Dim df = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "detallesalbaranes_AE")
|
||||||
|
' If df IsNot Nothing Then
|
||||||
|
' Dim ld As List(Of detallesalbaranes) = tsUtilidades.Utilidades.DeserializarSinErrores(df.LogXML, GetType(List(Of detallesalbaranes)))
|
||||||
|
' For Each d In ld
|
||||||
|
' Dim pr = bd.productos.FirstOrDefault(Function(x) x.idProducto = d.idProducto)
|
||||||
|
' d.productos = pr
|
||||||
|
' If d.idArticulo.HasValue Then
|
||||||
|
' Dim art = bd.articulos.FirstOrDefault(Function(x) x.idArticulo = d.idArticulo)
|
||||||
|
' d.articulos = art
|
||||||
|
' End If
|
||||||
|
' ra.detallesalbaranes.Add(d)
|
||||||
|
' Next
|
||||||
|
' End If
|
||||||
|
' Dim mv = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "MOVIMIENTOSCAJA_AE")
|
||||||
|
' If mv IsNot Nothing Then
|
||||||
|
' Dim ld = tsUtilidades.Utilidades.DeserializarSinErrores(mv.LogXML, GetType(List(Of movimientoscaja)))
|
||||||
|
' For Each d In ld
|
||||||
|
' ra.movimientoscaja.Add(d)
|
||||||
|
' Next
|
||||||
|
' End If
|
||||||
|
' Dim lent = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "ENTIDADES")
|
||||||
|
' If lent IsNot Nothing Then
|
||||||
|
' Dim ent = tsUtilidades.Utilidades.DeserializarSinErrores(lent.LogXML, GetType(entidades))
|
||||||
|
' ra.entidades = ent
|
||||||
|
' ' lgDatosCliente.DataContext = ra.entidades
|
||||||
|
' End If
|
||||||
|
' Dim lobr = bd.logs.FirstOrDefault(Function(x) x.idRelacionado = log.idLog AndAlso x.Aplicacion = "OBRAS")
|
||||||
|
' If lobr IsNot Nothing Then
|
||||||
|
' Dim obr = tsUtilidades.Utilidades.DeserializarSinErrores(lobr.LogXML, GetType(destinomontajes))
|
||||||
|
' ra.destinomontajes = obr
|
||||||
|
' ' lgDatosObra.DataContext = ra.destinomontajes
|
||||||
|
' End If
|
||||||
|
' NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||||
|
'Catch EX As Exception
|
||||||
|
' Throw New Exception("No ha sido posible mostrar el registro del cambio (id " & idLog.Value.ToString & ").", EX)
|
||||||
|
'End Try
|
||||||
|
Else
|
||||||
|
If FuerzaNuevo OrElse _idAlbaran Is Nothing Then
|
||||||
|
ra = New albaranes
|
||||||
|
_idAlbaran = Nothing
|
||||||
|
ra.Fecha = DateOnly.FromDateTime(Today)
|
||||||
|
ra.NumeroBultos = 1
|
||||||
|
NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
|
||||||
|
Else
|
||||||
|
ra = bd.albaranes.First(Function(x) x.idAlbaran = _idAlbaran)
|
||||||
|
NuevoEstado = tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If Me.cbTipo.ItemsSource Is Nothing Then
|
||||||
|
cbTipo.ItemsSource = tsUtilidades.DescripcionValor.EnumADescripcionValor(GetType(bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum))
|
||||||
|
cbAlmacenOrigen.ItemsSource = Comun.ObtieneListaAlmacenes(bd)
|
||||||
|
cbAlmacenDestino.ItemsSource = Comun.ObtieneListaAlmacenes(bd)
|
||||||
|
End If
|
||||||
|
Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ra.idAlbaran AndAlso x.Aplicacion = "albaranes").ToList
|
||||||
|
gcProductos.ItemsSource = ra.detallesalbaranes
|
||||||
|
Me.DataContext = ra
|
||||||
|
Return NuevoEstado
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
|
||||||
|
bd = tscGrupoSanchoToro.NuevoContexto
|
||||||
|
Return bd
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overrides ReadOnly Property NombreTablaBase As String
|
||||||
|
Get
|
||||||
|
Return "albaranes"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private ReadOnly Property IAplicacion_CampoIndice As String
|
||||||
|
Get
|
||||||
|
Return "idAlbaran"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
||||||
|
Get
|
||||||
|
If idLog.HasValue Then
|
||||||
|
Return "Albarán R.C.:" & idLog.ToString
|
||||||
|
Else
|
||||||
|
If Me.Estado = tsUtilidades.EstadosAplicacion.Nuevo Then
|
||||||
|
Return "Albarán.Nuevo"
|
||||||
|
Else
|
||||||
|
Return "Albarán." & DirectCast(Me.DataContext, albaranes).idAlbaran.ToString
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Overrides ReadOnly Property DescripcionRegistro As String
|
||||||
|
Get
|
||||||
|
Return "Albarán"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
'Public Overrides ReadOnly Property CampoIndice As String
|
||||||
|
' Get
|
||||||
|
' Return "idAlbaranEntrega"
|
||||||
|
' End Get
|
||||||
|
'End Property
|
||||||
|
|
||||||
|
Public Sub New(Optional idAlbaran As Integer? = Nothing)
|
||||||
|
|
||||||
|
' Llamada necesaria para el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
_idAlbaran = idAlbaran
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Public Overrides Sub EstableceTitulo()
|
||||||
|
If idLog.HasValue Then
|
||||||
|
Me.docpanel.Caption = "R.C. Albarán " & ra.idAlbaran
|
||||||
|
Me.docpanel.Tag = "R.C. Albarán." & ra.idAlbaran
|
||||||
|
Else
|
||||||
|
If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
|
||||||
|
Me.docpanel.Caption = "Albarán " & ra.idAlbaran
|
||||||
|
Me.docpanel.Tag = "Albarán." & ra.idAlbaran.ToString
|
||||||
|
Else
|
||||||
|
Me.docpanel.Caption = "Albarán Nuevo"
|
||||||
|
Me.docpanel.Tag = "Albaran.Nuevo"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Overrides Function obtienePermisos() As tsUtilidades.Permisos
|
||||||
|
Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", bdGrupoSanchoToro.db.Utilidades.idUsuario)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub ap_ValidarControl(sender As Object, e As ValidationEventArgs, ByRef ev As ErrorValidacion, ByRef ValorOriginalCambiado As Object) Handles Me.ValidarControl
|
||||||
|
|
||||||
|
Dim pts As PropiedadesTS = sender.parent.propiedadests
|
||||||
|
Try
|
||||||
|
If Not pts Is Nothing Then
|
||||||
|
Me.ErroresValidacion.EliminaError("validando-" & pts.NombreCampo)
|
||||||
|
|
||||||
|
Select Case pts.NombreCampo.ToLower
|
||||||
|
|
||||||
|
Case "codigopostalcarga"
|
||||||
|
If Not e.Value Is Nothing AndAlso e.Value.ToString <> "" AndAlso e.Value.ToString <> ra.CodigoMunicipioCarga Then
|
||||||
|
|
||||||
|
Dim sCpo As String = e.Value.ToString
|
||||||
|
If sCpo.Length <> 5 Then Throw New Exception("El código postal no es correcto")
|
||||||
|
Dim sCodigoprovincia As String = sCpo.Substring(0, 2)
|
||||||
|
If Not bd.provincias.Any(Function(x) x.CodigoProvincia = sCodigoprovincia) Then If sCpo.Length <> 5 Then Throw New Exception("El código postal del Cliente no es correcto")
|
||||||
|
Select Case bd.codigospostales.Where(Function(x) x.CodigoPostal = sCpo).Count
|
||||||
|
Case 0
|
||||||
|
Dim vncp As New dxwAgregarNuevoCodigoPostal(sCpo, bd)
|
||||||
|
If vncp.ShowDialog Then
|
||||||
|
Dim pob = bd.codigospostales.First(Function(x) x.CodigoPostal = sCpo)
|
||||||
|
ra.CodigoMunicipioCarga = pob.CodigoMunicipio
|
||||||
|
Else
|
||||||
|
Throw New Exception("El código postal de la carga no es correcto")
|
||||||
|
End If
|
||||||
|
Case 1
|
||||||
|
Dim pob = bd.codigospostales.First(Function(x) x.CodigoPostal = sCpo)
|
||||||
|
ra.CodigoMunicipioCarga = pob.CodigoMunicipio
|
||||||
|
Case Else
|
||||||
|
Dim wMunicipios As New dxwCodigosPostales(bd, sCpo)
|
||||||
|
If wMunicipios.ShowDialog Then
|
||||||
|
ra.CodigoMunicipioCarga = wMunicipios.CodigoMunicipio
|
||||||
|
Else
|
||||||
|
Throw New Exception("El código postal de la carga no es correcto")
|
||||||
|
End If
|
||||||
|
End Select
|
||||||
|
ra.CodigoMunicipioCargaNavigation = bd.municipios.First(Function(x) x.CodigoMunicipio = ra.CodigoMunicipioCarga)
|
||||||
|
' ra.CodigoPostalCarga = sCpo
|
||||||
|
ra.RefrescaCamposSoloLectura()
|
||||||
|
End If
|
||||||
|
Case "codigopostaldescarga"
|
||||||
|
If Not e.Value Is Nothing AndAlso e.Value.ToString <> "" AndAlso e.Value.ToString <> ra.CodigoMunicipioDescarga Then
|
||||||
|
|
||||||
|
Dim sCpo As String = e.Value.ToString
|
||||||
|
If sCpo.Length <> 5 Then Throw New Exception("El código postal no es correcto")
|
||||||
|
Dim sCodigoprovincia As String = sCpo.Substring(0, 2)
|
||||||
|
If Not bd.provincias.Any(Function(x) x.CodigoProvincia = sCodigoprovincia) Then If sCpo.Length <> 5 Then Throw New Exception("El código postal del Cliente no es correcto")
|
||||||
|
Select Case bd.codigospostales.Where(Function(x) x.CodigoPostal = sCpo).Count
|
||||||
|
Case 0
|
||||||
|
Dim vncp As New dxwAgregarNuevoCodigoPostal(sCpo, bd)
|
||||||
|
If vncp.ShowDialog Then
|
||||||
|
Dim pob = bd.codigospostales.First(Function(x) x.CodigoPostal = sCpo)
|
||||||
|
ra.CodigoMunicipioDescarga = pob.CodigoMunicipio
|
||||||
|
Else
|
||||||
|
Throw New Exception("El código postal de la descarga no es correcto")
|
||||||
|
End If
|
||||||
|
Case 1
|
||||||
|
Dim pob = bd.codigospostales.First(Function(x) x.CodigoPostal = sCpo)
|
||||||
|
ra.CodigoMunicipioDescarga = pob.CodigoMunicipio
|
||||||
|
Case Else
|
||||||
|
Dim wMunicipios As New dxwCodigosPostales(bd, sCpo)
|
||||||
|
If wMunicipios.ShowDialog Then
|
||||||
|
ra.CodigoMunicipioDescarga = wMunicipios.CodigoMunicipio
|
||||||
|
Else
|
||||||
|
Throw New Exception("El código postal de la descarga no es correcto")
|
||||||
|
End If
|
||||||
|
End Select
|
||||||
|
ra.CodigoMunicipioDescargaNavigation = bd.municipios.First(Function(x) x.CodigoMunicipio = ra.CodigoMunicipioCarga)
|
||||||
|
' ra.CodigoPostalDescarga = sCpo
|
||||||
|
ra.RefrescaCamposSoloLectura()
|
||||||
|
|
||||||
|
End If
|
||||||
|
Case "emailcarga"
|
||||||
|
If e.Value IsNot Nothing AndAlso e.Value.ToString <> "" Then
|
||||||
|
If Not e.Value.ToString.Trim.ToLower.EsEmailValido Then Throw New Exception("El email es incorrecto")
|
||||||
|
End If
|
||||||
|
Case "emaildescarga"
|
||||||
|
If e.Value IsNot Nothing AndAlso e.Value.ToString <> "" Then
|
||||||
|
If Not e.Value.ToString.Trim.ToLower.EsEmailValido Then Throw New Exception("El email es incorrecto")
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Dim sCodigoError As String = "validando-"
|
||||||
|
If pts IsNot Nothing Then
|
||||||
|
sCodigoError &= pts.NombreCampo
|
||||||
|
End If
|
||||||
|
ev = New ErrorValidacion(sCodigoError, sender, ex.Message, ex, DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical)
|
||||||
|
e.IsValid = False
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
Private Sub BtAñadirCodigoPostalCarga_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
If ContenedorAplicacion.btGuardar.IsEnabled Then
|
||||||
|
Dim vncp As New dxwAgregarNuevoMunicipio("")
|
||||||
|
If vncp.ShowDialog Then
|
||||||
|
Dim pob = bd.codigospostales.AsNoTracking.First(Function(x) x.CodigoPostal = vncp._CodigoPostal)
|
||||||
|
ra.CodigoMunicipioCarga = pob.CodigoMunicipio
|
||||||
|
ra.CodigoPostalCarga = vncp._CodigoPostal
|
||||||
|
ra.CodigoMunicipioCargaNavigation = bd.municipios.AsNoTracking.First(Function(x) x.CodigoMunicipio = ra.CodigoMunicipioCarga)
|
||||||
|
ra.RefrescaCamposSoloLectura()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Private Sub BtAñadirCodigoPostalDesCarga_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
If ContenedorAplicacion.btGuardar.IsEnabled Then
|
||||||
|
Dim vncp As New dxwAgregarNuevoMunicipio("")
|
||||||
|
If vncp.ShowDialog Then
|
||||||
|
Dim pob = bd.codigospostales.First(Function(x) x.CodigoPostal = vncp._CodigoPostal)
|
||||||
|
ra.CodigoMunicipioDescarga = pob.CodigoMunicipio
|
||||||
|
ra.CodigoPostalDescarga = vncp._CodigoPostal
|
||||||
|
ra.CodigoMunicipioDescargaNavigation = bd.municipios.AsNoTracking.First(Function(x) x.CodigoMunicipio = ra.CodigoMunicipioDescarga)
|
||||||
|
ra.RefrescaCamposSoloLectura()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Private Sub BtCancelarCodigoPostalCarga_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
If ContenedorAplicacion.btGuardar.IsEnabled Then
|
||||||
|
ra.CodigoPostalCarga = ""
|
||||||
|
ra.CodigoMunicipioCarga = ""
|
||||||
|
ra.CodigoMunicipioCarga = Nothing
|
||||||
|
ra.RefrescaCamposSoloLectura()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Private Sub BtCancelarCodigoPostalDescarga_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
If ContenedorAplicacion.btGuardar.IsEnabled Then
|
||||||
|
ra.CodigoPostalDescarga = ""
|
||||||
|
ra.CodigoMunicipioDescarga = ""
|
||||||
|
ra.CodigoMunicipioDescargaNavigation = Nothing
|
||||||
|
ra.RefrescaCamposSoloLectura()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ap_DespuesGuardar(sender As Object, e As ItemClickEventArgs, OpcionGuardado As Integer) Handles Me.DespuesGuardar
|
||||||
|
Dim ae As albaranes = Me.DataContext
|
||||||
|
_idAlbaran = DirectCast(Me.DataContext, albaranes).idAlbaran
|
||||||
|
Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ae.idAlbaran AndAlso x.Aplicacion = "albaranes").ToList
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub ap_Enlazar(Celda As EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
|
||||||
|
|
||||||
|
Select Case Celda.Column.FieldName.ToLower
|
||||||
|
Case "idlog"
|
||||||
|
Dim log As logs = gcLogs.CurrentItem
|
||||||
|
Dim id As Integer = log.idLog
|
||||||
|
Dim uc As New ucAlbaran
|
||||||
|
uc.idLog = log.idLog
|
||||||
|
FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||||
|
End Select
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub ap_EstadoCambiado(EstadoAnterior As tsUtilidades.EstadosAplicacion, EstadoNuevo As tsUtilidades.EstadosAplicacion) Handles Me.EstadoCambiado
|
||||||
|
If idLog.HasValue Then EstableceSoloLectura()
|
||||||
|
Select Case EstadoNuevo
|
||||||
|
Case tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||||
|
If ra.Tipo = TipoAlbaranEnum.COMPRA Then
|
||||||
|
gcEsventa.ReadOnly = True
|
||||||
|
Else
|
||||||
|
gcEsventa.ReadOnly = False
|
||||||
|
End If
|
||||||
|
End Select
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub BiBuscarProducto_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
|
||||||
|
|
||||||
|
If tvProductos.ActiveEditor Is Nothing Then
|
||||||
|
Dispatcher.BeginInvoke(New Action(Sub() tvProductos.ShowEditor()), System.Windows.Threading.DispatcherPriority.Render)
|
||||||
|
End If
|
||||||
|
Dim dxw As New dxwProductos(lProductos)
|
||||||
|
If dxw.ShowDialog Then
|
||||||
|
Dim dea As detallesalbaranes = gcProductos.CurrentItem
|
||||||
|
Dim prod = lProductos.First(Function(x) x.idProducto = dxw.idProducto)
|
||||||
|
If tvProductos.ActiveEditor IsNot Nothing Then
|
||||||
|
tvProductos.ActiveEditor.EditValue = prod.idProducto
|
||||||
|
Else
|
||||||
|
Debug.Write("no")
|
||||||
|
End If
|
||||||
|
tvProductos.PostEditor()
|
||||||
|
tvProductos.CloseEditor()
|
||||||
|
gcProductos.RefreshRow(tvProductos.FocusedRowHandle)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub BiBuscarCliente_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
'If Me.Estado = EstadosAplicacion.Nuevo Then
|
||||||
|
Dim dxw As New dxwEntidades(bd, True, False)
|
||||||
|
If dxw.ShowDialog Then
|
||||||
|
Dim ent = bd.entidades.First(Function(x) x.idEntidad = dxw.Entidad.idEntidad)
|
||||||
|
ra.idEntidadNavigation = ent
|
||||||
|
ra.idEntidad = ent.idEntidad
|
||||||
|
End If
|
||||||
|
' End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub RellenaDatosProducto(dea As detallesalbaranes)
|
||||||
|
If dea IsNot Nothing AndAlso dea.idProducto <> 0 Then
|
||||||
|
Dim ae As albaranes = Me.DataContext
|
||||||
|
Dim pr = lProductos.First(Function(x) x.idProducto = dea.idProducto)
|
||||||
|
If dea.Cantidad = 0 Then dea.Cantidad = 1
|
||||||
|
dea.EsVenta = False
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub tvProductos_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles tvProductos.PreviewKeyDown
|
||||||
|
If e.Key = Key.F6 Then
|
||||||
|
Select Case gcProductos.CurrentColumn.FieldName.ToLower
|
||||||
|
Case "idproducto"
|
||||||
|
BiBuscarProducto_Click(Nothing, Nothing)
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub BeCodigoPostalCarga_DefaultButtonClick(sender As Object, e As RoutedEventArgs)
|
||||||
|
|
||||||
|
Dim dxw As New dxwCodigosPostales(bd, "")
|
||||||
|
If dxw.ShowDialog Then
|
||||||
|
ra.CodigoMunicipioCarga = dxw.CodigoMunicipio
|
||||||
|
ra.CodigoMunicipioCargaNavigation = bd.municipios.First(Function(x) x.CodigoMunicipio = ra.CodigoMunicipioCarga)
|
||||||
|
ra.CodigoPostalCarga = dxw.CodigoPostal
|
||||||
|
ra.RefrescaCamposSoloLectura()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub BeCodigoPostalDescarga_DefaultButtonClick(sender As Object, e As RoutedEventArgs)
|
||||||
|
|
||||||
|
Dim dxw As New dxwCodigosPostales(bd, "")
|
||||||
|
If dxw.ShowDialog Then
|
||||||
|
ra.CodigoMunicipioDescarga = dxw.CodigoMunicipio
|
||||||
|
ra.CodigoPostalDescarga = dxw.CodigoPostal
|
||||||
|
ra.CodigoMunicipioDescargaNavigation = bd.municipios.First(Function(x) x.CodigoMunicipio = ra.CodigoMunicipioDescarga)
|
||||||
|
ra.RefrescaCamposSoloLectura()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub uc_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer, Previsualizar As Boolean) Handles Me.ImprimirPlantilla
|
||||||
|
|
||||||
|
If Me.Estado = tsUtilidades.EstadosAplicacion.ModificandoRegistro Then
|
||||||
|
Dim bdtmp = tscGrupoSanchoToro.NuevoContexto
|
||||||
|
Dim ae = bdtmp.albaranes.First(Function(x) x.idAlbaran = ra.idAlbaran)
|
||||||
|
Imprimir(ra, idPlantilla, 1, False)
|
||||||
|
Else
|
||||||
|
DXMessageBox.Show("Antes debe almacenar", "Atención")
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Imprimir(ra As albaranes, idPlantilla As Integer, Copias As Integer, ImpresoraDefecto As Boolean)
|
||||||
|
Dim ds As List(Of albaranes)
|
||||||
|
' Dim pl As plantillas = (From p In bd.plantillas Where p.idPlantilla = idPlantilla).First
|
||||||
|
Dim pl = bd.plantillas.AsNoTracking.Where(Function(x) x.idPlantilla = idPlantilla).Select(Function(x) New With {.Fichero = x.idFicheroNavigation.Fichero, .Tipo = x.idGrupoNavigation.Codigo}).FirstOrDefault
|
||||||
|
ds = New List(Of albaranes)
|
||||||
|
ds.Add(ra)
|
||||||
|
Select Case pl.Tipo
|
||||||
|
Case Else ' "GRUPLA.ALBENT"
|
||||||
|
tsWPFCore.tsXtraReport.ImprimirPlantilla(pl.Fichero, ImpresoraDefecto, Copias, ds)
|
||||||
|
End Select
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub tvProductos_ShowingEditor(sender As Object, e As ShowingEditorEventArgs) Handles tvProductos.ShowingEditor
|
||||||
|
|
||||||
|
'If ra.detallesalbaranes.ToList.Any(Function(x) x.idAlbaranRecogida.HasValue OrElse (x.idUltimaFactura.HasValue AndAlso (x.facturas.Fecha > ra.Fecha.Date))) Then
|
||||||
|
' If e.RowHandle <> DataControlBase.NewItemRowHandle Then
|
||||||
|
' Dim da As detallesalbaranes = gcProductos.GetRow(e.RowHandle)
|
||||||
|
' If e.Column.FieldName.ToLower <> "observaciones" AndAlso e.Column.FieldName.ToLower <> "fechacancelacion" AndAlso e.Column.FieldName.ToLower <> "motivocancelacion" AndAlso e.Column.FieldName.ToLower <> "precio" AndAlso e.Column.FieldName.ToLower <> "cantidad" Then
|
||||||
|
' If da.idAlbaranRecogida.HasValue OrElse da.idUltimaFactura.HasValue Then
|
||||||
|
' e.Cancel = True
|
||||||
|
' e.Handled = True
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
'End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub beCodigoPostalCarga_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles beCodigoPostalCarga.PreviewKeyDown
|
||||||
|
If e.Key = Key.F6 Then
|
||||||
|
BeCodigoPostalCarga_DefaultButtonClick(Nothing, Nothing)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub beCodigoPostalDescarga_PreviewKeyDown(sender As Object, e As KeyEventArgs) Handles beCodigoPostalDescarga.PreviewKeyDown
|
||||||
|
If e.Key = Key.F6 Then
|
||||||
|
BeCodigoPostalDescarga_DefaultButtonClick(Nothing, Nothing)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub tvProductos_ValidateRow(sender As Object, e As GridRowValidationEventArgs) Handles tvProductos.ValidateRow
|
||||||
|
'Dim da As detallesalbaranes = e.Row
|
||||||
|
'Dim Errores As String = ""
|
||||||
|
'If da.Cantidad <> 1 AndAlso da.idArticulo.HasValue Then
|
||||||
|
' Errores &= "Si es un artículo en concreto la cantidad tiene que ser 1" & vbCrLf
|
||||||
|
'End If
|
||||||
|
'If Errores <> "" Then
|
||||||
|
' DXMessageBox.Show(Errores, "Error")
|
||||||
|
' e.SetError(Errores)
|
||||||
|
' e.IsValid = False
|
||||||
|
'End If
|
||||||
|
|
||||||
|
Try
|
||||||
|
Dim htErrores = New Hashtable
|
||||||
|
ErroresValidacion.LimpiarErrores("TSGC-" & gcProductos.PropiedadesTS.NumeroObjeto.ToString & ":" & e.RowHandle.ToString & ":")
|
||||||
|
Dim da As detallesalbaranes = e.Row
|
||||||
|
|
||||||
|
If da.Cantidad <> 1 AndAlso da.idArticulo.HasValue Then
|
||||||
|
htErrores.Add("Cantidad1", "Si es un artículo en concreto la cantidad tiene que ser 1")
|
||||||
|
End If
|
||||||
|
If htErrores.Count > 0 Then
|
||||||
|
Me.AgregaErroresTSGC(gcProductos, htErrores, e)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
|
||||||
|
DXMessageBox.Show(ex.Message, "Error")
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub tvProductos_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles tvProductos.InitNewRow
|
||||||
|
gcProductos.SetCellValue(e.RowHandle, "Cantidad", 1)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ucAlbaranEntrega_EjecutarAccion(sender As Object, e As ItemClickEventArgs, idAccion As Integer) Handles Me.EjecutarAccion
|
||||||
|
'Select Case idAccion
|
||||||
|
' Case 1 ' GENERA ALBARÁN DE RECOGIDA Y FACTURA RAPIDA
|
||||||
|
' Try
|
||||||
|
' If Not Guardar(Nothing, Nothing,,, 3) Then
|
||||||
|
' Dim ae As albaranes = Me.DataContext
|
||||||
|
' ' If ae.detallesalbaranes.Any(Function(x) x.idAlbaranRecogida.HasValue) Then
|
||||||
|
' ' DXMessageBox.Show("Sólo se puede generar una factura rápida si no se ha recogido ningún producto del albarán", "Atención")
|
||||||
|
' ' Else
|
||||||
|
' Dim ar As albaranesrecogida = New albaranesrecogida
|
||||||
|
' With ar
|
||||||
|
' .Fecha = Now
|
||||||
|
' .idCliente = ae.idCliente
|
||||||
|
' .idUsuario = idUsuario
|
||||||
|
' .EstableceNumeroAlbaran(bd)
|
||||||
|
' End With
|
||||||
|
' bd.albaranesrecogida.Add(ar)
|
||||||
|
' For Each d In ae.detallesalbaranes.Where(Function(x) x.EsVenta = False AndAlso x.idAlbaranRecogida.HasValue = False)
|
||||||
|
' d.albaranesrecogida = ar
|
||||||
|
' Next
|
||||||
|
' bd.GuardarCambios()
|
||||||
|
' Dim id As Integer = ae.idAlbaranEntrega
|
||||||
|
' Dim uc As New ucFacturaEmitida(,, id)
|
||||||
|
' FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||||
|
' tsWPFCore.Comun.dm.DockController.RemovePanel(docpanel)
|
||||||
|
' End If
|
||||||
|
' Catch ex As Exception
|
||||||
|
' FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
|
||||||
|
' DXMessageBox.Show(ex.Message, "Error")
|
||||||
|
' End Try
|
||||||
|
' Case 2 ' ENVIA ALBARÁN DE ENTREGA POR EMAIL
|
||||||
|
|
||||||
|
' Dim bCancelar As Boolean = False
|
||||||
|
' If Me.ContenedorAplicacion.btGuardar.IsEnabled Then
|
||||||
|
' bCancelar = Me.Guardar(Nothing, Nothing,, True, 5)
|
||||||
|
' End If
|
||||||
|
' If Not bCancelar Then
|
||||||
|
' Dim dxnc = New dxwEnvioCorreo(ra.entidades.Email, ra.entidades.Email2, "", "Producciones Romian, S.L. - Adjunto le remitimos albarán de entrega nº " & ra.NumeroAlbaran, "Distinguidos Sres., " & vbCrLf & "Adjunto le remitimos albarán entrega nº " & ra.NumeroAlbaran, "AlbaranEntrega_" & ra.NumeroAlbaran.Replace("/", "-") & ".pdf")
|
||||||
|
' If dxnc.ShowDialog Then
|
||||||
|
' Dim cta = bd.cuentascorreo.First(Function(x) x.Codigo = "DEFECTO")
|
||||||
|
' Dim bAlbaran = GeneraPdfAlbaran(bd, ra)
|
||||||
|
' bdGrupoSanchoToro.db.correos.GeneraRegistroCorreon(bd, dxnc._Asunto, dxnc._Cuerpo, cta, dxnc._Destinatarios, dxnc._CC, dxnc._BCC, bAlbaran, dxnc._Adjunto, ra.idAlbaranEntrega, "albaranes", ra.idCliente)
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
'Case 3 ' GENERA ALBARÁN DE RECOGIDA RÁPIDO
|
||||||
|
' Try
|
||||||
|
' If Not Guardar(Nothing, Nothing,,, 3) Then
|
||||||
|
' Dim ae As albaranes = Me.DataContext
|
||||||
|
' Dim uc As New ucAlbaranRecogida(, ae.idAlbaranEntrega)
|
||||||
|
' FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||||
|
' tsWPFCore.Comun.dm.DockController.RemovePanel(docpanel)
|
||||||
|
' End If
|
||||||
|
' Catch ex As Exception
|
||||||
|
' FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
|
||||||
|
' DXMessageBox.Show(ex.Message, "Error")
|
||||||
|
' End Try
|
||||||
|
|
||||||
|
' End Select
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Shared Function GeneraPdfAlbaran(bd As tscGrupoSanchoToro, Albaran As albaranes) As Byte()
|
||||||
|
Dim albes As New List(Of albaranes)
|
||||||
|
albes.Add(Albaran)
|
||||||
|
Dim idplae = bd.plantillas.First(Function(x) x.Codigo = "ALBENTV").idPlantilla
|
||||||
|
If Albaran.entidades.TipoImpresionAlbaranEntrega = db.albaranes.TipoImpresionAlbaranEntregaEnum.IMPRIMIR_CONTRATO Then idplae = bd.plantillas.First(Function(x) x.Codigo = "CONTAE").idPlantilla
|
||||||
|
Dim bAes = Informes.GuardaInformeEnPdf(bd, idplae, albes)
|
||||||
|
Return bAes
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub ucAlbaranEntrega_TeclaFuncionPulsada(sender As Object, e As KeyEventArgs) Handles Me.TeclaFuncionPulsada
|
||||||
|
Select Case e.Key
|
||||||
|
Case Key.F12
|
||||||
|
ValidaControlObjetoActual()
|
||||||
|
ucAlbaranEntrega_EjecutarAccion(Nothing, Nothing, 2)
|
||||||
|
Case Key.F11
|
||||||
|
ValidaControlObjetoActual()
|
||||||
|
ucAlbaranEntrega_EjecutarAccion(Nothing, Nothing, 3)
|
||||||
|
|
||||||
|
Case Key.System
|
||||||
|
Select Case e.SystemKey
|
||||||
|
Case Key.F10
|
||||||
|
ValidaControlObjetoActual()
|
||||||
|
ucAlbaranEntrega_EjecutarAccion(Nothing, Nothing, 1)
|
||||||
|
e.Handled = True
|
||||||
|
End Select
|
||||||
|
|
||||||
|
End Select
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub gcProductos_AntesEliminar(gc As tsGridControl, ByRef Cancelar As Boolean) Handles gcProductos.AntesEliminar
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub ucAlbaranEntrega_CampoActualizado(sender As Object, e As DataTransferEventArgs) Handles Me.CampoActualizado
|
||||||
|
Dim pts As PropiedadesTS = sender.parent.propiedadests
|
||||||
|
If Not pts Is Nothing Then
|
||||||
|
|
||||||
|
Select Case pts.NombreCampo.ToLower
|
||||||
|
Case "tipo"
|
||||||
|
gcEsventa.ReadOnly = False
|
||||||
|
Select Case DirectCast(ra.Tipo, bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum)
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.COMPRA
|
||||||
|
For Each d In ra.detallesalbaranes.Where(Function(x) x.EsVenta)
|
||||||
|
d.EsVenta = False
|
||||||
|
Next
|
||||||
|
gcEsventa.ReadOnly = True
|
||||||
|
ra.idAlmacenOrigen = Nothing
|
||||||
|
EstableceSoloLectura(cbAlmacenOrigen, True)
|
||||||
|
EstableceSoloLectura(cbAlmacenDestino, False)
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.CAMBIO_ALMACEN
|
||||||
|
EstableceSoloLectura(cbAlmacenOrigen, False)
|
||||||
|
EstableceSoloLectura(cbAlmacenDestino, False)
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.SUBALQUILER
|
||||||
|
ra.idAlmacenOrigen = Nothing
|
||||||
|
EstableceSoloLectura(cbAlmacenOrigen, True)
|
||||||
|
EstableceSoloLectura(cbAlmacenDestino, False)
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.DEVOLUCION_SUBALQUILER
|
||||||
|
EstableceSoloLectura(cbAlmacenOrigen, False)
|
||||||
|
ra.idAlmacenDestino = Nothing
|
||||||
|
EstableceSoloLectura(cbAlmacenDestino, True)
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.ENTREGA
|
||||||
|
EstableceSoloLectura(cbAlmacenOrigen, False)
|
||||||
|
ra.idAlmacenDestino = Nothing
|
||||||
|
EstableceSoloLectura(cbAlmacenDestino, True)
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.RECOGIDA
|
||||||
|
ra.idAlmacenOrigen = Nothing
|
||||||
|
EstableceSoloLectura(cbAlmacenOrigen, True)
|
||||||
|
EstableceSoloLectura(cbAlmacenDestino, False)
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.STOCK_INICIAL_O_FABRICACION
|
||||||
|
ra.idAlmacenOrigen = Nothing
|
||||||
|
EstableceSoloLectura(cbAlmacenOrigen, True)
|
||||||
|
EstableceSoloLectura(cbAlmacenDestino, False)
|
||||||
|
End Select
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub hlVale_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
'Dim uc As New ucPresupuesto(ra.idPresupuesto)
|
||||||
|
'FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
'Private Sub hlPresupuesto_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
' If ra.idPresupuesto.HasValue Then
|
||||||
|
' Dim uc As New ucPresupuesto(ra.idPresupuesto)
|
||||||
|
' FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||||
|
' End If
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
Private Sub beContrato_DefaultButtonClick(sender As Object, e As RoutedEventArgs)
|
||||||
|
'Dim dxw As New dxwAsignarContrato(bd, ra.idEntidad)
|
||||||
|
'If dxw.ShowDialog Then
|
||||||
|
' Dim ctr = bd.presupuestos.First(Function(x) x.idPresupuesto = dxw.idPresupuesto)
|
||||||
|
' ra.idPresupuestoNavigation = ctr
|
||||||
|
' If ra.idEntidad.HasValue = False Then
|
||||||
|
' ra.idEntidadNavigation = ctr.idClienteNavigation
|
||||||
|
' ra.idEntidad = ctr.idCliente
|
||||||
|
' End If
|
||||||
|
|
||||||
|
'End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ucAlbaran_AntesGuardar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, EliminacionManual As Integer) Handles Me.AntesGuardar
|
||||||
|
Dim hte As New Hashtable
|
||||||
|
Select Case DirectCast(ra.Tipo, bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum)
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.COMPRA
|
||||||
|
For Each d In ra.detallesalbaranes.Where(Function(x) x.EsVenta)
|
||||||
|
d.EsVenta = False
|
||||||
|
Next
|
||||||
|
If ra.idAlmacenDestino.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_DESTINO_OBLIGATORIO", "El almacén destino es obligatorio")
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.CAMBIO_ALMACEN
|
||||||
|
If ra.idAlmacenOrigen.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_ORIGEN_OBLIGATORIO", "El almacén origen es obligatorio")
|
||||||
|
If ra.idAlmacenDestino.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_DESTINO_OBLIGATORIO", "El almacén destino es obligatorio")
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.SUBALQUILER
|
||||||
|
If ra.idAlmacenDestino.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_DESTINO_OBLIGATORIO", "El almacén destino es obligatorio")
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.DEVOLUCION_SUBALQUILER
|
||||||
|
If ra.idAlmacenOrigen.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_ORIGEN_OBLIGATORIO", "El almacén origen es obligatorio")
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.ENTREGA
|
||||||
|
If ra.idAlmacenOrigen.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_ORIGEN_OBLIGATORIO", "El almacén origen es obligatorio")
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.RECOGIDA
|
||||||
|
If ra.idAlmacenDestino.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_DESTINO_OBLIGATORIO", "El almacén destino es obligatorio")
|
||||||
|
Case bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum.STOCK_INICIAL_O_FABRICACION
|
||||||
|
If ra.idAlmacenDestino.HasValue = False Then hte.Add("ALMACENAR-ALMACEN_DESTINO_OBLIGATORIO", "El almacén destino es obligatorio")
|
||||||
|
End Select
|
||||||
|
If hte.Count > 0 Then
|
||||||
|
MensajesError = hte
|
||||||
|
Cancelar = True
|
||||||
|
Else
|
||||||
|
ra.idUsuario = bdGrupoSanchoToro.db.Utilidades.idUsuario
|
||||||
|
Dim bdtmp = tscGrupoSanchoToro.NuevoContexto
|
||||||
|
|
||||||
|
Select Case Estado
|
||||||
|
Case tsUtilidades.EstadosAplicacion.Nuevo
|
||||||
|
For Each d In ra.detallesalbaranes
|
||||||
|
d.idAlbaranNavigation = ra
|
||||||
|
d.ActualizaProducto(bdtmp, 1)
|
||||||
|
Next
|
||||||
|
Case tsUtilidades.EstadosAplicacion.ModificandoRegistro
|
||||||
|
Dim das = bdtmp.detallesalbaranes.Where(Function(x) x.idAlbaran = ra.idAlbaran).ToList
|
||||||
|
For Each d In das
|
||||||
|
d.ActualizaProducto(bdtmp, -1)
|
||||||
|
Next
|
||||||
|
For Each d In ra.detallesalbaranes
|
||||||
|
d.ActualizaProducto(bdtmp, 1)
|
||||||
|
Next
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ucAlbaran_AntesEliminar(sender As Object, e As ItemClickEventArgs, ByRef Cancelar As Boolean, ByRef MensajesError As Hashtable, ByRef OmitirPreguntaContinuar As Boolean) Handles Me.AntesEliminar
|
||||||
|
Dim bdtmp = tscGrupoSanchoToro.NuevoContexto
|
||||||
|
Dim das = bdtmp.detallesalbaranes.Where(Function(x) x.idAlbaran = ra.idAlbaran).ToList
|
||||||
|
For Each d In das
|
||||||
|
d.ActualizaProducto(bdtmp, -1)
|
||||||
|
Next
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btIrAContrato_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
If ra.idPresupuesto.HasValue Then
|
||||||
|
'Dim uc As New ucPresupuesto(ra.idPresupuesto)
|
||||||
|
'FuncionesDinamicas.AbrirAP(uc, OtrosParametros)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btQuitarContrato_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
ra.idPresupuesto = Nothing
|
||||||
|
ra.idPresupuestoNavigation = Nothing
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
End Class
|
||||||
98
GestionGrupoSanchoToro/Almacen/ucAlbaranes.xaml
Normal file
98
GestionGrupoSanchoToro/Almacen/ucAlbaranes.xaml
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
<tsWPFCore:tsUserControl
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||||
|
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||||
|
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:tsWPFCore="clr-namespace:tsWPFCore;assembly=tsWPFCore" x:Class="ucAlbaranes"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="768" d:DesignWidth="1366">
|
||||||
|
<tsWPFCore:tsUserControl.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="pack://application:,,,/tsWPFCore;component/Plantillas.xaml" />
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</tsWPFCore:tsUserControl.Resources>
|
||||||
|
<Grid>
|
||||||
|
<dxlc:LayoutControl Orientation="Vertical">
|
||||||
|
<dxlc:LayoutGroup View="GroupBox" Header="Búsqueda Rápida" Orientation="Vertical" x:Name="BusquedaRapida">
|
||||||
|
<dxlc:LayoutGroup Width="1100" HorizontalAlignment="Left" >
|
||||||
|
<dxlc:LayoutGroup Orientation="Vertical">
|
||||||
|
<dxlc:LayoutGroup >
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Fecha Inicio:" Width="250" >
|
||||||
|
<dxe:DateEdit x:Name="teFechaInicio" TabIndex="4" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Fecha Fin:" Width="200" >
|
||||||
|
<dxe:DateEdit x:Name="teFechaFin" TabIndex="5" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Tipos Albaranes" >
|
||||||
|
<dxe:ComboBoxEdit ValueMember="Valor" DisplayMember="Descripcion" x:Name="cbTipos" TabIndex="3" >
|
||||||
|
<dxe:ComboBoxEdit.StyleSettings>
|
||||||
|
<dxe:CheckedComboBoxStyleSettings />
|
||||||
|
</dxe:ComboBoxEdit.StyleSettings>
|
||||||
|
</dxe:ComboBoxEdit>
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<tsWPFCore:tsLayoutItem Label="Búsqueda:" FontWeight="Bold" >
|
||||||
|
<dxe:TextEdit x:Name="teBusqueda" TabIndex="0" FontWeight="Normal" />
|
||||||
|
</tsWPFCore:tsLayoutItem>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<Button Content="Buscar" Height="25" Width="100" x:Name="btBuscar" Click="BtBuscar_Click" IsDefault="True" TabIndex="1" />
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<dxlc:LayoutItem Label="Campos de búsqueda:">
|
||||||
|
<Border BorderThickness="1" BorderBrush="Black" >
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="Razón Social, NIF, Nº Albarán, Observaciones"/>
|
||||||
|
<TextBlock Margin="20,0,0,0" Text="(En Blanco Muestra Todos)" FontWeight="Bold" ></TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</dxlc:LayoutItem>
|
||||||
|
</dxlc:LayoutGroup>
|
||||||
|
<tsWPFCore:tsGridControl x:Name="gc" TabIndex="1" >
|
||||||
|
<tsWPFCore:tsGridControl.PropiedadesTS>
|
||||||
|
<tsWPFCore:PropiedadesTS Modificable="NoModificable"/>
|
||||||
|
</tsWPFCore:tsGridControl.PropiedadesTS>
|
||||||
|
<tsWPFCore:tsGridControl.PropiedadesTSGC>
|
||||||
|
<tsWPFCore:PropiedadesTSGC />
|
||||||
|
</tsWPFCore:tsGridControl.PropiedadesTSGC>
|
||||||
|
<dxg:GridControl.Columns>
|
||||||
|
<dxg:GridColumn FieldName="NumeroAlbaran" Width="150" IsSmart="True" Header="Nº Albarán" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||||
|
<dxg:GridColumn FieldName="DescripcionTipoAlbaran" Width="250" IsSmart="True" Header="Tipo" />
|
||||||
|
<dxg:GridColumn FieldName="RazonSocial" Header="Razón Social" Width="300" IsSmart="True" CellTemplate="{DynamicResource VerDetalleTemplate}" />
|
||||||
|
<dxg:GridColumn FieldName="NIF" Header="N.I.F." Width="100" IsSmart="True" />
|
||||||
|
<dxg:GridColumn FieldName="Fecha" Header="Fecha" IsSmart="True" Width="90" >
|
||||||
|
<dxg:GridColumn.EditSettings>
|
||||||
|
<dxe:DateEditSettings DisplayFormat="dd/MM/yyyy" />
|
||||||
|
</dxg:GridColumn.EditSettings>
|
||||||
|
</dxg:GridColumn>
|
||||||
|
<dxg:GridColumn FieldName="DescripcionEvento" Header="Evento" Width="400" IsSmart="True" />
|
||||||
|
<dxg:GridColumn FieldName="Usuario" Header="Usuario" Width="250" IsSmart="True" />
|
||||||
|
</dxg:GridControl.Columns>
|
||||||
|
<dxg:GridControl.View>
|
||||||
|
<dxg:TableView x:Name="tv" ShowSearchPanelMode="Always" ShowGroupPanel="True" ShowTotalSummary="True">
|
||||||
|
<dxg:TableView.FormatConditions>
|
||||||
|
<dxg:FormatCondition Expression="[Tipo]==2" FieldName="{x:Null}">
|
||||||
|
<dxg:Format Foreground="Green" />
|
||||||
|
</dxg:FormatCondition>
|
||||||
|
<dxg:FormatCondition Expression="[Tipo]==3 OrElse [Tipo]==4" FieldName="{x:Null}">
|
||||||
|
<dxg:Format Foreground="DarkOrange" />
|
||||||
|
</dxg:FormatCondition>
|
||||||
|
<dxg:FormatCondition Expression="[Tipo]>99" FieldName="{x:Null}">
|
||||||
|
<dxg:Format Foreground="Blue" />
|
||||||
|
</dxg:FormatCondition>
|
||||||
|
|
||||||
|
</dxg:TableView.FormatConditions>
|
||||||
|
</dxg:TableView>
|
||||||
|
</dxg:GridControl.View>
|
||||||
|
<tsWPFCore:tsGridControl.GroupSummary>
|
||||||
|
<dxg:GridSummaryItem SummaryType="Count" DisplayFormat="Nº Albaranes: {0:n0}" />
|
||||||
|
</tsWPFCore:tsGridControl.GroupSummary>
|
||||||
|
<tsWPFCore:tsGridControl.TotalSummary>
|
||||||
|
<dxg:GridSummaryItem SummaryType="Count" ShowInColumn="Cliente" DisplayFormat="Nº Albaranes: {0:n0}" />
|
||||||
|
</tsWPFCore:tsGridControl.TotalSummary>
|
||||||
|
</tsWPFCore:tsGridControl>
|
||||||
|
</dxlc:LayoutControl>
|
||||||
|
</Grid>
|
||||||
|
</tsWPFCore:tsUserControl>
|
||||||
208
GestionGrupoSanchoToro/Almacen/ucAlbaranes.xaml.vb
Normal file
208
GestionGrupoSanchoToro/Almacen/ucAlbaranes.xaml.vb
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
|
||||||
|
Imports bdGrupoSanchoToro.db
|
||||||
|
Imports DevExpress.Xpf.Core
|
||||||
|
Imports tsWPFCore
|
||||||
|
Imports System.Collections
|
||||||
|
Imports DevExpress.Xpf.Bars
|
||||||
|
Imports System.Threading.Tasks
|
||||||
|
Imports System.Linq.Dynamic
|
||||||
|
Imports bdGrupoSanchoToro.db.Utilidades
|
||||||
|
Imports bdGrupoSanchoToro.tscGrupoSanchoToro
|
||||||
|
Imports tsUtilidades
|
||||||
|
'Imports tsUtilidades.Extensiones
|
||||||
|
|
||||||
|
Public Class ucAlbaranes
|
||||||
|
|
||||||
|
Private bd As tscGrupoSanchoToro
|
||||||
|
Private _CamposBusquedaNumericos() As String = {"idAlbaran"}
|
||||||
|
Private _CamposBusquedaAlfabeticos() As String = {"RazonSocial", "NIF"}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Public Sub New()
|
||||||
|
|
||||||
|
' Esta llamada es exigida por el diseñador.
|
||||||
|
InitializeComponent()
|
||||||
|
' Me.BusquedaRapida.Visibility = Visibility.Collapsed
|
||||||
|
' Agregue cualquier inicialización después de la llamada a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Public Overrides Sub Cargado()
|
||||||
|
ContenedorAplicacion.btGuardar.IsVisible = False
|
||||||
|
ContenedorAplicacion.siEstado.IsVisible = False
|
||||||
|
GridBusqueda = Me.gc
|
||||||
|
'Dim Hoy = Date.Today
|
||||||
|
'teFechaFin.EditValue = Hoy
|
||||||
|
'teFechaInicio.EditValue = New Date(Hoy.Year, 1, 1)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Public Overrides Function EstablecedcPrincipal(Optional Background As Boolean = False, Optional FuerzaNuevo As Boolean = False, Optional Refrescar As Boolean = False) As tsUtilidades.EstadosAplicacion
|
||||||
|
Try
|
||||||
|
If cbTipos.ItemsSource Is Nothing Then
|
||||||
|
Dim tipos = tsUtilidades.DescripcionValor.EnumADescripcionValor(GetType(bdGrupoSanchoToro.db.albaranes.TipoAlbaranEnum))
|
||||||
|
cbTipos.ItemsSource = tipos
|
||||||
|
cbTipos.EditValue = tipos.Cast(Of DescripcionValor).Select(Function(x) x.Valor).ToList
|
||||||
|
End If
|
||||||
|
If Background OrElse Refrescar Then ObtieneAlbaranesAsync(bd, Background)
|
||||||
|
Return tsUtilidades.EstadosAplicacion.AplicacionSinIndice
|
||||||
|
Catch ex As Exception
|
||||||
|
Throw New Exception(ex.Message, ex)
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overrides Sub EstableceDataContextSecundarios(Optional Background As Boolean = False)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Overrides Sub EstableceTitulo()
|
||||||
|
Me.docpanel.Caption = "Albaranes"
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Overrides ReadOnly Property idRegistroAplicacionActual As String
|
||||||
|
Get
|
||||||
|
Return "Albaranes"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Overrides ReadOnly Property NombreTablaBase As String
|
||||||
|
Get
|
||||||
|
Return "albaranes"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Overrides ReadOnly Property DescripcionRegistro As String
|
||||||
|
Get
|
||||||
|
Return "Albaranes"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Overrides Function ObtieneBD() As tsUtilidades.ItsContexto
|
||||||
|
bd = tscGrupoSanchoToro.NuevoContexto()
|
||||||
|
Return bd
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Overrides Function ObtienePermisos() As tsUtilidades.Permisos
|
||||||
|
Return Comun.ObtienePermisos(Me.bd, "AP.ADMINISTRATIVOS", idUsuario)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Sub Nuevo() Handles Me.BotonNuevoPulsado
|
||||||
|
FuncionesDinamicas.AbrirAP(New ucAlbaran, OtrosParametros)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ap_Enlazar(Celda As DevExpress.Xpf.Grid.EditGridCellData, Defecto As Boolean) Handles Me.Enlazar
|
||||||
|
Dim ra = DirectCast(Me.gc.CurrentItem, v_albaranesextendidos)
|
||||||
|
If Defecto Then
|
||||||
|
Dim id As Integer = ra.idAlbaran
|
||||||
|
FuncionesDinamicas.AbrirAP(New ucAlbaran(id), OtrosParametros)
|
||||||
|
Else
|
||||||
|
Select Case Celda.Column.FieldName.ToLower
|
||||||
|
Case "numeroalbaran"
|
||||||
|
Dim id As Integer = ra.idAlbaran
|
||||||
|
FuncionesDinamicas.AbrirAP(New ucAlbaran(id), OtrosParametros)
|
||||||
|
Case "razonsocial"
|
||||||
|
Dim id As Integer = ra.idEntidad
|
||||||
|
FuncionesDinamicas.AbrirAP(New ucEntidad(id), OtrosParametros)
|
||||||
|
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Function ObtieneAlbaranes(TextoBusqueda As String, FechaInicio As DateOnly?, FechaFin As DateOnly?, Tipos As List(Of Integer)) As List(Of v_albaranesextendidos)
|
||||||
|
Dim rs As IQueryable(Of v_albaranesextendidos)
|
||||||
|
Dim la As New List(Of v_albaranesextendidos)
|
||||||
|
Dim iNumExc As Integer = 0
|
||||||
|
Do
|
||||||
|
Try
|
||||||
|
If TextoBusqueda <> "" Then
|
||||||
|
Dim parametros(0) As Object
|
||||||
|
Dim ExpresionBusqueda = tsWPFCore.Utilidades.Varias.GeneraExpresionBusqueda(TextoBusqueda, Me._CamposBusquedaNumericos, Me._CamposBusquedaAlfabeticos, Nothing)
|
||||||
|
rs = bd.v_albaranesextendidos.Where(ExpresionBusqueda)
|
||||||
|
Else
|
||||||
|
rs = bd.v_albaranesextendidos.AsQueryable
|
||||||
|
End If
|
||||||
|
|
||||||
|
If FechaInicio.HasValue Then
|
||||||
|
rs = rs.Where(Function(x) x.Fecha >= FechaInicio.Value)
|
||||||
|
End If
|
||||||
|
If FechaFin.HasValue Then
|
||||||
|
FechaFin = FechaFin.Value.AddDays(1)
|
||||||
|
rs = rs.Where(Function(x) x.Fecha < FechaFin.Value)
|
||||||
|
End If
|
||||||
|
la = rs.Where(Function(x) Tipos.Contains(x.Tipo)).OrderByDescending(Function(x) x.Fecha).ToList
|
||||||
|
Exit Do
|
||||||
|
Catch ex As Exception
|
||||||
|
iNumExc += 1
|
||||||
|
If iNumExc > 3 Then
|
||||||
|
FuncionesDinamicas.ErrorNoControladoAp(Me, ex)
|
||||||
|
|
||||||
|
rs = Nothing
|
||||||
|
Exit Do
|
||||||
|
End If
|
||||||
|
End Try
|
||||||
|
Loop
|
||||||
|
Return la
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Async Sub ObtieneAlbaranesAsync(bd As tscGrupoSanchoToro, Background As Boolean)
|
||||||
|
Try
|
||||||
|
Dim rs As New List(Of v_albaranesextendidos)
|
||||||
|
Dim Busqueda = tsEFCore8.Extensiones.ObjetoNothingAVacio(Me.teBusqueda.EditValue)
|
||||||
|
Dim fi As DateOnly? : If teFechaInicio.EditValue IsNot Nothing Then fi = DateOnly.FromDateTime(teFechaInicio.EditValue)
|
||||||
|
Dim ff As DateOnly? : If teFechaFin.EditValue IsNot Nothing Then ff = DateOnly.FromDateTime(teFechaFin.EditValue)
|
||||||
|
Dim Tipos = cbTipos.SelectedItems.Cast(Of DescripcionValor).Select(Function(x) x.Valor).ToList
|
||||||
|
If Background Then
|
||||||
|
Me.ContenedorAplicacion.IsEnabled = False
|
||||||
|
Await Task.Run(Sub()
|
||||||
|
rs = ObtieneAlbaranes(Busqueda, fi, ff, Tipos)
|
||||||
|
End Sub)
|
||||||
|
Else
|
||||||
|
If DXSplashScreen.IsActive = False Then DXSplashScreen.Show(Of tsWPFCore.SplashScreenTecnosis)()
|
||||||
|
DXSplashScreen.SetState("Buscando Albaranes de Entrega ...")
|
||||||
|
rs = ObtieneAlbaranes(Busqueda, fi, ff, Tipos)
|
||||||
|
End If
|
||||||
|
|
||||||
|
gc.ItemsSource = rs
|
||||||
|
DataContext = rs
|
||||||
|
Catch ex As Exception
|
||||||
|
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||||
|
DXMessageBox.Show(ex.Message, "Error")
|
||||||
|
Finally
|
||||||
|
Me.ContenedorAplicacion.IsEnabled = True
|
||||||
|
If DXSplashScreen.IsActive Then DXSplashScreen.Close()
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
Private Sub BtBuscar_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
ObtieneAlbaranesAsync(bd, False)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ucAlbaranes_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
teBusqueda.SelectAll()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub cbIncluirTodos_Checked(sender As Object, e As RoutedEventArgs)
|
||||||
|
Dim Hoy = Date.Today
|
||||||
|
If teFechaFin.EditValue Is Nothing Then teFechaFin.EditValue = Hoy
|
||||||
|
If teFechaInicio.EditValue Is Nothing Then teFechaInicio.EditValue = New Date(Hoy.Year, 1, 1)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles ImprimirPlantilla
|
||||||
|
' Dim ds As List(Of Albaranes)
|
||||||
|
' Dim pl As plantillas = (From p In bd.plantillas Where p.idPlantilla = idPlantilla).First
|
||||||
|
' Dim sTipo As String = pl.enumeraciones.Codigo
|
||||||
|
' Dim al As Albaranes = Me.DataContext
|
||||||
|
' ds = New List(Of Albaranes)
|
||||||
|
' ds.Add(al)
|
||||||
|
' Select Case sTipo
|
||||||
|
' Case "GRUPLA.AV-ALBARANES"
|
||||||
|
' Informes.ImprimirPlantilla(bd, idPlantilla, ds, False)
|
||||||
|
' End Select
|
||||||
|
'End Sub
|
||||||
|
End Class
|
||||||
@@ -414,7 +414,7 @@ Public Class ucFacturaRecibida
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles Me.ImprimirPlantilla
|
Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer, Previsualizar As Boolean) Handles Me.ImprimirPlantilla
|
||||||
Imprimir(idPlantilla, False, 1)
|
Imprimir(idPlantilla, False, 1)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Imprimir(idPlantilla As Integer, ImpresoraDefecto As Boolean, Copias As Integer)
|
Private Sub Imprimir(idPlantilla As Integer, ImpresoraDefecto As Boolean, Copias As Integer)
|
||||||
|
|||||||
@@ -39,12 +39,12 @@ Public Class ucProducto
|
|||||||
Else
|
Else
|
||||||
If Estado = tsUtilidades.EstadosAplicacion.Nuevo OrElse _idproducto Is Nothing OrElse FuerzaNuevo Then
|
If Estado = tsUtilidades.EstadosAplicacion.Nuevo OrElse _idproducto Is Nothing OrElse FuerzaNuevo Then
|
||||||
ra = New productos
|
ra = New productos
|
||||||
ra.TotalUnidades = 0
|
'ra.TotalUnidades = 0
|
||||||
ra.UnidadesVendidas = 0
|
'ra.UnidadesVendidas = 0
|
||||||
ra.UnidadesAlquiladas = 0
|
'ra.UnidadesAlquiladas = 0
|
||||||
ra.UnidadesAveriadas = 0
|
'ra.UnidadesAveriadas = 0
|
||||||
ra.UnidadesDesechadas = 0
|
'ra.UnidadesDesechadas = 0
|
||||||
ra.FacturarComoVentaPorDefecto = False
|
'ra.FacturarComoVentaPorDefecto = False
|
||||||
Me.DataContext = ra
|
Me.DataContext = ra
|
||||||
_idproducto = Nothing
|
_idproducto = Nothing
|
||||||
NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
|
NuevoEstado = tsUtilidades.EstadosAplicacion.Nuevo
|
||||||
@@ -56,7 +56,7 @@ Public Class ucProducto
|
|||||||
' Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ra.idProducto AndAlso x.Aplicacion = "PRODUCTOS").ToList
|
' Me.gcLogs.ItemsSource = bd.logs.Where(Function(x) x.id = ra.idProducto AndAlso x.Aplicacion = "PRODUCTOS").ToList
|
||||||
|
|
||||||
'Me.gcServicios.ItemsSource = ra.DesgloseServicios
|
'Me.gcServicios.ItemsSource = ra.DesgloseServicios
|
||||||
If ra.Tipo = TipoProductoEnum.PRODUCTO Then
|
If ra.Servicio Then
|
||||||
Me.gcStocksAlmacenes.ItemsSource = ObtieneISAlmacenes()
|
Me.gcStocksAlmacenes.ItemsSource = ObtieneISAlmacenes()
|
||||||
Else
|
Else
|
||||||
Me.gcStocksAlmacenes.ItemsSource = Nothing
|
Me.gcStocksAlmacenes.ItemsSource = Nothing
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
<PackageReference Include="System.ServiceModel.Federation" Version="8.1.0" />
|
<PackageReference Include="System.ServiceModel.Federation" Version="8.1.0" />
|
||||||
<PackageReference Include="TSpdf.commons" Version="1.0.1" />
|
<PackageReference Include="TSpdf.commons" Version="1.0.1" />
|
||||||
<PackageReference Include="TSpdfUtils" Version="1.0.15" />
|
<PackageReference Include="TSpdfUtils" Version="1.0.15" />
|
||||||
<PackageReference Include="tsWPFCore" Version="1.3.1" />
|
<PackageReference Include="tsWPFCore" Version="1.3.9" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -506,7 +506,7 @@ Public Class ucFacturaEmitida
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles Me.ImprimirPlantilla
|
Private Sub ap_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer, Previsualizar As Boolean) Handles Me.ImprimirPlantilla
|
||||||
Imprimir(idPlantilla, False, 1)
|
Imprimir(idPlantilla, False, 1)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Imprimir(idPlantilla As Integer, ImpresoraDefecto As Boolean, Copias As Integer)
|
Private Sub Imprimir(idPlantilla As Integer, ImpresoraDefecto As Boolean, Copias As Integer)
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ Public Class ucConciliacionBancaria
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ucConciliacionBancaria_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles Me.ImprimirPlantilla
|
Private Sub ucConciliacionBancaria_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer, Previsualizar As Boolean) Handles Me.ImprimirPlantilla
|
||||||
'Try
|
'Try
|
||||||
' Dim pl = bd.plantillas.First(Function(x) x.idPlantilla = idPlantilla)
|
' Dim pl = bd.plantillas.First(Function(x) x.idPlantilla = idPlantilla)
|
||||||
' Select Case pl.Codigo
|
' Select Case pl.Codigo
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ Public Class ucMovimientoCaja
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ucMovimientoCaja_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer) Handles Me.ImprimirPlantilla
|
Private Sub ucMovimientoCaja_ImprimirPlantilla(sender As Object, e As ItemClickEventArgs, idPlantilla As Integer, Previsualizar As Boolean) Handles Me.ImprimirPlantilla
|
||||||
Dim rec As movimientoscaja = Me.DataContext
|
Dim rec As movimientoscaja = Me.DataContext
|
||||||
|
|
||||||
Select Case DirectCast(rec.Tipo, TipoMovimientoEnum)
|
Select Case DirectCast(rec.Tipo, TipoMovimientoEnum)
|
||||||
|
|||||||
@@ -9,6 +9,6 @@
|
|||||||
"SegundosMinimosEntreProcesos": "60",
|
"SegundosMinimosEntreProcesos": "60",
|
||||||
"DirectorioLogs": "c:\\m3soft\\logs\\",
|
"DirectorioLogs": "c:\\m3soft\\logs\\",
|
||||||
"HoraProcesosDiarios": "06:30",
|
"HoraProcesosDiarios": "06:30",
|
||||||
"NombreConexionBD": "Producción VPN"
|
"NombreConexionBD": "Producción"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
61
bdGrupoSanchoToro/Importaciones/ImportaCTESGESL.cs
Normal file
61
bdGrupoSanchoToro/Importaciones/ImportaCTESGESL.cs
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
using Microsoft.VisualBasic;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace bdGrupoSanchoToro.Importaciones
|
||||||
|
{
|
||||||
|
public class ImportaCTESGESL
|
||||||
|
{
|
||||||
|
public static void Importar(byte[] Fichero)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var bd = tscGrupoSanchoToro.NuevoContexto();
|
||||||
|
var le = bd.enumeraciones.ToList();
|
||||||
|
var grs = bd.gruposenumeraciones.ToList();
|
||||||
|
var dsprueba = new XSD.CTESGESL();
|
||||||
|
|
||||||
|
dsprueba.ReadXml(new System.IO.MemoryStream(Fichero));
|
||||||
|
int i = 1;
|
||||||
|
int Ultimalinea = dsprueba.Tables["Datos"].Rows.Count;
|
||||||
|
foreach (XSD.CTESGESL.DatosRow Proant in dsprueba.Tables["Datos"].Rows)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bdGrupoSanchoToro.db.enumeraciones Pronue;
|
||||||
|
Pronue = le.FirstOrDefault(x => x.Codigo == Proant.LCCOD.Trim());
|
||||||
|
if (Pronue == null)
|
||||||
|
{
|
||||||
|
Pronue = new bdGrupoSanchoToro.db.enumeraciones();
|
||||||
|
bd.enumeraciones.Add(Pronue);
|
||||||
|
}
|
||||||
|
Pronue.Codigo = Proant.LCCOD.Trim();
|
||||||
|
int idgrupo = grs.First(x => x.Grupo == Proant.LCGRU.Trim()).idGrupoEnumeracion;
|
||||||
|
Pronue.idGrupoEnumeracion = idgrupo;
|
||||||
|
Pronue.ValorAlfabetico1 = Proant.LCDES.Trim();
|
||||||
|
Pronue.Descripcion = Proant.LCVAA.Trim();
|
||||||
|
Pronue.Orden = int.Parse(Proant.LCORD);
|
||||||
|
i = i + 1;
|
||||||
|
if (i > 1000)
|
||||||
|
{
|
||||||
|
bd.SaveChanges();
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception(ex.Message, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bd.SaveChanges();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception(ex.Message, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
57
bdGrupoSanchoToro/Importaciones/ImportaFAMILIAS.cs
Normal file
57
bdGrupoSanchoToro/Importaciones/ImportaFAMILIAS.cs
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
|
||||||
|
using bdGrupoSanchoToro.db;
|
||||||
|
using Microsoft.VisualBasic;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
namespace bdGrupoSanchoToro.Importaciones
|
||||||
|
|
||||||
|
{
|
||||||
|
public class ImportaFAMILIAS
|
||||||
|
{
|
||||||
|
public static void Importar(byte[] Fichero)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var bd = tscGrupoSanchoToro.NuevoContexto();
|
||||||
|
var ds = new XSD.FAMILIAS();
|
||||||
|
|
||||||
|
ds.ReadXml(new System.IO.MemoryStream(Fichero));
|
||||||
|
int Ultimalinea = ds.Tables["Datos"].Rows.Count;
|
||||||
|
var lf = bd.familias.ToList();
|
||||||
|
var fams = ds.Tables["Datos"].Rows.Cast<XSD.FAMILIAS.DatosRow>().ToList();
|
||||||
|
|
||||||
|
foreach (XSD.FAMILIAS.DatosRow fam in fams)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bdGrupoSanchoToro.db.familias f = lf.FirstOrDefault(x => x.Codigo == fam.FACOD);
|
||||||
|
if (f == null)
|
||||||
|
{
|
||||||
|
f = new familias()
|
||||||
|
{
|
||||||
|
Codigo = fam.FACOD
|
||||||
|
};
|
||||||
|
lf.Add(f);
|
||||||
|
bd.familias.Add(f);
|
||||||
|
}
|
||||||
|
f.Descripcion = fam.FADES;
|
||||||
|
f.CuentaContableCompra = fam.FACCC;
|
||||||
|
f.CuentaContableVenta = fam.FACCV;
|
||||||
|
f.CuentaContableVentaAlquiler = fam.FACCVA;
|
||||||
|
f.CuentaContableCompraAlquiler = fam.FACCCA;
|
||||||
|
bd.SaveChanges();
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception(ex.Message, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception(ex.Message, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,5 @@
|
|||||||
using bdGrupoSanchoToro.db;
|
using bdGrupoSanchoToro.db;
|
||||||
using Microsoft.VisualBasic;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics.Eventing.Reader;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Linq.Dynamic.Core;
|
using System.Linq.Dynamic.Core;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace bdGrupoSanchoToro.Importaciones
|
namespace bdGrupoSanchoToro.Importaciones
|
||||||
{
|
{
|
||||||
public class ImportaGRUASGC
|
public class ImportaGRUASGC
|
||||||
|
|||||||
130
bdGrupoSanchoToro/Importaciones/ImportaPRODUCTOS.cs
Normal file
130
bdGrupoSanchoToro/Importaciones/ImportaPRODUCTOS.cs
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
|
||||||
|
using bdGrupoSanchoToro.db;
|
||||||
|
using Microsoft.VisualBasic;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
using tsUtilidades.Extensiones;
|
||||||
|
|
||||||
|
namespace bdGrupoSanchoToro.Importaciones
|
||||||
|
|
||||||
|
{
|
||||||
|
public class ImportaPRODUCTOS
|
||||||
|
{
|
||||||
|
public static void Importar(byte[] Fichero)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var bd = tscGrupoSanchoToro.NuevoContexto();
|
||||||
|
var ds = new XSD.PRODUCTOS();
|
||||||
|
|
||||||
|
ds.ReadXml(new System.IO.MemoryStream(Fichero));
|
||||||
|
int Ultimalinea = ds.Tables["Datos"].Rows.Count;
|
||||||
|
var lp = bd.productos.ToList();
|
||||||
|
var lf = bd.familias.ToList();
|
||||||
|
var lm = bd.marcas.ToList();
|
||||||
|
var lfh = bd.enumeraciones.Where(x=> x.idGrupoEnumeracionNavigation.Grupo=="FAMH").ToList();
|
||||||
|
var pros = ds.Tables["Datos"].Rows.Cast<XSD.PRODUCTOS.DatosRow>().ToList();
|
||||||
|
|
||||||
|
foreach (XSD.PRODUCTOS.DatosRow pro in pros)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bdGrupoSanchoToro.db.productos p = lp.FirstOrDefault(x => x.Codigo == pro.PRCOD || x.DescripcionAbreviada.RemoveDiacritics() ==pro.PRDES.Trim().RemoveDiacritics().ToUpper() || x.Descripcion.RemoveDiacritics().ToUpper()==pro.PRDESL.Trim().RemoveDiacritics().ToUpper() );
|
||||||
|
if (p == null)
|
||||||
|
{
|
||||||
|
p = new productos()
|
||||||
|
{
|
||||||
|
Codigo = pro.PRCOD
|
||||||
|
};
|
||||||
|
lp.Add(p);
|
||||||
|
bd.productos.Add(p);
|
||||||
|
}
|
||||||
|
p.CodigoBarras = pro.PRCBR;
|
||||||
|
p.Descripcion = pro.PRDESL.Trim().RemoveDiacritics().ToUpper();
|
||||||
|
p.DescripcionAbreviada = pro.PRDES.Trim().RemoveDiacritics().ToUpper();
|
||||||
|
p.FechaAlta = DateOnly.FromDateTime(DateTime.Now);
|
||||||
|
familias? fam = bd.familias.FirstOrDefault(x => x.Codigo == pro.PRFAM);
|
||||||
|
p.idFamilia = fam == null ? null : fam.idFamilia;
|
||||||
|
if (pro.PRMAR.NothingAVacio() != "")
|
||||||
|
{
|
||||||
|
var mar = lm.FirstOrDefault(x => x.Marca == pro.PRMAR);
|
||||||
|
if (mar == null)
|
||||||
|
{
|
||||||
|
mar = new marcas()
|
||||||
|
{
|
||||||
|
Marca = pro.PRMAR
|
||||||
|
};
|
||||||
|
lm.Add(mar);
|
||||||
|
bd.marcas.Add(mar);
|
||||||
|
p.idMarcaNavigation = mar;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p.idMarca = null;
|
||||||
|
}
|
||||||
|
p.Modelo = pro.PRMDL;
|
||||||
|
p.Servicio = (pro.PRCFP=="AL" ? true : false);
|
||||||
|
p.idFamiliaHomologacion = null;
|
||||||
|
if (pro.PRFAMH!="")
|
||||||
|
{
|
||||||
|
var fh=lfh.FirstOrDefault(x=> x.Codigo==("FAMH." + pro.PRFAMH));
|
||||||
|
if (fh != null)
|
||||||
|
{
|
||||||
|
p.idFamiliaHomologacion = fh.idEnumeracion;
|
||||||
|
switch (fh.ValorAlfabetico1)
|
||||||
|
{
|
||||||
|
case "P":
|
||||||
|
{
|
||||||
|
p.Tipo = (int)productos.TipoProductoEnum.OTROS_PRODUCTOS;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "C":
|
||||||
|
{
|
||||||
|
p.Tipo = (int)productos.TipoProductoEnum.CONSUMIBLES;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "CG":
|
||||||
|
{
|
||||||
|
p.Tipo = (int)productos.TipoProductoEnum.ELEMENTO_GRUA;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "MO":
|
||||||
|
{
|
||||||
|
p.Tipo = (int)productos.TipoProductoEnum.MATERIAL_OFICINA;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "S":
|
||||||
|
{
|
||||||
|
p.Tipo = (int)productos.TipoProductoEnum.SERVICIO;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "R":
|
||||||
|
{
|
||||||
|
p.Tipo = (int)productos.TipoProductoEnum.REPUESTO;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
p.PrecioVenta = double.Parse(pro.PRPVP, CultureInfo.InvariantCulture);
|
||||||
|
p.ReferenciaFabrica = pro.PRRFA;
|
||||||
|
p.PrefijoNumeroSerie = pro.PRPNS;
|
||||||
|
bd.SaveChanges();
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception(ex.Message, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception(ex.Message, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,7 +16,12 @@ namespace bdGrupoSanchoToro.Importaciones
|
|||||||
tscGrupoSanchoToro bd = tscGrupoSanchoToro.NuevoContexto();
|
tscGrupoSanchoToro bd = tscGrupoSanchoToro.NuevoContexto();
|
||||||
|
|
||||||
//00
|
//00
|
||||||
Importa("GRUASGC", bdGrupoSanchoToro.Importaciones.ImportaGRUASGC.Importar, de); //00
|
//Importa("GRUASGC", bdGrupoSanchoToro.Importaciones.ImportaGRUASGC.Importar, de); //00
|
||||||
|
//Importa("FAMILIAS", bdGrupoSanchoToro.Importaciones.ImportaFAMILIAS.Importar, de); //00
|
||||||
|
//Importa("FAMILIAS", bdGrupoSanchoToro.Importaciones.ImportaFAMILIAS.Importar, de); //00
|
||||||
|
//Importa("CTESGESL", bdGrupoSanchoToro.Importaciones.ImportaCTESGESL.Importar, de); //00
|
||||||
|
Importa("PRODUCTOS", bdGrupoSanchoToro.Importaciones.ImportaPRODUCTOS.Importar, de); //00
|
||||||
|
|
||||||
//Importa("GRUPRO", bdGrupoSanchoToro.Importaciones.ImportaGrupoProductos.Importar, de); //01
|
//Importa("GRUPRO", bdGrupoSanchoToro.Importaciones.ImportaGrupoProductos.Importar, de); //01
|
||||||
//Importa("CAMPAÑAS", bdGrupoSanchoToro.Importaciones.ImportaCampañas.Importar, de); //02
|
//Importa("CAMPAÑAS", bdGrupoSanchoToro.Importaciones.ImportaCampañas.Importar, de); //02
|
||||||
//Importa("PRODUCTOS", bdGrupoSanchoToro.Importaciones.ImportaProductos.Importar, de); //03
|
//Importa("PRODUCTOS", bdGrupoSanchoToro.Importaciones.ImportaProductos.Importar, de); //03
|
||||||
@@ -70,11 +75,15 @@ namespace bdGrupoSanchoToro.Importaciones
|
|||||||
string Fichh = "/var/tecnosis/DATAXML/HISTORICO/" + Fichero + ".DATA";
|
string Fichh = "/var/tecnosis/DATAXML/HISTORICO/" + Fichero + ".DATA";
|
||||||
var sftp = ConfiguraFTPHP(bd);
|
var sftp = ConfiguraFTPHP(bd);
|
||||||
var st = new MemoryStream();
|
var st = new MemoryStream();
|
||||||
|
var std = new MemoryStream();
|
||||||
if (tsFluentFTP.ftp.ExisteFichero(Fich, sftp))
|
if (tsFluentFTP.ftp.ExisteFichero(Fich, sftp))
|
||||||
{
|
{
|
||||||
tsFluentFTP.ftp.DescargaFichero(Fich, st, sftp);
|
tsFluentFTP.ftp.DescargaFichero(Fich, st, sftp);
|
||||||
|
st.Seek(0, 0);
|
||||||
|
tsUtilidades.Ficheros.EliminaCaracteresInvalidosXML(st, std);
|
||||||
|
std.Seek(0, 0);
|
||||||
// tsFluentFTP.ftp.RenombraFichero(Fich,Fichh, sftp);
|
// tsFluentFTP.ftp.RenombraFichero(Fich,Fichh, sftp);
|
||||||
return st.ToArray();
|
return std.ToArray();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
773
bdGrupoSanchoToro/XSD/DAT-CTESGESL.Designer.cs
generated
Normal file
773
bdGrupoSanchoToro/XSD/DAT-CTESGESL.Designer.cs
generated
Normal file
@@ -0,0 +1,773 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Este código fue generado por una herramienta.
|
||||||
|
// Versión de runtime:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
|
||||||
|
// se vuelve a generar el código.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#pragma warning disable 1591
|
||||||
|
|
||||||
|
namespace bdGrupoSanchoToro.XSD {
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Represents a strongly typed in-memory cache of data.
|
||||||
|
///</summary>
|
||||||
|
[global::System.Serializable()]
|
||||||
|
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||||
|
[global::System.ComponentModel.ToolboxItem(true)]
|
||||||
|
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
|
||||||
|
[global::System.Xml.Serialization.XmlRootAttribute("CTESGESL")]
|
||||||
|
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
|
||||||
|
public partial class CTESGESL : global::System.Data.DataSet {
|
||||||
|
|
||||||
|
private DatosDataTable tableDatos;
|
||||||
|
|
||||||
|
private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public CTESGESL() {
|
||||||
|
this.BeginInit();
|
||||||
|
this.InitClass();
|
||||||
|
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
|
||||||
|
base.Tables.CollectionChanged += schemaChangedHandler;
|
||||||
|
base.Relations.CollectionChanged += schemaChangedHandler;
|
||||||
|
this.EndInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
[System.ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called" +
|
||||||
|
" or extended by application code.", DiagnosticId="SYSLIB0051")]
|
||||||
|
protected CTESGESL(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
|
||||||
|
base(info, context, false) {
|
||||||
|
if ((this.IsBinarySerialized(info, context) == true)) {
|
||||||
|
this.InitVars(false);
|
||||||
|
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
|
||||||
|
this.Tables.CollectionChanged += schemaChangedHandler1;
|
||||||
|
this.Relations.CollectionChanged += schemaChangedHandler1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
|
||||||
|
if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
|
||||||
|
global::System.Data.DataSet ds = new global::System.Data.DataSet();
|
||||||
|
ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
|
||||||
|
if ((ds.Tables["Datos"] != null)) {
|
||||||
|
base.Tables.Add(new DatosDataTable(ds.Tables["Datos"]));
|
||||||
|
}
|
||||||
|
this.DataSetName = ds.DataSetName;
|
||||||
|
this.Prefix = ds.Prefix;
|
||||||
|
this.Namespace = ds.Namespace;
|
||||||
|
this.Locale = ds.Locale;
|
||||||
|
this.CaseSensitive = ds.CaseSensitive;
|
||||||
|
this.EnforceConstraints = ds.EnforceConstraints;
|
||||||
|
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
|
||||||
|
this.InitVars();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
|
||||||
|
}
|
||||||
|
this.GetSerializationData(info, context);
|
||||||
|
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
|
||||||
|
base.Tables.CollectionChanged += schemaChangedHandler;
|
||||||
|
this.Relations.CollectionChanged += schemaChangedHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
[global::System.ComponentModel.Browsable(false)]
|
||||||
|
[global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
|
||||||
|
public DatosDataTable Datos {
|
||||||
|
get {
|
||||||
|
return this.tableDatos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
[global::System.ComponentModel.BrowsableAttribute(true)]
|
||||||
|
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
|
||||||
|
public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
|
||||||
|
get {
|
||||||
|
return this._schemaSerializationMode;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this._schemaSerializationMode = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||||
|
public new global::System.Data.DataTableCollection Tables {
|
||||||
|
get {
|
||||||
|
return base.Tables;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
|
||||||
|
public new global::System.Data.DataRelationCollection Relations {
|
||||||
|
get {
|
||||||
|
return base.Relations;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
protected override void InitializeDerivedDataSet() {
|
||||||
|
this.BeginInit();
|
||||||
|
this.InitClass();
|
||||||
|
this.EndInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public override global::System.Data.DataSet Clone() {
|
||||||
|
CTESGESL cln = ((CTESGESL)(base.Clone()));
|
||||||
|
cln.InitVars();
|
||||||
|
cln.SchemaSerializationMode = this.SchemaSerializationMode;
|
||||||
|
return cln;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
protected override bool ShouldSerializeTables() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
protected override bool ShouldSerializeRelations() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
|
||||||
|
if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
|
||||||
|
this.Reset();
|
||||||
|
global::System.Data.DataSet ds = new global::System.Data.DataSet();
|
||||||
|
ds.ReadXml(reader);
|
||||||
|
if ((ds.Tables["Datos"] != null)) {
|
||||||
|
base.Tables.Add(new DatosDataTable(ds.Tables["Datos"]));
|
||||||
|
}
|
||||||
|
this.DataSetName = ds.DataSetName;
|
||||||
|
this.Prefix = ds.Prefix;
|
||||||
|
this.Namespace = ds.Namespace;
|
||||||
|
this.Locale = ds.Locale;
|
||||||
|
this.CaseSensitive = ds.CaseSensitive;
|
||||||
|
this.EnforceConstraints = ds.EnforceConstraints;
|
||||||
|
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
|
||||||
|
this.InitVars();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.ReadXml(reader);
|
||||||
|
this.InitVars();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
|
||||||
|
global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
|
||||||
|
this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
|
||||||
|
stream.Position = 0;
|
||||||
|
return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
internal void InitVars() {
|
||||||
|
this.InitVars(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
internal void InitVars(bool initTable) {
|
||||||
|
this.tableDatos = ((DatosDataTable)(base.Tables["Datos"]));
|
||||||
|
if ((initTable == true)) {
|
||||||
|
if ((this.tableDatos != null)) {
|
||||||
|
this.tableDatos.InitVars();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
private void InitClass() {
|
||||||
|
this.DataSetName = "CTESGESL";
|
||||||
|
this.Prefix = "";
|
||||||
|
this.Locale = new global::System.Globalization.CultureInfo("en-US");
|
||||||
|
this.EnforceConstraints = true;
|
||||||
|
this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
|
||||||
|
this.tableDatos = new DatosDataTable();
|
||||||
|
base.Tables.Add(this.tableDatos);
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
private bool ShouldSerializeDatos() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
|
||||||
|
if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
|
||||||
|
this.InitVars();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
|
||||||
|
CTESGESL ds = new CTESGESL();
|
||||||
|
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
|
||||||
|
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
|
||||||
|
global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
|
||||||
|
any.Namespace = ds.Namespace;
|
||||||
|
sequence.Items.Add(any);
|
||||||
|
type.Particle = sequence;
|
||||||
|
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
|
||||||
|
if (xs.Contains(dsSchema.TargetNamespace)) {
|
||||||
|
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
|
||||||
|
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
|
||||||
|
try {
|
||||||
|
global::System.Xml.Schema.XmlSchema schema = null;
|
||||||
|
dsSchema.Write(s1);
|
||||||
|
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
|
||||||
|
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
|
||||||
|
s2.SetLength(0);
|
||||||
|
schema.Write(s2);
|
||||||
|
if ((s1.Length == s2.Length)) {
|
||||||
|
s1.Position = 0;
|
||||||
|
s2.Position = 0;
|
||||||
|
for (; ((s1.Position != s1.Length)
|
||||||
|
&& (s1.ReadByte() == s2.ReadByte())); ) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
if ((s1.Position == s1.Length)) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
if ((s1 != null)) {
|
||||||
|
s1.Close();
|
||||||
|
}
|
||||||
|
if ((s2 != null)) {
|
||||||
|
s2.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xs.Add(dsSchema);
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public delegate void DatosRowChangeEventHandler(object sender, DatosRowChangeEvent e);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Represents the strongly named DataTable class.
|
||||||
|
///</summary>
|
||||||
|
[global::System.Serializable()]
|
||||||
|
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
|
||||||
|
public partial class DatosDataTable : global::System.Data.TypedTableBase<DatosRow> {
|
||||||
|
|
||||||
|
private global::System.Data.DataColumn columnLCORD;
|
||||||
|
|
||||||
|
private global::System.Data.DataColumn columnLCGRU;
|
||||||
|
|
||||||
|
private global::System.Data.DataColumn columnLCCOD;
|
||||||
|
|
||||||
|
private global::System.Data.DataColumn columnLCDES;
|
||||||
|
|
||||||
|
private global::System.Data.DataColumn columnLCVAA;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public DatosDataTable() {
|
||||||
|
this.TableName = "Datos";
|
||||||
|
this.BeginInit();
|
||||||
|
this.InitClass();
|
||||||
|
this.EndInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
internal DatosDataTable(global::System.Data.DataTable table) {
|
||||||
|
this.TableName = table.TableName;
|
||||||
|
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
|
||||||
|
this.CaseSensitive = table.CaseSensitive;
|
||||||
|
}
|
||||||
|
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
|
||||||
|
this.Locale = table.Locale;
|
||||||
|
}
|
||||||
|
if ((table.Namespace != table.DataSet.Namespace)) {
|
||||||
|
this.Namespace = table.Namespace;
|
||||||
|
}
|
||||||
|
this.Prefix = table.Prefix;
|
||||||
|
this.MinimumCapacity = table.MinimumCapacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
[System.ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called" +
|
||||||
|
" or extended by application code.", DiagnosticId="SYSLIB0051")]
|
||||||
|
protected DatosDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
|
||||||
|
base(info, context) {
|
||||||
|
this.InitVars();
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public global::System.Data.DataColumn LCORDColumn {
|
||||||
|
get {
|
||||||
|
return this.columnLCORD;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public global::System.Data.DataColumn LCGRUColumn {
|
||||||
|
get {
|
||||||
|
return this.columnLCGRU;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public global::System.Data.DataColumn LCCODColumn {
|
||||||
|
get {
|
||||||
|
return this.columnLCCOD;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public global::System.Data.DataColumn LCDESColumn {
|
||||||
|
get {
|
||||||
|
return this.columnLCDES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public global::System.Data.DataColumn LCVAAColumn {
|
||||||
|
get {
|
||||||
|
return this.columnLCVAA;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
[global::System.ComponentModel.Browsable(false)]
|
||||||
|
public int Count {
|
||||||
|
get {
|
||||||
|
return this.Rows.Count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public DatosRow this[int index] {
|
||||||
|
get {
|
||||||
|
return ((DatosRow)(this.Rows[index]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public event DatosRowChangeEventHandler DatosRowChanging;
|
||||||
|
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public event DatosRowChangeEventHandler DatosRowChanged;
|
||||||
|
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public event DatosRowChangeEventHandler DatosRowDeleting;
|
||||||
|
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public event DatosRowChangeEventHandler DatosRowDeleted;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public void AddDatosRow(DatosRow row) {
|
||||||
|
this.Rows.Add(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public DatosRow AddDatosRow(string LCORD, string LCGRU, string LCCOD, string LCDES, string LCVAA) {
|
||||||
|
DatosRow rowDatosRow = ((DatosRow)(this.NewRow()));
|
||||||
|
object[] columnValuesArray = new object[] {
|
||||||
|
LCORD,
|
||||||
|
LCGRU,
|
||||||
|
LCCOD,
|
||||||
|
LCDES,
|
||||||
|
LCVAA};
|
||||||
|
rowDatosRow.ItemArray = columnValuesArray;
|
||||||
|
this.Rows.Add(rowDatosRow);
|
||||||
|
return rowDatosRow;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public override global::System.Data.DataTable Clone() {
|
||||||
|
DatosDataTable cln = ((DatosDataTable)(base.Clone()));
|
||||||
|
cln.InitVars();
|
||||||
|
return cln;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
protected override global::System.Data.DataTable CreateInstance() {
|
||||||
|
return new DatosDataTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
internal void InitVars() {
|
||||||
|
this.columnLCORD = base.Columns["LCORD"];
|
||||||
|
this.columnLCGRU = base.Columns["LCGRU"];
|
||||||
|
this.columnLCCOD = base.Columns["LCCOD"];
|
||||||
|
this.columnLCDES = base.Columns["LCDES"];
|
||||||
|
this.columnLCVAA = base.Columns["LCVAA"];
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
private void InitClass() {
|
||||||
|
this.columnLCORD = new global::System.Data.DataColumn("LCORD", typeof(string), null, global::System.Data.MappingType.Element);
|
||||||
|
base.Columns.Add(this.columnLCORD);
|
||||||
|
this.columnLCGRU = new global::System.Data.DataColumn("LCGRU", typeof(string), null, global::System.Data.MappingType.Element);
|
||||||
|
base.Columns.Add(this.columnLCGRU);
|
||||||
|
this.columnLCCOD = new global::System.Data.DataColumn("LCCOD", typeof(string), null, global::System.Data.MappingType.Element);
|
||||||
|
base.Columns.Add(this.columnLCCOD);
|
||||||
|
this.columnLCDES = new global::System.Data.DataColumn("LCDES", typeof(string), null, global::System.Data.MappingType.Element);
|
||||||
|
base.Columns.Add(this.columnLCDES);
|
||||||
|
this.columnLCVAA = new global::System.Data.DataColumn("LCVAA", typeof(string), null, global::System.Data.MappingType.Element);
|
||||||
|
base.Columns.Add(this.columnLCVAA);
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public DatosRow NewDatosRow() {
|
||||||
|
return ((DatosRow)(this.NewRow()));
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
|
||||||
|
return new DatosRow(builder);
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
protected override global::System.Type GetRowType() {
|
||||||
|
return typeof(DatosRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
|
||||||
|
base.OnRowChanged(e);
|
||||||
|
if ((this.DatosRowChanged != null)) {
|
||||||
|
this.DatosRowChanged(this, new DatosRowChangeEvent(((DatosRow)(e.Row)), e.Action));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
|
||||||
|
base.OnRowChanging(e);
|
||||||
|
if ((this.DatosRowChanging != null)) {
|
||||||
|
this.DatosRowChanging(this, new DatosRowChangeEvent(((DatosRow)(e.Row)), e.Action));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
|
||||||
|
base.OnRowDeleted(e);
|
||||||
|
if ((this.DatosRowDeleted != null)) {
|
||||||
|
this.DatosRowDeleted(this, new DatosRowChangeEvent(((DatosRow)(e.Row)), e.Action));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
|
||||||
|
base.OnRowDeleting(e);
|
||||||
|
if ((this.DatosRowDeleting != null)) {
|
||||||
|
this.DatosRowDeleting(this, new DatosRowChangeEvent(((DatosRow)(e.Row)), e.Action));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public void RemoveDatosRow(DatosRow row) {
|
||||||
|
this.Rows.Remove(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
|
||||||
|
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
|
||||||
|
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
|
||||||
|
CTESGESL ds = new CTESGESL();
|
||||||
|
global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
|
||||||
|
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
|
||||||
|
any1.MinOccurs = new decimal(0);
|
||||||
|
any1.MaxOccurs = decimal.MaxValue;
|
||||||
|
any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
|
||||||
|
sequence.Items.Add(any1);
|
||||||
|
global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
|
||||||
|
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
|
||||||
|
any2.MinOccurs = new decimal(1);
|
||||||
|
any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
|
||||||
|
sequence.Items.Add(any2);
|
||||||
|
global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
|
||||||
|
attribute1.Name = "namespace";
|
||||||
|
attribute1.FixedValue = ds.Namespace;
|
||||||
|
type.Attributes.Add(attribute1);
|
||||||
|
global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
|
||||||
|
attribute2.Name = "tableTypeName";
|
||||||
|
attribute2.FixedValue = "DatosDataTable";
|
||||||
|
type.Attributes.Add(attribute2);
|
||||||
|
type.Particle = sequence;
|
||||||
|
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
|
||||||
|
if (xs.Contains(dsSchema.TargetNamespace)) {
|
||||||
|
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
|
||||||
|
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
|
||||||
|
try {
|
||||||
|
global::System.Xml.Schema.XmlSchema schema = null;
|
||||||
|
dsSchema.Write(s1);
|
||||||
|
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
|
||||||
|
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
|
||||||
|
s2.SetLength(0);
|
||||||
|
schema.Write(s2);
|
||||||
|
if ((s1.Length == s2.Length)) {
|
||||||
|
s1.Position = 0;
|
||||||
|
s2.Position = 0;
|
||||||
|
for (; ((s1.Position != s1.Length)
|
||||||
|
&& (s1.ReadByte() == s2.ReadByte())); ) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
if ((s1.Position == s1.Length)) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
if ((s1 != null)) {
|
||||||
|
s1.Close();
|
||||||
|
}
|
||||||
|
if ((s2 != null)) {
|
||||||
|
s2.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xs.Add(dsSchema);
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Represents strongly named DataRow class.
|
||||||
|
///</summary>
|
||||||
|
public partial class DatosRow : global::System.Data.DataRow {
|
||||||
|
|
||||||
|
private DatosDataTable tableDatos;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
internal DatosRow(global::System.Data.DataRowBuilder rb) :
|
||||||
|
base(rb) {
|
||||||
|
this.tableDatos = ((DatosDataTable)(this.Table));
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public string LCORD {
|
||||||
|
get {
|
||||||
|
try {
|
||||||
|
return ((string)(this[this.tableDatos.LCORDColumn]));
|
||||||
|
}
|
||||||
|
catch (global::System.InvalidCastException e) {
|
||||||
|
throw new global::System.Data.StrongTypingException("El valor de la columna \'LCORD\' de la tabla \'Datos\' es DBNull.", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this[this.tableDatos.LCORDColumn] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public string LCGRU {
|
||||||
|
get {
|
||||||
|
try {
|
||||||
|
return ((string)(this[this.tableDatos.LCGRUColumn]));
|
||||||
|
}
|
||||||
|
catch (global::System.InvalidCastException e) {
|
||||||
|
throw new global::System.Data.StrongTypingException("El valor de la columna \'LCGRU\' de la tabla \'Datos\' es DBNull.", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this[this.tableDatos.LCGRUColumn] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public string LCCOD {
|
||||||
|
get {
|
||||||
|
try {
|
||||||
|
return ((string)(this[this.tableDatos.LCCODColumn]));
|
||||||
|
}
|
||||||
|
catch (global::System.InvalidCastException e) {
|
||||||
|
throw new global::System.Data.StrongTypingException("El valor de la columna \'LCCOD\' de la tabla \'Datos\' es DBNull.", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this[this.tableDatos.LCCODColumn] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public string LCDES {
|
||||||
|
get {
|
||||||
|
try {
|
||||||
|
return ((string)(this[this.tableDatos.LCDESColumn]));
|
||||||
|
}
|
||||||
|
catch (global::System.InvalidCastException e) {
|
||||||
|
throw new global::System.Data.StrongTypingException("El valor de la columna \'LCDES\' de la tabla \'Datos\' es DBNull.", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this[this.tableDatos.LCDESColumn] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public string LCVAA {
|
||||||
|
get {
|
||||||
|
try {
|
||||||
|
return ((string)(this[this.tableDatos.LCVAAColumn]));
|
||||||
|
}
|
||||||
|
catch (global::System.InvalidCastException e) {
|
||||||
|
throw new global::System.Data.StrongTypingException("El valor de la columna \'LCVAA\' de la tabla \'Datos\' es DBNull.", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this[this.tableDatos.LCVAAColumn] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public bool IsLCORDNull() {
|
||||||
|
return this.IsNull(this.tableDatos.LCORDColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public void SetLCORDNull() {
|
||||||
|
this[this.tableDatos.LCORDColumn] = global::System.Convert.DBNull;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public bool IsLCGRUNull() {
|
||||||
|
return this.IsNull(this.tableDatos.LCGRUColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public void SetLCGRUNull() {
|
||||||
|
this[this.tableDatos.LCGRUColumn] = global::System.Convert.DBNull;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public bool IsLCCODNull() {
|
||||||
|
return this.IsNull(this.tableDatos.LCCODColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public void SetLCCODNull() {
|
||||||
|
this[this.tableDatos.LCCODColumn] = global::System.Convert.DBNull;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public bool IsLCDESNull() {
|
||||||
|
return this.IsNull(this.tableDatos.LCDESColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public void SetLCDESNull() {
|
||||||
|
this[this.tableDatos.LCDESColumn] = global::System.Convert.DBNull;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public bool IsLCVAANull() {
|
||||||
|
return this.IsNull(this.tableDatos.LCVAAColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public void SetLCVAANull() {
|
||||||
|
this[this.tableDatos.LCVAAColumn] = global::System.Convert.DBNull;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Row event argument class
|
||||||
|
///</summary>
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public class DatosRowChangeEvent : global::System.EventArgs {
|
||||||
|
|
||||||
|
private DatosRow eventRow;
|
||||||
|
|
||||||
|
private global::System.Data.DataRowAction eventAction;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public DatosRowChangeEvent(DatosRow row, global::System.Data.DataRowAction action) {
|
||||||
|
this.eventRow = row;
|
||||||
|
this.eventAction = action;
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public DatosRow Row {
|
||||||
|
get {
|
||||||
|
return this.eventRow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
|
public global::System.Data.DataRowAction Action {
|
||||||
|
get {
|
||||||
|
return this.eventAction;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma warning restore 1591
|
||||||
1
bdGrupoSanchoToro/XSD/DAT-CTESGESL.xsc
Normal file
1
bdGrupoSanchoToro/XSD/DAT-CTESGESL.xsc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
20
bdGrupoSanchoToro/XSD/DAT-CTESGESL.xsd
Normal file
20
bdGrupoSanchoToro/XSD/DAT-CTESGESL.xsd
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<xs:schema id="CTESGESL" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xs:element name="CTESGESL" msdata:IsDataSet="true" msdata:Locale="en-US">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||||
|
<xs:element name="Datos">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="LCORD" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="LCGRU" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="LCCOD" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="LCDES" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="LCVAA" type="xs:string" minOccurs="0" />
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
1
bdGrupoSanchoToro/XSD/DAT-CTESGESL.xss
Normal file
1
bdGrupoSanchoToro/XSD/DAT-CTESGESL.xss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
1294
bdGrupoSanchoToro/XSD/DAT-FAMILIAS.Designer.cs
generated
Normal file
1294
bdGrupoSanchoToro/XSD/DAT-FAMILIAS.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
1
bdGrupoSanchoToro/XSD/DAT-FAMILIAS.xsc
Normal file
1
bdGrupoSanchoToro/XSD/DAT-FAMILIAS.xsc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
32
bdGrupoSanchoToro/XSD/DAT-FAMILIAS.xsd
Normal file
32
bdGrupoSanchoToro/XSD/DAT-FAMILIAS.xsd
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<xs:schema id="FAMILIAS" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xs:element name="FAMILIAS" msdata:IsDataSet="true" msdata:Locale="en-US">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||||
|
<xs:element name="Datos">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="FACOD" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FADES" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FAUSU" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FACCV" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FACCVA" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FACCC" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FACCCA" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FALA1" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FALA2" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FALA3" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FALA4" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FANL1" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FANL2" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FANL3" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FANL4" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FASIT" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="FAOBS" type="xs:string" minOccurs="0" />
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
1
bdGrupoSanchoToro/XSD/DAT-FAMILIAS.xss
Normal file
1
bdGrupoSanchoToro/XSD/DAT-FAMILIAS.xss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
3143
bdGrupoSanchoToro/XSD/DAT-PRODUCTOS.Designer.cs
generated
Normal file
3143
bdGrupoSanchoToro/XSD/DAT-PRODUCTOS.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
1
bdGrupoSanchoToro/XSD/DAT-PRODUCTOS.xsc
Normal file
1
bdGrupoSanchoToro/XSD/DAT-PRODUCTOS.xsc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
75
bdGrupoSanchoToro/XSD/DAT-PRODUCTOS.xsd
Normal file
75
bdGrupoSanchoToro/XSD/DAT-PRODUCTOS.xsd
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<xs:schema id="PRODUCTOS" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xs:element name="PRODUCTOS" msdata:IsDataSet="true" msdata:Locale="en-US">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||||
|
<xs:element name="Datos">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="PRCOD" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRDES" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRDESL" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRFAM" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRTHO" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRCFP" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRRFA" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRTPR" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRCBR" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PREXP" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRDPM" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRSER" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRPNS" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRUXE" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRPES" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRCI" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRMAR" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRMDL" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRVGU" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRPCM" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRUPC" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRPVP" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRDTO" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRFAMH" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PREXI1" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PREXI2" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PREXI3" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PREXI4" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PREXI5" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PREXI6" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRFUR1" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRFUR2" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRFUR3" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRFUR4" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRFUR5" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRFUR6" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRNMA1" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRNMA2" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRNMA3" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRNMA4" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRNMA5" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRNMA6" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PREXT" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRSMI" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PREXM" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRMGPA" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRMOPA" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRCOPA" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRUBI" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRCEA" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRAL1" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRAL2" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRAL3" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRAL4" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRNL1" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRNL2" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRNL3" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRNL4" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PRSIT" type="xs:string" minOccurs="0" />
|
||||||
|
<xs:element name="PROBS" type="xs:string" minOccurs="0" />
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
1
bdGrupoSanchoToro/XSD/DAT-PRODUCTOS.xss
Normal file
1
bdGrupoSanchoToro/XSD/DAT-PRODUCTOS.xss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -36,18 +36,45 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Update="XSD\DAT-CTESGESL.Designer.cs">
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>DAT-CTESGESL.xsd</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="XSD\DAT-FAMILIAS.Designer.cs">
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>DAT-FAMILIAS.xsd</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Update="XSD\DAT-GRUASGC.Designer.cs">
|
<Compile Update="XSD\DAT-GRUASGC.Designer.cs">
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DependentUpon>DAT-GRUASGC.xsd</DependentUpon>
|
<DependentUpon>DAT-GRUASGC.xsd</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Update="XSD\DAT-PRODUCTOS.Designer.cs">
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>DAT-PRODUCTOS.xsd</DependentUpon>
|
||||||
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Update="XSD\DAT-CTESGESL.xsd">
|
||||||
|
<Generator>MSDataSetGenerator</Generator>
|
||||||
|
<LastGenOutput>DAT-CTESGESL.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<None Update="XSD\DAT-FAMILIAS.xsd">
|
||||||
|
<Generator>MSDataSetGenerator</Generator>
|
||||||
|
<LastGenOutput>DAT-FAMILIAS.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
<None Update="XSD\DAT-GRUASGC.xsd">
|
<None Update="XSD\DAT-GRUASGC.xsd">
|
||||||
<Generator>MSDataSetGenerator</Generator>
|
<Generator>MSDataSetGenerator</Generator>
|
||||||
<LastGenOutput>DAT-GRUASGC.Designer.cs</LastGenOutput>
|
<LastGenOutput>DAT-GRUASGC.Designer.cs</LastGenOutput>
|
||||||
</None>
|
</None>
|
||||||
|
<None Update="XSD\DAT-PRODUCTOS.xsd">
|
||||||
|
<Generator>MSDataSetGenerator</Generator>
|
||||||
|
<LastGenOutput>DAT-PRODUCTOS.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public partial class productos
|
|||||||
|
|
||||||
public string Codigo { get; set; } = null!;
|
public string Codigo { get; set; } = null!;
|
||||||
|
|
||||||
public string? DescripcionAbreviada { get; set; }
|
public string DescripcionAbreviada { get; set; } = null!;
|
||||||
|
|
||||||
public string Descripcion { get; set; } = null!;
|
public string Descripcion { get; set; } = null!;
|
||||||
|
|
||||||
@@ -27,28 +27,16 @@ public partial class productos
|
|||||||
|
|
||||||
public string? CodigoBarras { get; set; }
|
public string? CodigoBarras { get; set; }
|
||||||
|
|
||||||
public string? NumeroSerie { get; set; }
|
|
||||||
|
|
||||||
public string? PrefijoNumeroSerie { get; set; }
|
public string? PrefijoNumeroSerie { get; set; }
|
||||||
|
|
||||||
public double? UnidadesPorEmbalaje { get; set; }
|
public double? UnidadesPorEmbalaje { get; set; }
|
||||||
|
|
||||||
public double Peso { get; set; }
|
public int? TipoImpresion { get; set; }
|
||||||
|
|
||||||
public int? idCodigoImpresion { get; set; }
|
|
||||||
|
|
||||||
public int? idMarca { get; set; }
|
public int? idMarca { get; set; }
|
||||||
|
|
||||||
public string? Modelo { get; set; }
|
public string? Modelo { get; set; }
|
||||||
|
|
||||||
public bool? VentaGruaUsada { get; set; }
|
|
||||||
|
|
||||||
public double? PrecioCosteMedio { get; set; }
|
|
||||||
|
|
||||||
public double? UltimoPrecioCoste { get; set; }
|
|
||||||
|
|
||||||
public double PrecioVenta { get; set; }
|
|
||||||
|
|
||||||
public DateOnly FechaAlta { get; set; }
|
public DateOnly FechaAlta { get; set; }
|
||||||
|
|
||||||
public DateTime? FechaBaja { get; set; }
|
public DateTime? FechaBaja { get; set; }
|
||||||
@@ -57,32 +45,38 @@ public partial class productos
|
|||||||
|
|
||||||
public int? idFamiliaHomologacion { get; set; }
|
public int? idFamiliaHomologacion { get; set; }
|
||||||
|
|
||||||
public double? ExistenciasTotal { get; set; }
|
|
||||||
|
|
||||||
public string? StockMinimo { get; set; }
|
|
||||||
|
|
||||||
public double? ExistenciasMedias { get; set; }
|
|
||||||
|
|
||||||
public string? ModeloGruaPatas { get; set; }
|
|
||||||
|
|
||||||
public string? ModelosPatas { get; set; }
|
|
||||||
|
|
||||||
public string? CorrespondenciaPatas { get; set; }
|
|
||||||
|
|
||||||
public string? Ubicacion { get; set; }
|
|
||||||
|
|
||||||
public string? ControlarEnAlbaran { get; set; }
|
|
||||||
|
|
||||||
public int? idUsuarioCreador { get; set; }
|
public int? idUsuarioCreador { get; set; }
|
||||||
|
|
||||||
public int? idUsuarioModificador { get; set; }
|
public int? idUsuarioModificador { get; set; }
|
||||||
|
|
||||||
public string? Observaciones { get; set; }
|
public string? Observaciones { get; set; }
|
||||||
|
|
||||||
public int idEmpresa { get; set; }
|
public int? idEmpresa { get; set; }
|
||||||
|
|
||||||
|
public double? UltimoPrecioCoste { get; set; }
|
||||||
|
|
||||||
public double? UltimoPrecioCompra { get; set; }
|
public double? UltimoPrecioCompra { get; set; }
|
||||||
|
|
||||||
|
public double TotalUnidades { get; set; }
|
||||||
|
|
||||||
|
public double UnidadesInicialesOFabricadas { get; set; }
|
||||||
|
|
||||||
|
public double UnidadesCompradas { get; set; }
|
||||||
|
|
||||||
|
public double UnidadesVendidas { get; set; }
|
||||||
|
|
||||||
|
public double UnidadesAlquiladas { get; set; }
|
||||||
|
|
||||||
|
public double UnidadesAveriadas { get; set; }
|
||||||
|
|
||||||
|
public double UnidadesDesechadas { get; set; }
|
||||||
|
|
||||||
|
public double UnidadesSubAlquiladas { get; set; }
|
||||||
|
|
||||||
|
public double? PrecioAlquilerMensual { get; set; }
|
||||||
|
|
||||||
|
public double? PrecioVenta { get; set; }
|
||||||
|
|
||||||
public virtual ICollection<articulos> articulos { get; set; } = new List<articulos>();
|
public virtual ICollection<articulos> articulos { get; set; } = new List<articulos>();
|
||||||
|
|
||||||
public virtual ICollection<detallepresupuesto> detallepresupuesto { get; set; } = new List<detallepresupuesto>();
|
public virtual ICollection<detallepresupuesto> detallepresupuesto { get; set; } = new List<detallepresupuesto>();
|
||||||
@@ -93,7 +87,7 @@ public partial class productos
|
|||||||
|
|
||||||
public virtual ICollection<detallesfacturasrecibidas> detallesfacturasrecibidas { get; set; } = new List<detallesfacturasrecibidas>();
|
public virtual ICollection<detallesfacturasrecibidas> detallesfacturasrecibidas { get; set; } = new List<detallesfacturasrecibidas>();
|
||||||
|
|
||||||
public virtual empresas idEmpresaNavigation { get; set; } = null!;
|
public virtual empresas? idEmpresaNavigation { get; set; }
|
||||||
|
|
||||||
public virtual familias? idFamiliaNavigation { get; set; }
|
public virtual familias? idFamiliaNavigation { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -2056,6 +2056,8 @@ public partial class GrupoSanchoToroContext : DbContext
|
|||||||
|
|
||||||
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
||||||
|
|
||||||
|
entity.HasIndex(e => e.DescripcionAbreviada, "DescripcionAbreviada_UNIQUE").IsUnique();
|
||||||
|
|
||||||
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
||||||
|
|
||||||
entity.HasIndex(e => e.idUsuarioCreador, "productos_01_usuarios_idx");
|
entity.HasIndex(e => e.idUsuarioCreador, "productos_01_usuarios_idx");
|
||||||
@@ -2070,8 +2072,6 @@ public partial class GrupoSanchoToroContext : DbContext
|
|||||||
|
|
||||||
entity.Property(e => e.Codigo).HasMaxLength(40);
|
entity.Property(e => e.Codigo).HasMaxLength(40);
|
||||||
entity.Property(e => e.CodigoBarras).HasMaxLength(16);
|
entity.Property(e => e.CodigoBarras).HasMaxLength(16);
|
||||||
entity.Property(e => e.ControlarEnAlbaran).HasMaxLength(2);
|
|
||||||
entity.Property(e => e.CorrespondenciaPatas).HasMaxLength(45);
|
|
||||||
entity.Property(e => e.Descripcion)
|
entity.Property(e => e.Descripcion)
|
||||||
.HasMaxLength(100)
|
.HasMaxLength(100)
|
||||||
.UseCollation("latin1_swedish_ci")
|
.UseCollation("latin1_swedish_ci")
|
||||||
@@ -2079,20 +2079,17 @@ public partial class GrupoSanchoToroContext : DbContext
|
|||||||
entity.Property(e => e.DescripcionAbreviada).HasMaxLength(45);
|
entity.Property(e => e.DescripcionAbreviada).HasMaxLength(45);
|
||||||
entity.Property(e => e.FechaBaja).HasColumnType("datetime");
|
entity.Property(e => e.FechaBaja).HasColumnType("datetime");
|
||||||
entity.Property(e => e.Modelo).HasMaxLength(50);
|
entity.Property(e => e.Modelo).HasMaxLength(50);
|
||||||
entity.Property(e => e.ModeloGruaPatas).HasMaxLength(45);
|
|
||||||
entity.Property(e => e.ModelosPatas).HasMaxLength(45);
|
|
||||||
entity.Property(e => e.NumeroSerie).HasMaxLength(2);
|
|
||||||
entity.Property(e => e.Observaciones)
|
entity.Property(e => e.Observaciones)
|
||||||
.HasMaxLength(300)
|
.HasMaxLength(300)
|
||||||
.UseCollation("latin1_swedish_ci")
|
.UseCollation("latin1_swedish_ci")
|
||||||
.HasCharSet("latin1");
|
.HasCharSet("latin1");
|
||||||
|
entity.Property(e => e.PrecioVenta).HasDefaultValueSql("'0'");
|
||||||
entity.Property(e => e.PrefijoNumeroSerie).HasMaxLength(8);
|
entity.Property(e => e.PrefijoNumeroSerie).HasMaxLength(8);
|
||||||
entity.Property(e => e.ReferenciaFabrica).HasMaxLength(45);
|
entity.Property(e => e.ReferenciaFabrica).HasMaxLength(45);
|
||||||
entity.Property(e => e.StockMinimo).HasMaxLength(45);
|
|
||||||
entity.Property(e => e.Ubicacion).HasMaxLength(45);
|
|
||||||
|
|
||||||
entity.HasOne(d => d.idEmpresaNavigation).WithMany(p => p.productos)
|
entity.HasOne(d => d.idEmpresaNavigation).WithMany(p => p.productos)
|
||||||
.HasForeignKey(d => d.idEmpresa)
|
.HasForeignKey(d => d.idEmpresa)
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.HasConstraintName("productos_empresas");
|
.HasConstraintName("productos_empresas");
|
||||||
|
|
||||||
entity.HasOne(d => d.idFamiliaNavigation).WithMany(p => p.productos)
|
entity.HasOne(d => d.idFamiliaNavigation).WithMany(p => p.productos)
|
||||||
|
|||||||
@@ -4,15 +4,18 @@
|
|||||||
"ContextNamespace": null,
|
"ContextNamespace": null,
|
||||||
"FilterSchemas": false,
|
"FilterSchemas": false,
|
||||||
"IncludeConnectionString": false,
|
"IncludeConnectionString": false,
|
||||||
"MinimumProductVersion": "2.6.1186",
|
"IrregularWords": null,
|
||||||
|
"MinimumProductVersion": "2.6.1301",
|
||||||
"ModelNamespace": null,
|
"ModelNamespace": null,
|
||||||
"OutputContextPath": "dbcontext",
|
"OutputContextPath": "dbcontext",
|
||||||
"OutputPath": "db",
|
"OutputPath": "db",
|
||||||
|
"PluralRules": null,
|
||||||
"PreserveCasingWithRegex": true,
|
"PreserveCasingWithRegex": true,
|
||||||
"ProjectRootNamespace": "bdGrupoSanchoToro",
|
"ProjectRootNamespace": "bdGrupoSanchoToro",
|
||||||
"Schemas": null,
|
"Schemas": null,
|
||||||
"SelectedHandlebarsLanguage": 2,
|
"SelectedHandlebarsLanguage": 2,
|
||||||
"SelectedToBeGenerated": 0,
|
"SelectedToBeGenerated": 0,
|
||||||
|
"SingularRules": null,
|
||||||
"T4TemplatePath": null,
|
"T4TemplatePath": null,
|
||||||
"Tables": [
|
"Tables": [
|
||||||
{
|
{
|
||||||
|
|||||||
185
bdGrupoSanchoToro/extensiones/albaranes.cs
Normal file
185
bdGrupoSanchoToro/extensiones/albaranes.cs
Normal file
@@ -0,0 +1,185 @@
|
|||||||
|
using System;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using static bdGrupoSanchoToro.db.almacenes;
|
||||||
|
using Microsoft.VisualBasic.CompilerServices;
|
||||||
|
using static tsUtilidades.Extensiones.StringExtensions;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
|
namespace bdGrupoSanchoToro.db
|
||||||
|
{
|
||||||
|
|
||||||
|
public partial class albaranes :INotifyPropertyChanged
|
||||||
|
{
|
||||||
|
public municipios? municipios
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.CodigoMunicipioCargaNavigation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public municipios? municipios1
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.CodigoMunicipioDescargaNavigation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public presupuestos? presupuestos
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.idPresupuestoNavigation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public entidades? entidades
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.idEntidadNavigation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public usuarios usuarios
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.idUsuarioNavigation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Entidad
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.idEntidad.HasValue)
|
||||||
|
{
|
||||||
|
return this.entidades.RazonSocial;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string DescripcionTipoAlbaran
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ((TipoAlbaranEnum)this.Tipo).ToString().Replace("_", " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string NumeroAlbaran
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return albaranes.ObtieneNumeroAlbaran(this.idAlbaran, (PrefijoAlbaranEnum)this.Tipo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public event PropertyChangedEventHandler? PropertyChanged;
|
||||||
|
|
||||||
|
public static string ObtieneNumeroAlbaran(int idAlbaran, PrefijoAlbaranEnum Tipo)
|
||||||
|
{
|
||||||
|
return Tipo.ToString() + "-" + idAlbaran.ToString().PadLeft(6, '0');
|
||||||
|
}
|
||||||
|
public string Usuario
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.usuarios is null)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.usuarios.Nombre;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string PoblacionCarga
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Conversions.ToString(municipios.ObtienePoblacion(this.CodigoMunicipioCarga));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string PoblacionDescarga
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Conversions.ToString(municipios.ObtienePoblacion(this.CodigoMunicipioDescarga));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ProvinciaCarga
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.municipios!=null && !string.IsNullOrEmpty(this.CodigoMunicipioCarga.NothingAVacio()))
|
||||||
|
{
|
||||||
|
return this.municipios.provincias.Nombre;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string ProvinciaDescarga
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.municipios1 != null && !string.IsNullOrEmpty(this.CodigoMunicipioDescarga.NothingAVacio()))
|
||||||
|
{
|
||||||
|
return this.municipios1.provincias.Nombre;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void RefrescaCamposSoloLectura()
|
||||||
|
{
|
||||||
|
this.OnPropertyChanged("PoblacionCarga");
|
||||||
|
this.OnPropertyChanged("PoblacionDescarga");
|
||||||
|
this.OnPropertyChanged("ProvinciaCarga");
|
||||||
|
this.OnPropertyChanged("ProvinciaDescarga");
|
||||||
|
this.OnPropertyChanged("CodigoPostalCarga");
|
||||||
|
this.OnPropertyChanged("CodigoPostalDescarga");
|
||||||
|
}
|
||||||
|
protected void OnPropertyChanged([CallerMemberName] string name = null)
|
||||||
|
{
|
||||||
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
|
||||||
|
}
|
||||||
|
public enum TipoAlbaranEnum : int
|
||||||
|
{
|
||||||
|
ENTREGA = 0,
|
||||||
|
RECOGIDA = 1,
|
||||||
|
CAMBIO_ALMACEN = 2,
|
||||||
|
SUBALQUILER = 3,
|
||||||
|
DEVOLUCION_SUBALQUILER = 4,
|
||||||
|
STOCK_INICIAL_O_FABRICACION = 100,
|
||||||
|
COMPRA = 101
|
||||||
|
}
|
||||||
|
public enum PrefijoAlbaranEnum : int
|
||||||
|
{
|
||||||
|
AENT = 0,
|
||||||
|
AREC = 1,
|
||||||
|
ACMA = 2,
|
||||||
|
ASBA = 3,
|
||||||
|
ADSA = 4,
|
||||||
|
ASIOF = 100,
|
||||||
|
ACMP = 101
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum TipoImpresionAlbaranEntregaEnum : int
|
||||||
|
{
|
||||||
|
IMPRIMIR_CONTRATO = 0,
|
||||||
|
IMPRIMIR_ALBARAN_NO_VALORADO = 1,
|
||||||
|
IMPRIMIR_ALBARAN_VALORADO = 2,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
188
bdGrupoSanchoToro/extensiones/detallesalbaranes.cs
Normal file
188
bdGrupoSanchoToro/extensiones/detallesalbaranes.cs
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using static bdGrupoSanchoToro.db.productos;
|
||||||
|
|
||||||
|
namespace bdGrupoSanchoToro.db
|
||||||
|
{
|
||||||
|
|
||||||
|
public partial class detallesalbaranes
|
||||||
|
{
|
||||||
|
//public albaranes albaranes
|
||||||
|
//{
|
||||||
|
// get
|
||||||
|
// {
|
||||||
|
// return this.idAlbaranNavigation;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
public string NumeroAlbaran
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.idAlbaranNavigation.NumeroAlbaran;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public DateOnly FechaAlbaran
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.idAlbaranNavigation.Fecha;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string AlmacenOrigen
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.idAlbaranNavigation.idAlmacenOrigen.HasValue)
|
||||||
|
{
|
||||||
|
return this.idAlbaranNavigation.idAlmacenOrigenNavigation.Descripcion;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string AlmacenDestino
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (idAlbaranNavigation.idAlmacenDestino.HasValue)
|
||||||
|
{
|
||||||
|
return idAlbaranNavigation.idAlmacenDestinoNavigation.Descripcion;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string Entidad
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.idAlbaranNavigation.Entidad;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void ActualizaProducto(bdGrupoSanchoToro.dbcontext.GrupoSanchoToroContext bd, int Factor)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var pr = bd.productos.First(x => x.idProducto == this.idProducto);
|
||||||
|
if (pr.Tipo != (int)TipoProductoEnum.SERVICIO )
|
||||||
|
{
|
||||||
|
var almo = this.idAlbaranNavigation.idAlmacenOrigen.HasValue ? bd.almacenes.First(x => x.idAlmacen== idAlbaranNavigation.idAlmacenOrigen) : (almacenes)null;
|
||||||
|
var almd = this.idAlbaranNavigation.idAlmacenDestino.HasValue ? bd.almacenes.First(x => x.idAlmacen == this.idAlbaranNavigation.idAlmacenDestino) : (almacenes)null;
|
||||||
|
switch ((albaranes.TipoAlbaranEnum)this.idAlbaranNavigation.Tipo)
|
||||||
|
{
|
||||||
|
case albaranes.TipoAlbaranEnum.COMPRA:
|
||||||
|
case albaranes.TipoAlbaranEnum.STOCK_INICIAL_O_FABRICACION:
|
||||||
|
{
|
||||||
|
this.ActStockPorAlmacen(bd, Factor, almd.idAlmacen, pr.idProducto);
|
||||||
|
pr.UnidadesInicialesOFabricadas += this.Cantidad * (double)Factor;
|
||||||
|
this.ActStockGlobal(pr, (almacenes.TipoAlmacenEnum)almd.Tipo, true, Factor);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case albaranes.TipoAlbaranEnum.CAMBIO_ALMACEN:
|
||||||
|
{
|
||||||
|
this.ActStockPorAlmacen(bd, Factor * -1, almo.idAlmacen, pr.idProducto);
|
||||||
|
this.ActStockGlobal(pr, (almacenes.TipoAlmacenEnum)almo.Tipo, false, Factor * -1);
|
||||||
|
|
||||||
|
this.ActStockPorAlmacen(bd, Factor, almd.idAlmacen, pr.idProducto);
|
||||||
|
this.ActStockGlobal(pr, (almacenes.TipoAlmacenEnum)almd.Tipo, false, Factor);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case albaranes.TipoAlbaranEnum.ENTREGA:
|
||||||
|
{
|
||||||
|
this.ActStockPorAlmacen(bd, Factor * -1, almo.idAlmacen, pr.idProducto);
|
||||||
|
this.ActStockGlobal(pr, (almacenes.TipoAlmacenEnum)almo.Tipo, this.EsVenta, Factor * -1);
|
||||||
|
if (this.EsVenta == false)
|
||||||
|
{
|
||||||
|
pr.UnidadesAlquiladas += this.Cantidad * (double)Factor;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pr.UnidadesVendidas += this.Cantidad * (double)Factor;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case albaranes.TipoAlbaranEnum.RECOGIDA:
|
||||||
|
{
|
||||||
|
this.ActStockPorAlmacen(bd, Factor, almd.idAlmacen, pr.idProducto);
|
||||||
|
this.ActStockGlobal(pr, (almacenes.TipoAlmacenEnum)almd.Tipo, false, Factor);
|
||||||
|
pr.UnidadesAlquiladas += this.Cantidad * (double)Factor * (double)-1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case albaranes.TipoAlbaranEnum.SUBALQUILER:
|
||||||
|
{
|
||||||
|
this.ActStockPorAlmacen(bd, Factor, almd.idAlmacen, pr.idProducto);
|
||||||
|
this.ActStockGlobal(pr, (almacenes.TipoAlmacenEnum)almd.Tipo, true, Factor);
|
||||||
|
pr.UnidadesSubAlquiladas += this.Cantidad * (double)Factor;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case albaranes.TipoAlbaranEnum.DEVOLUCION_SUBALQUILER:
|
||||||
|
{
|
||||||
|
this.ActStockPorAlmacen(bd, Factor * -1, almo.idAlmacen, pr.idProducto);
|
||||||
|
this.ActStockGlobal(pr, (almacenes.TipoAlmacenEnum)almo.Tipo, true, Factor * -1);
|
||||||
|
pr.UnidadesSubAlquiladas += this.Cantidad * (double)Factor * (double)-1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// bd.SaveChanges()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception(ex.Message, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ActStockPorAlmacen(bdGrupoSanchoToro.dbcontext.GrupoSanchoToroContext bd, int Factor, int idAlmacen, int idProducto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var st = bd.stocks.FirstOrDefault(x => x.idProducto == idProducto && x.idAlmacen == idAlmacen);
|
||||||
|
if (st is null)
|
||||||
|
{
|
||||||
|
st = new stocks();
|
||||||
|
st.idProducto = idProducto;
|
||||||
|
st.idAlmacen = idAlmacen;
|
||||||
|
st.Unidades = 0d;
|
||||||
|
bd.stocks.Add(st);
|
||||||
|
}
|
||||||
|
st.Unidades += this.Cantidad * (double)Factor;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception(ex.Message, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void ActStockGlobal(productos pr, almacenes.TipoAlmacenEnum TipoAlmacen, bool ActTotalUnidades, int Factor)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
switch (TipoAlmacen)
|
||||||
|
{
|
||||||
|
// Case almacenes.TipoAlmacenEnum.ALMACEN
|
||||||
|
case almacenes.TipoAlmacenEnum.TALLER_REPARACIONES:
|
||||||
|
{
|
||||||
|
pr.UnidadesAveriadas += this.Cantidad * (double)Factor;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case almacenes.TipoAlmacenEnum.UNIDADES_DESCARTADAS:
|
||||||
|
{
|
||||||
|
pr.UnidadesDesechadas += this.Cantidad * (double)Factor;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ActTotalUnidades)
|
||||||
|
pr.TotalUnidades += this.Cantidad * (double)Factor;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception(ex.Message, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -46,8 +46,9 @@ namespace bdGrupoSanchoToro.db
|
|||||||
GRUA = 0,
|
GRUA = 0,
|
||||||
ELEMENTO_GRUA = 1,
|
ELEMENTO_GRUA = 1,
|
||||||
REPUESTO =10,
|
REPUESTO =10,
|
||||||
OTRO_MATERIAL = 11,
|
OTROS_PRODUCTOS = 11,
|
||||||
MATERIAL_OFICINA = 12,
|
CONSUMIBLES =12,
|
||||||
|
MATERIAL_OFICINA = 13,
|
||||||
SERVICIO = 99,
|
SERVICIO = 99,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user