Esempio n. 1
0
        public List <BE_Boleto> f_ConsultarAsientosVehiculo(int CodVehiculo)
        {
            List <BE_Boleto> lst = new List <BE_Boleto>();

            SqlParameter[] param = new SqlParameter[1];
            param[0]           = new SqlParameter("pCodVehiculo", SqlDbType.Int);
            param[0].Value     = CodVehiculo;
            param[0].Direction = ParameterDirection.Input;
            DataSet   ds          = SqlHelper.ExecuteDataSet(Conexion.CadenaConexion, System.Data.CommandType.StoredProcedure, "SP_ASIENTOSVEHICULO", param);
            int       ColumnCount = ds.Tables.Count;
            DataTable dt          = ds.Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                //Object of the propery class
                BE_Boleto objBoleto = new BE_Boleto();
                //asign values
                objBoleto.CodVehiculo   = dr["INT_VEHICULO"].ToString();
                objBoleto.Placa         = dr["VCH_PLACA"].ToString();
                objBoleto.FechaSalida   = dr["FechaSalida"].ToString();
                objBoleto.HoraSalida    = dr["HoraSalida"].ToString();
                objBoleto.Asiento       = dr["CHR_ASIENTO"].ToString();
                objBoleto.EstadoAsiento = dr["VCH_DETESTASIENTO"].ToString();
                //add one row to the list
                lst.Add(objBoleto);
            }
            return(lst);
        }
Esempio n. 2
0
 protected void grvAsientos_RowCommand(Object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "cmdCambiarAsiento")
     {
         int         index = Convert.ToInt32(e.CommandArgument);
         GridViewRow row   = grvAsientos.Rows[index];
         ListItem    item  = new ListItem();
         item.Text = Server.HtmlDecode(row.Cells[1].Text);
         IBL_Boleto carga = new BL_Boleto();
         NroBoleto = (string)(Session["NroBoleto"]);
         string NroAsiento = (string)this.grvAsientos.DataKeys[index]["Asiento"];
         NroAsientoL = (string)(Session["NroAsientoL"]);
         BE_Boleto objBoleto = carga.f_ActualizarAsiento(NroBoleto, NroAsiento, NroAsientoL);
         Response.Redirect("~/GestionarAsiento.aspx?ID=1&nroboleta=" + NroBoleto + "&nroAsientoL=" + NroAsiento);
     }
 }
Esempio n. 3
0
        public List <BE_Boleto> f_ListadoBoleto(String nroboleto, string dni)
        {
            List <BE_Boleto> lst = new List <BE_Boleto>();

            SqlParameter[] param = new SqlParameter[2];
            param[0]           = new SqlParameter("pNROBOLETO", SqlDbType.VarChar);
            param[0].Value     = nroboleto;
            param[0].Direction = ParameterDirection.Input;
            param[1]           = new SqlParameter("pDNI", SqlDbType.VarChar);
            param[1].Value     = dni;
            param[1].Direction = ParameterDirection.Input;
            DataSet   ds          = SqlHelper.ExecuteDataSet(Conexion.CadenaConexion, System.Data.CommandType.StoredProcedure, "SP_BOLETOCONSULTAR", param);
            int       ColumnCount = ds.Tables.Count;
            DataTable dt          = ds.Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                //Object of the propery class
                BE_Boleto objBoleto = new BE_Boleto();
                //asign values

                objBoleto.NroBoleto       = dr["CHR_NUMEROBOLETO"].ToString();
                objBoleto.Pasajero        = dr["Pasajero"].ToString();
                objBoleto.Precio          = dr["DEC_PRECIOPASAJE"].ToString();
                objBoleto.Placa           = dr["VCH_PLACA"].ToString();
                objBoleto.TipoServicio    = dr["VCH_NOMBRE"].ToString();
                objBoleto.Origen          = dr["VCH_ORIGEN"].ToString();
                objBoleto.Destino         = dr["VCH_DESTINO"].ToString();
                objBoleto.FechaSalida     = dr["FechaSalida"].ToString();
                objBoleto.HoraSalida      = dr["HoraSalida"].ToString();
                objBoleto.Asiento         = dr["CHR_ASIENTO"].ToString();
                objBoleto.EstadoAsiento   = dr["VCH_DETESTASIENTO"].ToString();
                objBoleto.Ubicacion       = dr["VCH_UBICACION"].ToString();
                objBoleto.Chofer          = dr["Chofer"].ToString();
                objBoleto.FechaActual     = dr["FechaActual"].ToString();
                objBoleto.HoraActual      = dr["HoraActual"].ToString();
                objBoleto.CodVehiculo     = dr["INT_VEHICULO"].ToString();
                objBoleto.EstadoCheckin   = dr["ESTADO_CHECKIN"].ToString();
                objBoleto.EstadoHora      = dr["ESTADO_HORA"].ToString();
                objBoleto.IntCodigoBoleto = Convert.ToInt32(dr["INT_CODIGOBOLETO"]);


                //add one row to the list
                lst.Add(objBoleto);
            }
            return(lst);
        }
Esempio n. 4
0
    public static string AsignarAsiento(string asientoNuevo, string boleto, string asientoL)
    {
        StringBuilder result = new StringBuilder();

        try
        {
            IBL_Boleto carga = new BL_Boleto();

            BE_Boleto objBoleto = carga.f_ActualizarAsiento(boleto, asientoNuevo, asientoL);

            result.Append("ID=1&nroboleta=").Append(boleto);
            result.Append("&nroAsientoL=").Append(asientoNuevo);
        }
        catch (Exception ex)
        {
            result.Append(ex.Message);
        }

        return(result.ToString());
    }