Esempio n. 1
0
 public List <CatChoferModels> ObtenerCatChofer(CatChoferModels Datos)
 {
     try
     {
         List <CatChoferModels> lista = new List <CatChoferModels>();
         CatChoferModels        item;
         SqlDataReader          dr = null;
         dr = SqlHelper.ExecuteReader(Datos.Conexion, "EM_spCSLDB_get_Chofer");
         while (dr.Read())
         {
             item          = new CatChoferModels();
             item.IDChofer = dr["IDChofer"].ToString();
             item.Nombre   = dr["NombreChofer"].ToString();
             item.Licencia = Convert.ToBoolean(dr["Licencia"].ToString());
             item.Estatus  = Convert.ToBoolean(dr["Estatus"].ToString());
             lista.Add(item);
         }
         dr.Close();
         return(lista);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 2
0
 public List <CatSucursalesModels> ObtenerSucursalesXIDEmpresa(CatChoferModels 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.listaSucursales.Add(item);
         }
         dr.Close();
         return(Datos.listaSucursales);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 3
0
 public CatChoferModels EliminarChofer(CatChoferModels datos)
 {
     try
     {
         object[] parametros =
         {
             datos.IDChofer, datos.Usuario
         };
         object aux = SqlHelper.ExecuteScalar(datos.Conexion, "spCSLDB_Catalogo_del_CatChofer", parametros);
         datos.IDChofer = aux.ToString();
         if (!string.IsNullOrEmpty(datos.IDChofer))
         {
             datos.Completado = true;
         }
         else
         {
             datos.Completado = false;
         }
         return(datos);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 4
0
 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();
 }
Esempio n. 5
0
 public CatChoferModels AbcCatChofer(CatChoferModels datos)
 {
     try
     {
         object[] parametros =
         {
             datos.Opcion,
             datos.IDChofer ?? string.Empty,
             datos.Nombre ?? string.Empty,
             datos.ApPaterno ?? string.Empty,
             datos.ApMaterno ?? string.Empty,
             datos.Licencia,                                                        datos.numLicencia ?? string.Empty,
             datos.vigencia != null ? datos.FechaIngreso : DateTime.Today,
             datos.Ife ?? string.Empty,
             datos.idgruposanguineo,
             datos.IDSucursal ?? string.Empty,
             datos.IDGenero,
             datos.NumSeguroSocial ?? string.Empty,
             datos.AvisoAccidente ?? string.Empty,
             datos.TelefonoAccidente ?? string.Empty,
             datos.Telefono ?? string.Empty,
             datos.Movil ?? string.Empty,
             datos.FechaNacimiento != null ? datos.FechaNacimiento : DateTime.Today,
             datos.FechaIngreso != null ? datos.FechaIngreso : DateTime.Today,
             datos.Usuario ?? string.Empty,
             datos.IDEmpresa ?? string.Empty
         };
         object aux = SqlHelper.ExecuteScalar(datos.Conexion, "EM_spCSLDB_abc_Chofer", parametros);
         datos.IDChofer = aux.ToString();
         if (!string.IsNullOrEmpty(datos.IDChofer))
         {
             datos.Completado = true;
         }
         else
         {
             datos.Completado = false;
         }
         return(datos);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 6
0
        public void GetListaChoferes()
        {
            if (!string.IsNullOrEmpty(Chofer.IDChofer))
            {
                var item = ListaChoferes.FirstOrDefault(c => c.IDChofer == Chofer.IDChofer);
                if (item == null)
                {
                    ListaChoferes.Add(Chofer);
                    ListaChoferes = ListaChoferes.OrderBy(c => c.Nombre).ToList();
                }
            }

            CatChoferModels cPredeterminado = new CatChoferModels
            {
                IDChofer = string.Empty,
                Nombre   = "SELECCIONE UN CHOFER",
            };

            ListaChoferes.Insert(0, cPredeterminado);
        }
Esempio n. 7
0
 public List <CatEmpresaModels> ObteneComboCatEmpresa(CatChoferModels 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.IsDBNull(dr.GetOrdinal("IDEmpresa")) ? dr.GetString(dr.GetOrdinal("IDEmpresa")) : string.Empty;
             item.RazonFiscal = !dr.IsDBNull(dr.GetOrdinal("NombreEmpresa")) ? dr.GetString(dr.GetOrdinal("NombreEmpresa")) : string.Empty;
             Datos.ListaEmpresas.Add(item);
         }
         dr.Close();
         return(Datos.ListaEmpresas);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 //-------------------------------------------------------------inicio----------------------------------------
 public List <CatChoferModels> obtenerChofer(string Conexion, string IDSucursal)
 {
     try
     {
         List <CatChoferModels> Lista = new List <CatChoferModels>();
         CatChoferModels        Item;
         SqlDataReader          Dr = SqlHelper.ExecuteReader(Conexion, "[dbo].[spCSLDB_Combo_get_CatChoferesXSucursal]", IDSucursal);
         while (Dr.Read())
         {
             Item          = new CatChoferModels();
             Item.IDChofer = !Dr.IsDBNull(Dr.GetOrdinal("IDChofer")) ? Dr.GetString(Dr.GetOrdinal("IDChofer")) : string.Empty;
             Item.Nombre   = !Dr.IsDBNull(Dr.GetOrdinal("NombreCompleto")) ? Dr.GetString(Dr.GetOrdinal("NombreCompleto")) : string.Empty;
             Lista.Add(Item);
         }
         Dr.Close();
         return(Lista);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 9
0
        public CatChoferModels ObtenerDetalleCatChofer(CatChoferModels datos)
        {
            try
            {
                object[]      parametros = { datos.IDChofer };
                SqlDataReader dr         = null;
                dr = SqlHelper.ExecuteReader(datos.Conexion, "EM_spCSLDB_get_ChoferXID", parametros);
                while (dr.Read())
                {
                    datos.IDChofer          = dr["IDChofer"].ToString();
                    datos.Nombre            = dr["Nombre"].ToString();
                    datos.ApPaterno         = dr["ApPaterno"].ToString();
                    datos.ApMaterno         = dr["ApMaterno"].ToString();
                    datos.Licencia          = dr.GetBoolean(dr.GetOrdinal("Licencia"));
                    datos.numLicencia       = dr["numLicencia"].ToString();
                    datos.vigencia          = dr.GetDateTime(dr.GetOrdinal("vigencia"));
                    datos.Ife               = dr["ife"].ToString();
                    datos.idgruposanguineo  = Convert.ToInt32(dr["id_grupoSanguineo"].ToString());
                    datos.IDGenero          = Convert.ToInt32(dr["id_genero"].ToString());
                    datos.NumSeguroSocial   = dr["numSeguroSocial"].ToString();
                    datos.AvisoAccidente    = dr["avisoAccidente"].ToString();
                    datos.TelefonoAccidente = dr["telefonoAccidente"].ToString();
                    datos.Telefono          = dr["telefono"].ToString();
                    datos.Movil             = dr["movil"].ToString();
                    datos.FechaIngreso      = dr.GetDateTime(dr.GetOrdinal("fechaIngreso"));
                    datos.IDSucursal        = dr["id_sucursal"].ToString();
                    datos.FechaNacimiento   = dr.GetDateTime(dr.GetOrdinal("fechaNacimiento"));
                    datos.IDEmpresa         = dr["id_empresa"].ToString();
                }
                dr.Close();
                return(datos);
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 10
0
 public List <CatSucursalesModels> ObteneComboCatSucursal(CatChoferModels Datos)
 {
     try
     {
         List <CatSucursalesModels> lista = new List <CatSucursalesModels>();
         CatSucursalesModels        item;
         SqlDataReader dr = null;
         dr = SqlHelper.ExecuteReader(Datos.Conexion, "spCSLDB_Combo_get_CatSucursal");
         //lista.Add(new CatSucursalesModels { IDSucursal = string.Empty, NombreSucursal = " - Seleccione -" });
         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;
             lista.Add(item);
         }
         dr.Close();
         return(lista);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 11
0
 public List <CatGrupoSanguineoModels> ObteneComboCatGrupoSanguineo(CatChoferModels Datos)
 {
     try
     {
         List <CatGrupoSanguineoModels> lista = new List <CatGrupoSanguineoModels>();
         CatGrupoSanguineoModels        item;
         SqlDataReader dr = null;
         dr = SqlHelper.ExecuteReader(Datos.Conexion, "spCSLDB_Combo_get_CatGrupoSanguineo");
         // lista.Add(new CatGeneroModels { IDGenero = string.Empty, NombreSucursal = " - Seleccione -" });
         while (dr.Read())
         {
             item = new CatGrupoSanguineoModels();
             item.IDGrupoSanguineo = !dr.IsDBNull(dr.GetOrdinal("id_grupoSanguineo")) ? dr.GetInt32(dr.GetOrdinal("id_grupoSanguineo")) : 0;
             item.descripcion      = !dr.IsDBNull(dr.GetOrdinal("TipoSanguineo")) ? dr.GetString(dr.GetOrdinal("TipoSanguineo")) : string.Empty;
             lista.Add(item);
         }
         dr.Close();
         return(lista);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 12
0
        //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;
        }