private void BindData()
    {
        //IBL_Boleto carga = new BL_Boleto();
        IBL_Boleto       carga       = new BL_Boleto();
        List <BE_Boleto> ListaBoleto = carga.f_ListadoBoleto(txtNroBoleto.Text, txtDNI.Text);

        grvDetalle.DataSource = ListaBoleto;
        grvDetalle.DataBind();
        btnImprimir.Visible = true;
    }
    protected void grvDetalle_RowCommand(Object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "cmdCheckIn")
        {
            int         index = Convert.ToInt32(e.CommandArgument);
            GridViewRow row   = grvDetalle.Rows[index];
            ListItem    item  = new ListItem();
            item.Text = Server.HtmlDecode(row.Cells[1].Text);

            IBL_Boleto       carga       = new BL_Boleto();
            List <BE_Boleto> ListaBoleto = carga.f_CheckIn(item.Text);
            grvDetalle.DataSource = ListaBoleto;
            grvDetalle.DataBind();
            btnImprimir.Visible = true;
        }

        if (e.CommandName == "cmdCancelar")
        {
            int         index = Convert.ToInt32(e.CommandArgument);
            GridViewRow row   = grvDetalle.Rows[index];
            ListItem    item  = new ListItem();
            item.Text = Server.HtmlDecode(row.Cells[1].Text);

            IBL_Boleto       carga       = new BL_Boleto();
            List <BE_Boleto> ListaBoleto = carga.f_CancelarCheckIn(item.Text);
            grvDetalle.DataSource = ListaBoleto;
            grvDetalle.DataBind();
            btnImprimir.Visible = false;
        }

        if (e.CommandName == "cmdEditar")
        {
            int         index = Convert.ToInt32(e.CommandArgument);
            GridViewRow row   = grvDetalle.Rows[index];
            ListItem    item  = new ListItem();
            item.Text = Server.HtmlDecode(row.Cells[1].Text);                //Boleto
            ListItem itemVehiculo = new ListItem();
            itemVehiculo.Text = Server.HtmlDecode(row.Cells[4].Text);        //Vehiculo
            ListItem itemLiberarAsiento = new ListItem();
            itemLiberarAsiento.Text = Server.HtmlDecode(row.Cells[11].Text); //Asiento actual
            Response.Redirect("~/GestionarAsiento.aspx?ID=" + itemVehiculo.Text + "&nroboleta=" + item.Text + "&nroAsientoL=" + itemLiberarAsiento.Text);
        }

        if (e.CommandName == "cmdImprimir")
        {
            int         index = Convert.ToInt32(e.CommandArgument);
            GridViewRow row   = grvDetalle.Rows[index];
            ListItem    item  = new ListItem();
            item.Text = Server.HtmlDecode(row.Cells[1].Text);
            Response.Write("<script>window.open('ImprimirBoleto.aspx?nroboleto=" + item.Text + "','_blank')</script>");
        }
    }
Exemplo n.º 3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string dt1 = Request.Form[txtDetalleInfraccion.UniqueID];

        int          resultado = 0;
        IBL_Boleto   boleto    = new BL_Boleto();
        IBL_Equipaje carga     = new BL_Equipaje();



        if (dt1.Equals(""))
        {
            string message = "Ingrese el detalle de la infracción.";
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("<script type = 'text/javascript'>");
            sb.Append("window.onload=function(){");
            sb.Append("alert('");
            sb.Append(message);
            sb.Append("')};");
            sb.Append("</script>");
            ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
        }

        else
        {
            //string ruta = "Videos/" + "Bus_" + codbus + "_" + dt2;

            // DateTime a= DateTime.Parse(dt1);
            //resultado = carga.f_RegistrarFilmacion(codbus, dt1, dt2, ruta,estado);
            //if (resultado > 0)
            //{
            //  btnGrabar.Enabled = false;

            resultado = carga.f_RegistrarInfraccion(NroBoleto, dt1);
            List <BE_Boleto> ListaBoleto = boleto.f_CancelarCheckIn(NroBoleto);

            this.mypane1.Visible = true;
            this.mypane2.Visible = true;
            lblMensaje.Text      = "Registro Exitoso";

            lblMensaje0.Text = lblCodBoleto.Text;
            txtDetalleInfraccion.ReadOnly = true;
            btnGrabar.Visible             = false;
            btnCancelar.Visible           = false;
            btnRegresar.Visible           = true;

            //lblRuta.Text = ruta;
            //}
        }
    }
Exemplo n.º 4
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);
     }
 }
Exemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         //btnImprimir.Visible = true;
         Int32 IdVehiculo = Convert.ToInt32(Request.QueryString["ID"]);
         NroBoleto              = Request.QueryString["nroboleta"];
         Session["NroBoleto"]   = NroBoleto;
         hidNumBoleto.Value     = NroBoleto;
         NroAsientoL            = Request.QueryString["nroAsientoL"];
         Session["NroAsientoL"] = NroAsientoL;
         hidAsientoL.Value      = NroAsientoL;
         IBL_Boleto       carga       = new BL_Boleto();
         List <BE_Boleto> ListaBoleto = carga.f_ConsultarAsientosVehiculo(IdVehiculo);
         grvAsientos.DataSource = ListaBoleto;
         grvAsientos.DataBind();
     }
 }
Exemplo n.º 6
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());
    }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string           NumBoleto   = Convert.ToString(Request.QueryString["nroboleto"]);
            IBL_Boleto       carga       = new BL_Boleto();
            List <BE_Boleto> ListaBoleto = carga.f_ListadoBoleto(NumBoleto, "");

            lblNroBol.Text      = ListaBoleto[0].NroBoleto;
            lblPasajero.Text    = ListaBoleto[0].Pasajero;
            lblOrigen.Text      = ListaBoleto[0].Origen;
            lblDestino.Text     = ListaBoleto[0].Destino;
            lblFechaSalida.Text = ListaBoleto[0].FechaSalida;
            lblHoraSalida.Text  = ListaBoleto[0].HoraSalida;

            lblChofer.Text = ListaBoleto[0].Chofer;
            lblPlaza.Text  = ListaBoleto[0].Placa;

            grvDetalle.DataSource = ListaBoleto;
            grvDetalle.DataBind();
        }
    }