public VehiculoBEList GETListarBuscarCliente(VehiculoBE ent)
        {
            VehiculoBEList lista   = new VehiculoBEList();
            IDataReader    DReader = null;

            try
            {
                using (Database db = new Database())
                {
                    db.ProcedureName = "[SRC_SPS_SEL_CLIENTE_x_VEHICULO]";
                    db.AddParameter("@vi_co_tipo_cliente", DbType.String, ParameterDirection.Input, ent.DET_co_tipo_cliente);
                    db.AddParameter("@vi_co_tipo_documento", DbType.String, ParameterDirection.Input, ent.DET_co_tipo_documento);
                    db.AddParameter("@vi_nu_documento", DbType.String, ParameterDirection.Input, ent.DET_nu_documento);
                    DReader = db.GetDataReader();
                }
                while (DReader.Read())
                {
                    VehiculoBE oBE = CrearEntidad_BusCliente(DReader);
                    lista.Add(oBE);
                }

                DReader.Close();
            }
            catch (Exception)
            {
                if (DReader != null && !DReader.IsClosed)
                {
                    DReader.Close();
                }
                throw;
            }
            return(lista);
        }
示例#2
0
        public VehiculoBEList ListarDatosPorPlaca(VehiculoBE ent)
        {
            VehiculoBEList lista  = new VehiculoBEList();
            SqlConnection  conn   = new SqlConnection(DataBaseHelper.GetDbConnectionString());
            SqlCommand     cmd    = new SqlCommand("[SRC_SPS_DATOSVEHICULO_POR_PLACA_FO]", conn);
            SqlDataReader  reader = null;

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@vi_nu_placa", ent.nu_placa);
            try
            {
                conn.Open();
                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    lista.Add(Entidad_ListarDatosPorPlaca(reader));
                }
                reader.Close();
            }
            catch (Exception)
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            return(lista);
        }
示例#3
0
        public VehiculoBEList ListarMarcas()
        {
            VehiculoBEList lista  = new VehiculoBEList();
            SqlConnection  conn   = new SqlConnection(DataBaseHelper.GetDbConnectionString());
            SqlCommand     cmd    = new SqlCommand("SRC_SPS_MARCAS_FO", conn);
            SqlDataReader  reader = null;

            cmd.CommandType = CommandType.StoredProcedure;
            try
            {
                conn.Open();
                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    lista.Add(Entidad_ListarMarcas(reader));
                }
                reader.Close();
            }
            catch (Exception)
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            return(lista);
        }
示例#4
0
        public VehiculoBEList ListarVehiculoPorCliente(ClienteBE ent)
        {
            VehiculoBEList lista  = new VehiculoBEList();
            SqlConnection  conn   = new SqlConnection(DataBaseHelper.GetDbConnectionString());
            SqlCommand     cmd    = new SqlCommand("src_sps_vehiculo_por_cliente_web", conn);
            SqlDataReader  reader = null;

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@vi_nid_cliente", ent.nid_cliente);
            try
            {
                conn.Open();
                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    lista.Add(Entidad_ListarVehiculoPorCliente(reader));
                }
                reader.Close();
            }
            catch (Exception)
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
                throw;
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            return(lista);
        }
示例#5
0
    protected void btnBuscarWarrant_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            hf_exportaexcel.Value  = "";
            txh_nid_vehiculo.Value = String.Empty;
            objEnt.nu_placa        = txt_busplacapatente.Text.Trim();
            objEnt.nu_vin          = txt_busnrovin.Text.Trim();
            objEnt.nid_marca       = int.Parse(ddl_busmarca.SelectedValue.ToString());
            objEnt.nid_modelo      = int.Parse(ddl_busmodelo.SelectedValue.ToString());
            objEnt.qt_km_actual    = Int64.Parse((txt_buskilometraje.Text.Length == 0 ? "-1" : txt_buskilometraje.Text.Trim()));
            objEnt.fl_activo       = cboEstado.SelectedValue.ToString();

            Session["MaestroVehiculoBE_FILTRO"] = objEnt;
            Session["bus_objEnt"] = objEnt;

            //---------
            this.oMaestroVehiculoBEList = objNeg.GETListarVehiculos(objEnt, Profile.Usuario.Nid_usuario);

            if (oMaestroVehiculoBEList == null || oMaestroVehiculoBEList.Count == 0)
            {
                Session["MaestroVehiculoBE_FILTRO"] = null;
                objEnt = null;
                objEnt = new VehiculoBE();
                oMaestroVehiculoBEList.Add(objEnt);
            }
            else
            {
                hf_exportaexcel.Value = "1";
            }

            this.gdVehiculos.DataSource = oMaestroVehiculoBEList;
            this.gdVehiculos.DataBind();

            Session["VehiculoBEList"] = oMaestroVehiculoBEList;
        }
        catch (Exception)
        {
        }
    }
        public VehiculoBEList GETListarVehiculos(VehiculoBE ent, Int32 Nid_usuario)
        {
            VehiculoBEList lista   = new VehiculoBEList();
            IDataReader    DReader = null;

            try
            {
                using (Database db = new Database())
                {
                    db.ProcedureName = "[SRC_SPS_SEL_VEHICULO]";
                    db.AddParameter("@nu_placa", DbType.String, ParameterDirection.Input, ent.nu_placa);
                    db.AddParameter("@nu_vin", DbType.String, ParameterDirection.Input, ent.nu_vin);
                    db.AddParameter("@nid_marca", DbType.Int32, ParameterDirection.Input, ent.nid_marca);
                    db.AddParameter("@nid_modelo", DbType.Int32, ParameterDirection.Input, ent.nid_modelo);
                    db.AddParameter("@qt_km_actual", DbType.Int64, ParameterDirection.Input, ent.qt_km_actual);
                    db.AddParameter("@Estado", DbType.String, ParameterDirection.Input, ent.fl_activo);
                    db.AddParameter("@Nid_usuario", DbType.Int32, ParameterDirection.Input, Nid_usuario);
                    DReader = db.GetDataReader();
                }
                while (DReader.Read())
                {
                    VehiculoBE oBE = CrearEntidad_Parametros(DReader);
                    lista.Add(oBE);
                }

                DReader.Close();
            }
            catch //(Exception Ex)
            {
                if (DReader != null && !DReader.IsClosed)
                {
                    DReader.Close();
                }
                throw;
            }
            return(lista);
        }