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>");
        }
    }
Beispiel #2
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;
            //}
        }
    }