185 lines
4.8 KiB
C#
185 lines
4.8 KiB
C#
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,
|
|
ENTREGA_DESDE_OBRA = 1,
|
|
RECOGIDA = 2,
|
|
CAMBIO_ALMACEN = 3,
|
|
SUBALQUILER = 4,
|
|
DEVOLUCION_SUBALQUILER = 5,
|
|
REGULARIZACION_STOCK = 100,
|
|
FABRICACION = 101,
|
|
COMPRA = 102
|
|
}
|
|
public enum PrefijoAlbaranEnum : int
|
|
{
|
|
AE = 0,
|
|
AEO =1,
|
|
AR = 2,
|
|
ACA = 3,
|
|
AS = 4,
|
|
ADS = 5,
|
|
ARS = 100,
|
|
AF = 101,
|
|
AC = 102
|
|
|
|
}
|
|
|
|
|
|
}
|
|
} |