public CatVehiculoModels EliminarVehiculo(CatVehiculoModels datos) { try { object[] parametros = { datos.IDVehiculo, datos.Usuario }; object Resultado = SqlHelper.ExecuteScalar(datos.Conexion, "spCSLDB_Catalogo_del_CatVehiculo", parametros); if (Resultado != null) { if (!string.IsNullOrEmpty(datos.IDVehiculo)) { datos.Completado = true; } else { datos.Completado = false; } return(datos); } return(datos); } catch (Exception ex) { throw ex; } }
public List <CatSucursalesModels> ObtenerSucursalesXIDEmpresa(CatVehiculoModels Datos) { try { CatSucursalesModels item; SqlDataReader dr = null; object[] parametro = { Datos.IDEmpresa }; dr = SqlHelper.ExecuteReader(Datos.Conexion, "spCSLDB_Combo_get_SucursalesXIDEmpresa", parametro); while (dr.Read()) { item = new CatSucursalesModels(); item.IDSucursal = !dr.IsDBNull(dr.GetOrdinal("IDSucursal")) ? dr.GetString(dr.GetOrdinal("IDSucursal")) : string.Empty; item.NombreSucursal = !dr.IsDBNull(dr.GetOrdinal("NombreSucursal")) ? dr.GetString(dr.GetOrdinal("NombreSucursal")) : string.Empty; Datos.listaSucursal.Add(item); } dr.Close(); return(Datos.listaSucursal); } catch (Exception ex) { throw ex; } }
public CatVehiculoModels ObtenerListaVehiculos(CatVehiculoModels datos) { try { List <CatVehiculoModels> Lista = new List <CatVehiculoModels>(); CatVehiculoModels Item; SqlDataReader dr = null; dr = SqlHelper.ExecuteReader(datos.Conexion, "spCSLDB_Catalogo_get_CatVehiculo"); while (dr.Read()) { Item = new CatVehiculoModels(); Item.IDVehiculo = !dr.IsDBNull(dr.GetOrdinal("id_vehiculo")) ? dr.GetString(dr.GetOrdinal("id_vehiculo")) : string.Empty; Item.nombreTipoVehiculo = !dr.IsDBNull(dr.GetOrdinal("tipoVehiculo")) ? dr.GetString(dr.GetOrdinal("tipoVehiculo")) : string.Empty; Item.nombreMarca = !dr.IsDBNull(dr.GetOrdinal("marca")) ? dr.GetString(dr.GetOrdinal("marca")) : string.Empty; Item.nombreSucursal = !dr.IsDBNull(dr.GetOrdinal("nombreSuc")) ? dr.GetString(dr.GetOrdinal("nombreSuc")) : string.Empty; Item.EsPropio = !dr.IsDBNull(dr.GetOrdinal("propio")) ? dr.GetBoolean(dr.GetOrdinal("propio")) : false; Item.NoSerie = !dr.IsDBNull(dr.GetOrdinal("noSerie")) ? dr.GetString(dr.GetOrdinal("noSerie")) : string.Empty; Item.Estatus = !dr.IsDBNull(dr.GetOrdinal("estatus")) ? dr.GetBoolean(dr.GetOrdinal("estatus")) : false; Item.nombreVehiculo = !dr.IsDBNull(dr.GetOrdinal("nombreVehiculo")) ? dr.GetString(dr.GetOrdinal("nombreVehiculo")) : string.Empty; Lista.Add(Item); } dr.Close(); datos.listaVehiculos = Lista; return(datos); } catch (Exception ex) { throw ex; } }
public FleteModels() { Cliente = new CatClienteModels(); Chofer = new CatChoferModels(); Vehiculo = new CatVehiculoModels(); Empresa = new CatEmpresaModels(); Jaula = new CatJaulaModels(); Remolque = new CatRemolqueModels(); Trayecto = new TrayectoModels(); FormaPago = new CFDI_FormaPagoModels(); MetodoPago = new CFDI_MetodoPagoModels(); RespuestaAjax = new RespuestaAjax(); FechaTentativaEntrega = DateTime.Now; Documentos = new Flete_TipoDocumentoModels(); }
public ServiciosMantenimientoModels ObtenerDatosIndex(string Conexion, string IdSucursal) { try { ServiciosMantenimientoModels Result = new ServiciosMantenimientoModels(); //Obtener el listado de vehículos DataSet Ds = SqlHelper.ExecuteDataset(Conexion, "spCSLDB_Mantenimiento_get_IndexServicios", IdSucursal); if (Ds != null) { if (Ds.Tables.Count == 1) { DataTableReader Dr01 = Ds.Tables[0].CreateDataReader(); List <CatVehiculoModels> ListaV = new List <CatVehiculoModels>(); CatVehiculoModels ItemV; while (Dr01.Read()) { ItemV = new CatVehiculoModels(); ItemV.IDVehiculo = !Dr01.IsDBNull(Dr01.GetOrdinal("IDVehiculo")) ? Dr01.GetString(Dr01.GetOrdinal("IDVehiculo")) : string.Empty; ItemV.Modelo = !Dr01.IsDBNull(Dr01.GetOrdinal("Descripcion")) ? Dr01.GetString(Dr01.GetOrdinal("Descripcion")) : string.Empty; ItemV.DateLastService = !Dr01.IsDBNull(Dr01.GetOrdinal("LastDate")) ? Dr01.GetDateTime(Dr01.GetOrdinal("LastDate")) : DateTime.MinValue; ListaV.Add(ItemV); } Dr01.Close(); //Obtener el listado de remolques //DataTableReader Dr02 = Ds.Tables[1].CreateDataReader(); //List<CatRemolqueModels> ListaR = new List<CatRemolqueModels>(); //CatRemolqueModels ItemR; //while (Dr02.Read()) //{ // ItemR = new CatRemolqueModels(); // ItemR.IDRemolque = !Dr02.IsDBNull(Dr02.GetOrdinal("IDRemolque")) ? Dr02.GetString(Dr02.GetOrdinal("IDRemolque")) : string.Empty; // ItemR.placa = !Dr02.IsDBNull(Dr02.GetOrdinal("Descripcion")) ? Dr02.GetString(Dr02.GetOrdinal("Descripcion")) : string.Empty; // ItemR.DateLastService = !Dr02.IsDBNull(Dr02.GetOrdinal("LastDate")) ? Dr02.GetDateTime(Dr02.GetOrdinal("LastDate")) : DateTime.MinValue; // ListaR.Add(ItemR); //} // Asignar listas a objeto principal y retornar Result.ListaVehiculos = ListaV; //Result.ListaRemolques = ListaR; } } return(Result); } catch (Exception ex) { throw ex; } }
public ServiciosMantenimientoModels() { _IDServicio = string.Empty; _Sucursal = new CatSucursalesModels(); _Vehiculo = new CatVehiculoModels(); _Fecha = DateTime.MinValue; _FechaProxima = DateTime.MinValue; _ServiciosRealizados = string.Empty; _ImporteTotal = 0; _CssClassEstatus = string.Empty; _Estatus = string.Empty; _IDEstatus = 0; _ListaRemolques = new List <CatRemolqueModels>(); _ListaVehiculos = new List <CatVehiculoModels>(); _ListaDetalle = new List <ServiciosMantenimientoDetalleModels>(); }
public CatVehiculoModels AcCatVehiculo(CatVehiculoModels datos) { try { object[] parametros = { datos.Opcion, datos.IDVehiculo ?? string.Empty, datos.IDSucursal ?? string.Empty, datos.IDTipoVehiculo, datos.IDMarca, datos.EsPropio, datos.Gps, datos.Capacidad ?? string.Empty, datos.Modelo ?? string.Empty, datos.Color ?? string.Empty, datos.Placas ?? string.Empty, datos.NoSerie ?? string.Empty, datos.Estatus, datos.numeroUnidad ?? string.Empty, datos.img64 ?? string.Empty, datos.BandImg, datos.tarjetaCirculacion ?? string.Empty, datos.fechaIngreso != null ? datos.fechaIngreso : DateTime.Today, datos.Usuario ?? string.Empty, datos.IDEmpresa ?? string.Empty, datos.PlacaJaula ?? string.Empty, datos.EsJaula, datos.ColorJaula }; object Resultado = SqlHelper.ExecuteScalar(datos.Conexion, "spCSLDB_Catalogo_ac_CatVehiculo", parametros); datos.IDVehiculo = Resultado.ToString(); if (!string.IsNullOrEmpty(datos.IDVehiculo)) { datos.Completado = true; } else { datos.Completado = false; } return(datos); } catch (Exception ex) { throw ex; } }
public void GetListadoVehiculos() { if (!string.IsNullOrEmpty(Vehiculo.IDVehiculo)) { var item = ListaVehiculos.FirstOrDefault(v => v.IDVehiculo == Vehiculo.IDVehiculo); if (item == null) { ListaVehiculos.Add(Vehiculo); ListaVehiculos = ListaVehiculos.OrderBy(v => v.nombreMarca).ToList(); } } CatVehiculoModels vPredeterminado = new CatVehiculoModels { IDVehiculo = string.Empty, nombreMarca = "SELECCIONE UN VEHICULOS", Modelo = "GRUPO OCAMPO" }; ListaVehiculos.Insert(0, vPredeterminado); }
public CatVehiculoModels ObtenerDetalleCatVehiculo(CatVehiculoModels datos) { try { object[] parametros = { datos.IDVehiculo }; SqlDataReader dr = null; dr = SqlHelper.ExecuteReader(datos.Conexion, "spCSLDB_Catalogo_get_CatVehiculoXID", parametros); while (dr.Read()) { // datos.IDVehiculo = !dr.IsDBNull(dr.GetOrdinal("IDTipoVehiculo")) ? dr.GetInt16(dr.GetOrdinal("IDTipoVehiculo")) : 0; datos.IDVehiculo = !dr.IsDBNull(dr.GetOrdinal("id_vehiculo")) ? dr.GetString(dr.GetOrdinal("id_vehiculo")) : string.Empty; datos.IDTipoVehiculo = !dr.IsDBNull(dr.GetOrdinal("id_tipoVehiculo")) ? dr.GetInt16(dr.GetOrdinal("id_tipoVehiculo")) : 0; datos.IDSucursal = !dr.IsDBNull(dr.GetOrdinal("id_sucursal")) ? dr.GetString(dr.GetOrdinal("id_sucursal")) : string.Empty; datos.IDMarca = !dr.IsDBNull(dr.GetOrdinal("id_marca")) ? dr.GetInt16(dr.GetOrdinal("id_marca")) : 0; datos.EsPropio = !dr.IsDBNull(dr.GetOrdinal("propio")) ? dr.GetBoolean(dr.GetOrdinal("propio")) : false; datos.Gps = !dr.IsDBNull(dr.GetOrdinal("gps")) ? dr.GetString(dr.GetOrdinal("gps")) : string.Empty; datos.Capacidad = !dr.IsDBNull(dr.GetOrdinal("capacidad")) ? dr.GetString(dr.GetOrdinal("capacidad")) : string.Empty; datos.Modelo = !dr.IsDBNull(dr.GetOrdinal("modelo")) ? dr.GetString(dr.GetOrdinal("modelo")) : string.Empty; datos.Color = !dr.IsDBNull(dr.GetOrdinal("color")) ? dr.GetString(dr.GetOrdinal("color")) : string.Empty; datos.Placas = !dr.IsDBNull(dr.GetOrdinal("placas")) ? dr.GetString(dr.GetOrdinal("placas")) : string.Empty; datos.numeroUnidad = !dr.IsDBNull(dr.GetOrdinal("numeroUnidad")) ? dr.GetString(dr.GetOrdinal("numeroUnidad")) : string.Empty; datos.NoSerie = !dr.IsDBNull(dr.GetOrdinal("noSerie")) ? dr.GetString(dr.GetOrdinal("noSerie")) : string.Empty; datos.Estatus = !dr.IsDBNull(dr.GetOrdinal("estatus")) ? dr.GetBoolean(dr.GetOrdinal("estatus")) : false; datos.img64 = !dr.IsDBNull(dr.GetOrdinal("imagen")) ? dr.GetString(dr.GetOrdinal("imagen")) : string.Empty; datos.tarjetaCirculacion = !dr.IsDBNull(dr.GetOrdinal("tarjetaCirculacion")) ? dr.GetString(dr.GetOrdinal("tarjetaCirculacion")) : string.Empty; datos.fechaIngreso = !dr.IsDBNull(dr.GetOrdinal("fechaIngreso")) ? dr.GetDateTime(dr.GetOrdinal("fechaIngreso")) : DateTime.Now; datos.IDEmpresa = !dr.IsDBNull(dr.GetOrdinal("id_empresa")) ? dr.GetString(dr.GetOrdinal("id_empresa")) : string.Empty; datos.PlacaJaula = !dr.IsDBNull(dr.GetOrdinal("placaJaula")) ? dr.GetString(dr.GetOrdinal("placaJaula")) : string.Empty; datos.ColorJaula = !dr.IsDBNull(dr.GetOrdinal("colorJaula")) ? dr.GetString(dr.GetOrdinal("colorJaula")) : string.Empty; datos.EsJaula = !dr.IsDBNull(dr.GetOrdinal("esJaula")) ? dr.GetBoolean(dr.GetOrdinal("esJaula")) : false; } dr.Close(); return(datos); } catch (Exception ex) { throw ex; } }
public List <CatVehiculoModels> ObtenerComboVehiculosPrincp(string Conexion) { try { List <CatVehiculoModels> Lista = new List <CatVehiculoModels>(); CatVehiculoModels Item; SqlDataReader Dr = SqlHelper.ExecuteReader(Conexion, "spCSLDB_Combo_get_CatVehiculoEntregaCombustible"); while (Dr.Read()) { Item = new CatVehiculoModels(); Item.IDVehiculo = !Dr.IsDBNull(Dr.GetOrdinal("id_vehiculo")) ? Dr.GetString(Dr.GetOrdinal("id_vehiculo")) : string.Empty; Item.Modelo = !Dr.IsDBNull(Dr.GetOrdinal("Descripcion")) ? Dr.GetString(Dr.GetOrdinal("Descripcion")) : string.Empty; Lista.Add(Item); } Dr.Close(); return(Lista); } catch (Exception ex) { throw ex; } }
public List <CatEmpresaModels> obtenerListaEmpresas(CatVehiculoModels Datos) { try { CatEmpresaModels item; SqlDataReader dr = null; dr = SqlHelper.ExecuteReader(Datos.Conexion, "spCSLDB_Combo_get_CatEmpresa"); while (dr.Read()) { item = new CatEmpresaModels(); item.IDEmpresa = dr["IDEmpresa"].ToString(); item.RazonFiscal = dr["NombreEmpresa"].ToString(); Datos.ListaEmpresas.Add(item); } dr.Close(); return(Datos.ListaEmpresas); } catch (Exception ex) { throw ex; } }
public List <CatMarcaVehiculoModels> obtenerListaMarcas(CatVehiculoModels Datos) { try { List <CatMarcaVehiculoModels> lista = new List <CatMarcaVehiculoModels>(); CatMarcaVehiculoModels item; SqlDataReader dr = null; dr = SqlHelper.ExecuteReader(Datos.Conexion, "spCSLDB_get_ComboMarcaVehiculo"); while (dr.Read()) { item = new CatMarcaVehiculoModels(); item.IDMarca = Convert.ToInt32(dr["id_marca"].ToString()); item.Descripcion = dr["descripcion"].ToString(); lista.Add(item); } dr.Close(); return(lista); } catch (Exception ex) { throw ex; } }
public List <CatSucursalesModels> obtenerListaSucursales(CatVehiculoModels Datos) { try { List <CatSucursalesModels> lista = new List <CatSucursalesModels>(); CatSucursalesModels item; SqlDataReader dr = null; dr = SqlHelper.ExecuteReader(Datos.Conexion, "spCSLDB_Combo_get_CatSucursal"); while (dr.Read()) { item = new CatSucursalesModels(); item.IDSucursal = dr["IDSucursal"].ToString(); item.NombreSucursal = dr["NombreSucursal"].ToString(); lista.Add(item); } dr.Close(); return(lista); } catch (Exception ex) { throw ex; } }
public List <CatVehiculoModels> Dbo_spCSLDB_Combo_get_CatVehiculosAll(string Conexion) { try { List <CatVehiculoModels> Lista = new List <CatVehiculoModels>(); CatVehiculoModels Item; SqlDataReader dr = SqlHelper.ExecuteReader(Conexion, "dbo.spCSLDB_Combo_get_CatVehiculosAll"); while (dr.Read()) { Item = new CatVehiculoModels(); Item.IDVehiculo = !dr.IsDBNull(dr.GetOrdinal("IDVehiculo")) ? dr.GetString(dr.GetOrdinal("IDVehiculo")) : string.Empty; Item.nombreMarca = !dr.IsDBNull(dr.GetOrdinal("NombreVehiculo")) ? dr.GetString(dr.GetOrdinal("NombreVehiculo")) : string.Empty; Item.Modelo = !dr.IsDBNull(dr.GetOrdinal("Tipo")) ? dr.GetString(dr.GetOrdinal("Tipo")) : string.Empty; Lista.Add(Item); } dr.Close(); return(Lista); } catch (Exception ex) { throw ex; } }
//Constructor public CompraModels() { //Inicializamos los objetos Chofer = new CatChoferModels(); CompraGanado = new CompraGanadosModels(); EstatusGanado = new CatEstatusGanadoModels(); Fierro = new CatFierroModels(); Flete = new FleteModels(); FormaPago = new CFDI_FormaPagoModels(); Ganado = new GanadosModels(); Jaula = new CatJaulaModels(); Lugar = new CatLugarModels(); Marca = new CatMarcaVehiculoModels(); Proveedor = new CatProveedorModels(); Remolque = new CatRemolqueModels(); RespuestaAjax = new RespuestaAjax(); Sucursal = new CatSucursalesModels(); Trayecto = new TrayectoModels(); TipoVehiculo = new CatTipoVehiculoModels(); TipoClasificacion = new CatTipoClasificacionModels(); Vehiculo = new CatVehiculoModels(); //Inicializamos las listas ListaChoferes = new List <CatChoferModels>(); ListaCostoFlete = new List <CatCostoFlete>(); ListaCompraGanado = new List <CompraGanadosModels>(); ListaEmpresas = new List <CatEmpresaModels>(); ListaFierros = new List <CatFierroModels>(); ListaFormasPagos = new List <CFDI_FormaPagoModels>(); ListaGanados = new List <GanadosModels>(); ListaJaulas = new List <CatJaulaModels>(); ListaLugares = new List <CatLugarModels>(); ListaLugaresProveedor = new List <CatLugarModels>(); ListaProveedores = new List <CatProveedorModels>(); ListaRemolques = new List <CatRemolqueModels>(); ListaSucursales = new List <CatSucursalesModels>(); ListaVehiculos = new List <CatVehiculoModels>(); ListaGeneroGanado = new List <GeneroGanadoModels>(); ListaTipoClasificacion = new List <CatTipoClasificacionModels>(); //Valores predeterminados de los atributos IDChofer = string.Empty; IDCompra = string.Empty; IDDocumentoXPagar = string.Empty; IDCostoFlete = 0; IDEmpresa = string.Empty; IDFlete = string.Empty; IDJaula = string.Empty; IDPLugarProveedor = string.Empty; IDProveedor = string.Empty; IDRecepcion = string.Empty; IDRemolque = string.Empty; IDSucursal = string.Empty; IDUsuario = string.Empty; IDVehiculo = string.Empty; Conexion = string.Empty; Estatus = -1; FechaHoraProgramada = DateTime.Now; FechaHoraTerminada = DateTime.Now; GanadosCompradoMachos = 0; GanadosCompradoHembras = 0; GanadosCompradoTotal = 0; GanadosPactadoMachos = 0; GanadosPactadoHembras = 0; GanadosPactadoTotal = 0; KilosTotal = 0; Completado = false; Mensaje = string.Empty; Usuario = string.Empty; }