20260129 - 01
This commit is contained in:
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,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user