Example #1
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EDITAR")
     {
         Limpiar();
         int       id = Convert.ToInt32(e.CommandArgument);
         UsuarioBC u  = new UsuarioBC().ObtenerXId(id);
         LlenarDatos(u);
         txt_editRut.Enabled = false;
         utils.AbrirModal(this, "modalEdit");
     }
     if (e.CommandName == "ELIMINAR")
     {
         hf_id.Value              = e.CommandArgument.ToString();
         lbl_confTitulo.Text      = "Eliminar usuario";
         lbl_confMensaje.Text     = "Se eliminará el usuario seleccionado ¿Está seguro?";
         btn_confActivar.Visible  = false;
         btn_confEliminar.Visible = true;
         utils.AbrirModal(this, "modalConf");
     }
     if (e.CommandName == "ACTIVAR")
     {
         gv_listar.SelectedIndex = Convert.ToInt32(e.CommandArgument);
         int  usua_id     = Convert.ToInt32(gv_listar.SelectedDataKey.Values["USUA_ID"]);
         bool usua_estado = Convert.ToBoolean(gv_listar.SelectedDataKey.Values["USUA_ESTADO"]);
         lbl_confTitulo.Text      = (usua_estado) ? "Desactivar usuario" : "Activar usuario";
         lbl_confMensaje.Text     = (usua_estado) ? "Se desactivará el usuario seleccionado ¿Está seguro?" : "Se activará el usuario seleccionado ¿Está seguro?";
         btn_confActivar.Visible  = true;
         btn_confEliminar.Visible = false;
         utils.AbrirModal(this, "modalConf");
     }
 }
Example #2
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "ELIMINAR")
     {
         hf_idCaractTipoCarga.Value = e.CommandArgument.ToString();
         utils.AbrirModal(this, "modalConf");
     }
     if (e.CommandName == "MODIFICAR")
     {
         CaractTipoCargaBC cct = new CaractTipoCargaBC();
         hf_idCaractTipoCarga.Value = e.CommandArgument.ToString();
         cct.ID            = Convert.ToInt32(hf_idCaractTipoCarga.Value);
         cct               = cct.obtenerXID();
         txt_editId.Text   = cct.ID.ToString();
         txt_editDesc.Text = cct.DESCRIPCION;
         if (cct.EXCLUYENTE)
         {
             chk_editExcluyente.Checked = true;
         }
         else
         {
             chk_editExcluyente.Checked = false;
         }
         utils.AbrirModal(this, "modalEdit");
     }
 }
Example #3
0
 protected void gv_listaEmpresas_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EDITAR")
     {
         limpiarTodo();
         hf_idEmpresa.Value = e.CommandArgument.ToString();
         activarDesactivar(true);
         EmpresaBC empresa = new EmpresaBC();
         empresa = empresa.ObtenerTodoXId(Convert.ToInt32(hf_idEmpresa.Value));
         llenarDatos(empresa);
         utils.AbrirModal(this, "modalEdit");
     }
     if (e.CommandName == "VER")
     {
         limpiarTodo();
         EmpresaBC empresa = new EmpresaBC();
         hf_idEmpresa.Value = e.CommandArgument.ToString();
         empresa            = empresa.ObtenerTodoXId(Convert.ToInt32(hf_idEmpresa.Value));
         llenarDatos(empresa);
         activarDesactivar(false);
         utils.AbrirModal(this, "modalEdit");
     }
     else if (e.CommandName == "ELIMINAR")
     {
         limpiarTodo();
         hf_idEmpresa.Value       = e.CommandArgument.ToString();
         lblRazonEliminacion.Text = "Eliminar empresa";
         msjEliminacion.Text      = "Se eliminará la empresa seleccionada. ¿Desea continuar?";
         utils.AbrirModal(this, "modalConf");
     }
 }
Example #4
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EDITAR")
     {
         Limpiar();
         int         id = Convert.ToInt32(e.CommandArgument);
         ConductorBC u  = new ConductorBC().ObtenerXId(id);
         LlenarDatos(u);
         chk_editExtranjero.Enabled = false;
         txt_editRut.Enabled        = false;
         utils.AbrirModal(this, "modalEdit");
     }
     if (e.CommandName == "ELIMINAR")
     {
         hf_id.Value              = e.CommandArgument.ToString();
         lbl_confTitulo.Text      = "Eliminar conductor";
         lbl_confMensaje.Text     = "Se eliminará el conductor seleccionado ¿Está seguro?";
         btn_confActivar.Visible  = false;
         btn_confBloquear.Visible = false;
         btn_confEliminar.Visible = true;
         dv_bloquear.Visible      = false;
         utils.AbrirModal(this, "modalConf");
     }
     if (e.CommandName == "ACTIVAR")
     {
         gv_listar.SelectedIndex = Convert.ToInt32(e.CommandArgument);
         int  cond_id     = Convert.ToInt32(gv_listar.SelectedDataKey.Values["COND_ID"]);
         bool cond_activo = Convert.ToBoolean(gv_listar.SelectedDataKey.Values["COND_ACTIVO"]);
         lbl_confTitulo.Text      = (cond_activo) ? "Desactivar conductor" : "Activar conductor";
         lbl_confMensaje.Text     = (cond_activo) ? "Se desactivará el conductor seleccionado ¿Está seguro?" : "Se activará el conductor seleccionado ¿Está seguro?";
         btn_confActivar.Visible  = true;
         btn_confBloquear.Visible = false;
         btn_confEliminar.Visible = false;
         dv_bloquear.Visible      = false;
         utils.AbrirModal(this, "modalConf");
     }
     if (e.CommandName == "BLOQUEAR")
     {
         gv_listar.SelectedIndex = Convert.ToInt32(e.CommandArgument);
         int  cond_id        = Convert.ToInt32(gv_listar.SelectedDataKey.Values["COND_ID"]);
         bool cond_bloqueado = Convert.ToBoolean(gv_listar.SelectedDataKey.Values["COND_BLOQUEADO"]);
         lbl_confTitulo.Text      = (cond_bloqueado) ? "Desbloquear conductor" : "Bloquear conductor";
         lbl_confMensaje.Text     = (cond_bloqueado) ? "Se desbloqueará el conductor seleccionado ¿Está seguro?" : "Se bloqueará el conductor seleccionado ¿Está seguro?";
         btn_confActivar.Visible  = false;
         btn_confBloquear.Visible = true;
         btn_confEliminar.Visible = false;
         dv_bloquear.Visible      = !cond_bloqueado;
         txt_confBloquear.Text    = "";
         utils.AbrirModal(this, "modalConf");
     }
 }
Example #5
0
    protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "enviar")
        {
            //Limpiar();
            String mimeType = "";
            int    id       = Convert.ToInt32(e.CommandArgument);
            //PedidoBC p = new PedidoBC().ObtenerXId(peru_id);
            //LlenarDatos(p);
            //utils.AbrirModal(this, "modalEdit");
            EnvioBC   envio    = new EnvioBC(id);
            DataTable enviados = envio.detalle();
            envio.archivo(enviados);
            try
            {
                envio.archivo2(enviados, id);
            }
            catch (Exception ex)
            {
                utils.ShowMessage(this.Page, ex.Message, "error", true, "msg_error");
                return;
            }

            UtilsWeb.AddFileToZip("C:\\ViewState\\multiple.zip", "C:\\ViewState\\cliente.txt");
            UtilsWeb.AddFileToZip("C:\\ViewState\\multiple.zip", "C:\\ViewState\\pedido.txt");

            utils.ShowMessage(this.Page, "Pedidos enviados correctamente", "sucess", true);
            return;


            Response.Clear();
            Response.ContentType = mimeType;
            Response.AddHeader("content-disposition", "attachment; filename=" + "descarga_multiple.zip");
            Response.BinaryWrite(File.ReadAllBytes("C:\\ViewState\\multiple.zip"));
            //   File.Delete(Server.MapPath("./cargadefotos/Output.zip"));
            File.Delete("C:\\ViewState\\multiple.zip");

            Response.End();

            utils.ShowMessage(this.Page, "Archivos Generados Correctamente", "success", true);
        }
        if (e.CommandName == "ELIMINAR")
        {
            hf_idPeru.Value      = e.CommandArgument.ToString();
            lbl_confTitulo.Text  = "Eliminar Envio";
            lbl_confMensaje.Text = "Se eliminará el Envio seleccionado ¿Desea continuar?";
            utils.AbrirModal(this, "modalConf");
        }
    }
Example #6
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EDITAR")
     {
         hf_id.Value = e.CommandArgument.ToString();
         TrailerTipoBC tipo_trailer = new TrailerTipoBC().ObtenerXId(Convert.ToInt32(e.CommandArgument));
         txt_editDesc.Text  = tipo_trailer.TRTI_DESC;
         txt_editColor.Text = tipo_trailer.TRTI_COLOR;
         utils.AbrirModal(this, "modalEdit");
     }
     if (e.CommandName == "ELIMINAR")
     {
         hf_id.Value = e.CommandArgument.ToString();
         utils.AbrirModal(this, "modalConf");
     }
 }
Example #7
0
    protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        TransportistaBC trans = new TransportistaBC();

        hf_preingreso.Value = e.CommandArgument.ToString();
        trans = trans.DatosPreIngreso(Convert.ToInt32(hf_preingreso.Value));


        if (e.CommandName == "ELIMINAR")
        {
            if (trans.ESTADO == "1")
            {
                hf_preingreso.Value = e.CommandArgument.ToString();
                utils.AbrirModal(this, "modalConfirmar");
            }
            else
            {
                utils.ShowMessage(this, "No se puede eliminar preingreso", "warn", true);
            }
        }
        else if (e.CommandName == "pdf")
        {
            hf_preingreso.Value = e.CommandArgument.ToString();
            generaPDF(null, null);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Ocurrio un Problema');", true);
        }
    }
Example #8
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EDITAR")
     {
         hf_id.Value = e.CommandArgument.ToString();
         TractoBC t = new TractoBC().ObtenerXId(Convert.ToInt32(hf_id.Value));
         txt_editPatente.Text = t.TRAC_PLACA;
         utils.AbrirModal(this, "modalEdit");
     }
     if (e.CommandName == "ELIMINAR")
     {
         hf_id.Value          = e.CommandArgument.ToString();
         lbl_confTitulo.Text  = "Eliminar Tracto";
         lbl_confMensaje.Text = "Se eliminará el tracto seleccionado ¿Desea continuar?";
         utils.AbrirModal(this, "modalConf");
     }
 }
Example #9
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EDITAR")
     {
         Limpiar();
         hf_idTrailer.Value = e.CommandArgument.ToString();
         TrailerBC trailer = new TrailerBC().ObtenerXId(Convert.ToInt32(e.CommandArgument));
         llenarForm(trailer);
         utils.AbrirModal(this, "modalEdit");
     }
     if (e.CommandName == "ELIMINAR")
     {
         hf_idTrailer.Value   = e.CommandArgument.ToString();
         lbl_confTitulo.Text  = "Eliminar Trailer";
         lbl_confMensaje.Text = "Se eliminará el trailer seleccionado, ¿desea continuar?";
         utils.AbrirModal(this, "modalConf");
     }
 }
Example #10
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EDITAR")
     {
         Limpiar();
         int      peru_id = Convert.ToInt32(e.CommandArgument);
         PedidoBC p       = new PedidoBC().ObtenerXId(peru_id);
         LlenarDatos(p);
         up_modalEdit.Update();
         //utils.AbrirModal(this, "modalEdit");
     }
     if (e.CommandName == "ELIMINAR")
     {
         hf_idPeru.Value      = e.CommandArgument.ToString();
         lbl_confTitulo.Text  = "Eliminar Pedido";
         lbl_confMensaje.Text = "Se eliminará el pedido seleccionado ¿Desea continuar?";
         utils.AbrirModal(this, "modalConf");
     }
 }
Example #11
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EDITAR")
     {
         Limpiar();
         int      id = Convert.ToInt32(e.CommandArgument);
         OrigenBC o  = new OrigenBC().ObtenerXId(id);
         LlenarDatos(o);
         utils.AbrirModal(this, "modalEdit");
     }
     if (e.CommandName == "ELIMINAR")
     {
         hf_idOrigen.Value        = e.CommandArgument.ToString();
         lbl_confTitulo.Text      = "Eliminar origen";
         lbl_confMensaje.Text     = "Se eliminará el origen seleccionado ¿Está seguro?";
         btn_confEliminar.Visible = true;
         utils.AbrirModal(this, "modalConf");
     }
 }
Example #12
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EDITAR")
     {
         Limpiar();
         int           id = Convert.ToInt32(e.CommandArgument);
         UsuarioTipoBC ut = new UsuarioTipoBC().ObtenerXId(id);
         txt_editNombre.Text      = ut.USTI_NOMBRE;
         txt_editDescripcion.Text = ut.USTI_DESC;
         txt_editPermisos.Text    = ut.USTI_NIVEL_PERMISOS.ToString();
         hf_id.Value     = ut.USTI_ID.ToString();
         hf_menuId.Value = ut.MENU_ID.ToString();
         utils.AbrirModal(this, "modalEdit");
     }
     if (e.CommandName == "ELIMINAR")
     {
         hf_id.Value = e.CommandArgument.ToString();
         utils.AbrirModal(this, "modalConf");
     }
 }
Example #13
0
    protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "MODIFICAR")
        {
            Limpiar();
            this.hf_idTrailer.Value = e.CommandArgument.ToString();
            TrailerBC trailer = new TrailerBC();
            trailer.ID = Convert.ToInt32(e.CommandArgument);
            trailer    = trailer.obtenerXID();
            this.llenarForm(trailer);
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "llenarForm", "llenarForm();", true);
            utils.AbrirModal(this, "modalEdit");
        }
        if (e.CommandName == "ELIMINAR")
        {
            ddTipoBloqueo.Visible       = false;
            hf_idTrailer.Value          = e.CommandArgument.ToString();
            lblRazonEliminacion.Text    = "Eliminar Trailer";
            msjEliminacion.Text         = "Se eliminará el trailer seleccionado, ¿desea continuar?";
            btnModalEliminar.Visible    = true;
            btn_BloquearTrailer.Visible = false;
            utils.AbrirModal(this, "modalConfirmar");
        }
        if (e.CommandName == "BLOQUEAR")
        {
            SiteBC site = new SiteBC();
            utils.CargaDrop(this.ddl_buscarSite, "ID", "NOMBRE", site.ObtenerTodos());
            ddTipoBloqueo.Visible = true;
            hf_idTrailer.Value    = e.CommandArgument.ToString();

            TrailerBC trailer = new TrailerBC();
            trailer = trailer.obtenerXID(Convert.ToInt32(this.hf_idTrailer.Value.ToString()));
            lblRazonEliminacion.Text     = "Bloquear Trailer";
            ddl_buscarSite.SelectedValue = trailer.SITE_ID.ToString();
            ddl_buscarSite_onChange(null, null);
            msjEliminacion.Text         = "Motivo de Bloqueo";
            btnModalEliminar.Visible    = false;
            btn_BloquearTrailer.Visible = true;
            utils.AbrirModal(this, "modalConfirmar");
        }
    }
Example #14
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "VER")
     {
         int id = Convert.ToInt32(e.CommandArgument);
         lbl_modalDetalleTitulo.Text = string.Format("Detalle Solicitud N°{0}", id);
         ReportBC r = new ReportBC();
         gv_detalle.DataSource = r.CargarSolicitudesCargaDetalle(id);
         gv_detalle.DataBind();
         utils.AbrirModal(this, "modalDetalle");
     }
 }
Example #15
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EDITAR")
     {
         Limpiar();
         int         id = Convert.ToInt32(e.CommandArgument);
         ParametroBC p  = new ParametroBC().ObtenerXId(id);
         txt_editNombre.Text = p.PARA_NOMBRE;
         txt_editObs.Text    = p.PARA_OBS;
         txt_editValor.Text  = p.PARA_VALOR;
         utils.AbrirModal(this, "modalEdit");
     }
     if (e.CommandName == "ELIMINAR")
     {
         hf_id.Value              = e.CommandArgument.ToString();
         lbl_confTitulo.Text      = "Eliminar parámetro";
         lbl_confMensaje.Text     = "Se eliminará el parámetro seleccionado ¿Está seguro?";
         btn_confEliminar.Visible = true;
         utils.AbrirModal(this, "modalConf");
     }
 }
Example #16
0
 protected void btn_nuevo_Click(object sender, EventArgs e)
 {
     LimpiarTodo();
     txt_editRut.Enabled        = true;
     chk_editExtranjero.Enabled = true;
     utils.AbrirModal(this, "modalEdit");
 }
Example #17
0
    protected void btnBuscarTrailer_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(txt_placaTrailer.Text))
        {
            utils.ShowMessage2(this, "buscarTrailer", "warn_placaVacia"); return;
        }
        if (!chk_vehiculoImportado.Checked && !utils.patentevalida(txt_placaTrailer.Text))
        {
            utils.ShowMessage2(this, "buscarTrailer", "warn_placaInvalida"); return;
        }
        TrailerBC trailer = new TrailerBC();

        trailer = trailer.obtenerXPlaca(txt_placaTrailer.Text);
        if (trailer.ID == 0) //Trailer nuevo, no existe
        {
            TractoBC tracto = new TractoBC();
            if (txt_placaTrailer.Text != "")
            {
                tracto = tracto.ObtenerXPatente(txt_placaTrailer.Text);
            }
            if (tracto.ID > 0)
            {
                utils.ShowMessage2(this, "buscarTrailer", "warn_placaTracto");
            }
            else
            {
                utils.AbrirModal(this, "modalConfirmar");
            }
            this.chk_vehiculoImportado.Enabled = false;
        }
        else //Trailer existente, trae datos
        {
            hf_idTrailer.Value              = trailer.ID.ToString();
            txt_placaTrailer.Text           = trailer.PLACA;
            ddl_transportista.SelectedValue = trailer.TRAN_ID.ToString();
            rb_propio.Checked      = !trailer.EXTERNO;
            rb_externo.Checked     = trailer.EXTERNO;
            ddl_tipo_carga.Enabled = true;

            txt_placaTracto.Enabled         = true;
            txt_idSello.Enabled             = true;
            txt_conductorRut.Enabled        = true;
            chk_conductorExtranjero.Enabled = true;
            txt_conductorNombre.Enabled     = true;
            txt_acomRut.Enabled             = true;
            txt_doc2.Enabled = true;
            chk_vehiculoImportado.Enabled = false;
            txt_selloReferencia.Enabled   = chk_vehiculoImportado.Checked;
            txt_conductorRut_TextChanged(null, null);
            utils.ShowMessage2(this, "buscarTrailer", "success");
        }
    }
Example #18
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "MODIFICAR")
     {
         Limpiar();
         ProveedorBC prov = new ProveedorBC();
         prov = prov.ObtenerXId(Convert.ToInt32(e.CommandArgument));
         LlenarForm(prov);
         utils.AbrirModal(this, "modalEdit");
     }
     if (e.CommandName == "ELIMINAR")
     {
         hf_id.Value = e.CommandArgument.ToString();
         utils.AbrirModal(this, "modalConfirmar");
     }
     if (e.CommandName == "VENDOR")
     {
         hf_id.Value = e.CommandArgument.ToString();
         ObtenerVendor();
         utils.AbrirModal(this, "modalVendor");
     }
 }
Example #19
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "ELIMINAR")
     {
         Limpiar();
         hf_idCaractCarga.Value = e.CommandArgument.ToString();
         utils.AbrirModal(this, "modalConf");
     }
     if (e.CommandName == "MODIFICAR")
     {
         CaractCargaBC cc = new CaractCargaBC();
         Limpiar();
         hf_idCaractCarga.Value = e.CommandArgument.ToString();
         cc.ID = Convert.ToInt32(e.CommandArgument);
         cc    = cc.obtenerSeleccionado();
         txt_editCodigo.Text        = cc.CODIGO.ToString();
         txt_editDesc.Text          = cc.DESCRIPCION;
         txt_editValor.Text         = cc.VALOR.ToString();
         ddl_editTipo.SelectedValue = cc.CACT_ID.ToString();
         utils.AbrirModal(this, "modalEdit");
     }
 }
Example #20
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "PUNTOS")
     {
         utils.AbrirModal(this.Page, "modalPuntos");
         hf_idRuta.Value         = "";
         hf_idPunto.Value        = "";
         hf_puntosruta.Value     = "";
         hf_idOrigen.Value       = "";
         txt_puntoNombre.Text    = "";
         gv_listar.SelectedIndex = Convert.ToInt32(e.CommandArgument);
         int id_ruta   = Convert.ToInt32(gv_listar.SelectedDataKey.Values[0]);
         int id_origen = Convert.ToInt32(gv_listar.SelectedDataKey.Values[1]);
         hf_idRuta.Value   = id_ruta.ToString();
         hf_idOrigen.Value = id_origen.ToString();
         ObtenerPuntosRuta(true);
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "map", "mapa();", true);
     }
 }
Example #21
0
 protected void btn_nuevoTrailer_Click(object sender, EventArgs e)
 {
     this.nuevo_trailer.limpiarForm();
     this.nuevo_trailer.setplaca(this.txt_buscarPatente.Text, false);
     utils.AbrirModal(this, "modalEditarTrailer");
 }
Example #22
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "COLOR")
     {
         hf_idRuta.Value = e.CommandArgument.ToString();
         PreRutaBC p = new PreRutaBC().ObtenerXId(Convert.ToInt32(hf_idRuta.Value));
         txt_editColor.Text = p.RUTA_COLOR;
         utils.AbrirModal(this.Page, "modalColor");
     }
     if (e.CommandName == "PUNTOS")
     {
         Limpiar();
         dv_detalle.Visible = false;
         //utils.AbrirModal(this.Page, "modalPuntos");
         gv_listar.SelectedIndex = Convert.ToInt32(e.CommandArgument);
         int id_preruta = Convert.ToInt32(gv_listar.SelectedDataKey.Values[0]);
         int id_origen  = Convert.ToInt32(gv_listar.SelectedDataKey.Values[1]);
         hf_idRuta.Value = id_preruta.ToString();
         ObtenerPuntosRuta(true);
         //lbl_puntoSalida.Text = "Tiempo de viaje: ";
     }
     if (e.CommandName == "DETALLE")
     {
         Limpiar();
         hf_idRuta.Value = e.CommandArgument.ToString();
         PreRutaBC p       = new PreRutaBC().ObtenerXId(Convert.ToInt32(hf_idRuta.Value));
         DateTime  fecha   = Convert.ToDateTime(txt_buscarFecha.Text);
         int       hora_id = Convert.ToInt32(ddl_buscarHorario.SelectedValue);
         DataTable dt;
         ddl_vehiculoTracto.Items.Clear();
         ddl_vehiculoConductor.Items.Clear();
         txt_editNombre.Text = "";
         ddl_vehiculoTracto.Items.Add(new RadComboBoxItem("Sin Tracto", "0"));
         ddl_vehiculoConductor.Items.Add(new RadComboBoxItem("Sin Conductor", "0"));
         dt = new TractoBC().ObtenerTodo(fecha: fecha, hora_id: hora_id);
         foreach (DataRow dr in dt.Rows)
         {
             RadComboBoxItem cb = new RadComboBoxItem(dr["TRAC_PLACA"].ToString(), dr["TRAC_ID"].ToString());
             if (dr["ID_RUTA"] != DBNull.Value)
             {
                 long id_ruta = Convert.ToInt32(dr["ID_RUTA"]);
                 if (id_ruta.ToString() != hf_idRuta.Value)
                 {
                     cb.Enabled = false;
                 }
             }
             ddl_vehiculoTracto.Items.Add(cb);
         }
         dt = new ConductorBC().ObtenerTodo(fecha: fecha, hora_id: hora_id, cond_activo: true, cond_bloqueado: false);
         foreach (DataRow dr in dt.Rows)
         {
             RadComboBoxItem cb = new RadComboBoxItem((dr["COND_RUT"].ToString() + " - " + dr["COND_NOMBRE"].ToString()), dr["COND_ID"].ToString());
             if (dr["ID_RUTA"] != DBNull.Value)
             {
                 long id_ruta = Convert.ToInt32(dr["ID_RUTA"]);
                 if (id_ruta.ToString() != hf_idRuta.Value)
                 {
                     cb.Enabled = false;
                 }
             }
             ddl_vehiculoConductor.Items.Add(cb);
         }
         ddl_vehiculoTipo.SelectedValue = p.TRAILER.TRAILER_TIPO.TRTI_ID.ToString();
         ddl_vehiculoTipo_SelectedIndexChanged(null, null);
         ddl_vehiculoConductor.SelectedValue = p.CONDUCTOR.COND_ID.ToString();
         ddl_vehiculoTracto.SelectedValue    = p.TRACTO.TRAC_ID.ToString();
         txt_editNombre.Text = p.NUMERO.ToString();
         ddl_vehiculoTrailer.SelectedValue = p.TRAILER.TRAI_ID.ToString();
         dv_detalle.Visible = true;
         utils.AbrirModal(this.Page, "modalVehiculo");
     }
     if (e.CommandName == "ELIMINAR")
     {
         hf_idRuta.Value      = e.CommandArgument.ToString();
         lbl_confTitulo.Text  = "Eliminar Propuesta";
         lbl_confMensaje.Text = "Se eliminará la propuesta de ruta seleccionada ¿Desea continuar?";
         utils.AbrirModal(this, "modalConf");
         btn_confEliminar.Visible      = true;
         btn_confEliminarTodos.Visible = false;
     }
 }
Example #23
0
 protected void btn_agregarUsuario_Click(object sender, EventArgs e)
 {
     limpiarTodo();
     utils.AbrirModal(this, "modalEdit");
 }
Example #24
0
 protected void btn_nuevo_Click(object sender, EventArgs e)
 {
     Limpiar();
     utils.AbrirModal(this, "modalEdit");
 }
Example #25
0
    protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        SolicitudAndenesBC sa = new SolicitudAndenesBC();
        string             resultado;

        try
        {
            gv_listar.SelectedIndex = Convert.ToInt32(e.CommandArgument);
            sa.SOLI_ID    = Convert.ToInt32(gv_listar.SelectedDataKey.Values[0]);
            sa.LUGA_ID    = Convert.ToInt32(gv_listar.SelectedDataKey.Values[1]);
            sa.SOAN_ORDEN = Convert.ToInt32(gv_listar.SelectedDataKey.Values[2]);
            sa            = sa.ObtenerXId();
        }
        catch (Exception)
        {
        }
        hf_accion.Value = e.CommandName;
        LugarBC l = new LugarBC();

        switch (e.CommandName.ToString())
        {
        case "anden":
            hf_soliId.Value               = sa.SOLI_ID.ToString();
            hf_soanOrden.Value            = sa.SOAN_ORDEN.ToString();
            lbl_confirmarTitulo.Text      = "Comenzar Carga";
            lbl_confirmarMensaje.Text     = "¿Comenzar Carga?";
            btn_eliminarSolicitud.Visible = false;
            hf_soanOrden.Value            = sa.SOAN_ORDEN.ToString();
            hf_lugaId.Value               = sa.LUGA_ID.ToString();
            btn_andenListo.Visible        = true;
            utils.AbrirModal(this, "modalConfirmar");
            break;

        case "CANCELAR":
            hf_soliId.Value               = sa.SOLI_ID.ToString();
            lbl_confirmarTitulo.Text      = "Eliminar Solicitud";
            lbl_confirmarMensaje.Text     = "Se eliminará la solicitud de la base de datos ¿Desea continuar?";
            btn_eliminarSolicitud.Visible = true;
            btn_andenListo.Visible        = false;
            utils.AbrirModal(this, "modalConfirmar");
            break;

        case "encender":
            hf_soliId.Value = sa.SOLI_ID.ToString();
            SolicitudBC solicitud = new SolicitudBC();
            solicitud.SOLI_ID = Convert.ToInt32(this.hf_soliId.Value);
            resultado         = "";
            bool ejecucion = solicitud.Encender_termo(this.usuario.ID, out resultado);
            if (ejecucion && resultado == "")
            {
                utils.ShowMessage2(this, "encender", "success");
            }
            else
            {
                utils.ShowMessage(this, resultado, "error", false);
            }
            ObtenerSolicitudes(true);
            break;

        case "AndenEmergencia":
            LimpiarLocales();
            l.ObtenerXPlaya(sa.PLAY_ID);
            btn_loc.Visible               = false;
            hf_soliId.Value               = sa.SOLI_ID.ToString();
            hf_soanOrden.Value            = sa.SOAN_ORDEN.ToString();
            hf_caractSolicitud.Value      = sa.CARACTERISTICAS;
            hf_localesSeleccionados.Value = sa.LOCALES;
            hf_timeStamp.Value            = sa.TIMESTAMP.ToString();
            ObtenerLocalesSolicitud(true);
            utils.CargaDropNormal(this.ddl_reanudarAnden, "ID", "CODIGO", l.ObtenerXPlaya(sa.PLAY_ID, 0, 1));
            ddl_reanudarAnden.Items.Remove(ddl_reanudarAnden.Items.FindByValue(sa.LUGA_ID.ToString()));
            lbl_tituloModal.Text = "Agregar Andén de Emergencia";
            gv_reanudarLocales.Columns[0].Visible = false;
            gv_reanudarLocales.Columns[1].Visible = false;
            btn_reanudar.Visible         = false;
            btn_emergencia.Visible       = true;
            txt_reanudarLocal.Enabled    = true;
            txt_reanudarCodLocal.Enabled = true;
            btn_agregarCarga.Enabled     = true;
            ddl_reanudarAnden.Enabled    = true;
            utils.AbrirModal(this, "modalReanudar");
            break;

        case "Locales":
            btn_loc.Visible = true;
            LimpiarLocales();
            hf_soliId.Value               = sa.SOLI_ID.ToString();
            hf_caractSolicitud.Value      = sa.CARACTERISTICAS;
            hf_localesSeleccionados.Value = sa.LOCALES;
            hf_timeStamp.Value            = sa.TIMESTAMP.ToString();
            ObtenerLocalesSolicitud(true);
            utils.CargaDropNormal(this.ddl_reanudarAnden, "SOAN_COD", "SOLICITUD_ANDEN", (DataTable)this.ViewState["andenes"]);
            ddl_reanudarAnden.SelectedValue       = string.Format("{0},{1},{2}", sa.SOLI_ID, sa.LUGA_ID, sa.SOAN_ORDEN);
            btn_reanudar.Visible                  = false;
            btn_emergencia.Visible                = false;
            lbl_tituloModal.Text                  = "Modificar Locales";
            gv_reanudarLocales.Columns[0].Visible = true;
            gv_reanudarLocales.Columns[1].Visible = true;
            txt_reanudarLocal.Enabled             = true;
            txt_reanudarCodLocal.Enabled          = true;
            btn_agregarCarga.Enabled              = true;
            ddl_reanudarAnden.Enabled             = true;
            utils.AbrirModal(this, "modalReanudar");
            break;

        case "Parcial":
            txt_fechaCarga.Text       = DateTime.Now.ToShortDateString();
            txt_horaCarga.Text        = DateTime.Now.ToShortTimeString();
            hf_soliId.Value           = sa.SOLI_ID.ToString();
            hf_soanOrden.Value        = sa.SOAN_ORDEN.ToString();
            hf_lugaId.Value           = sa.LUGA_ID.ToString();
            dv_pallets.Visible        = true;
            btn_cargaParcial.Visible  = true;
            btn_cargaTerminar.Visible = false;
            btn_loc.Visible           = false;
            utils.AbrirModal(this, "modalCarga");
            break;

        case "Continuar":
            btn_loc.Visible = false;
            LimpiarLocales();
            hf_soliId.Value               = sa.SOLI_ID.ToString();
            hf_caractSolicitud.Value      = sa.CARACTERISTICAS;
            hf_localesSeleccionados.Value = sa.LOCALES;
            hf_timeStamp.Value            = sa.TIMESTAMP.ToString();
            ObtenerLocalesSolicitud(true);
            utils.CargaDrop(ddl_reanudarAnden, "ID", "DESCRIPCION", l.ObtenerXPlaya(sa.PLAY_ID));
            btn_reanudar.Visible   = true;
            btn_emergencia.Visible = false;
            lbl_tituloModal.Text   = "Reanudar Carga";
            gv_reanudarLocales.Columns[0].Visible = true;
            gv_reanudarLocales.Columns[1].Visible = true;
            txt_reanudarLocal.Enabled             = true;
            txt_reanudarCodLocal.Enabled          = true;
            btn_agregarCarga.Enabled  = true;
            ddl_reanudarAnden.Enabled = true;
            utils.AbrirModal(this, "modalReanudar");
            break;

        case "Cargado":
            btn_loc.Visible           = false;
            dv_pallets.Visible        = false;
            btn_cargaParcial.Visible  = false;
            btn_cargaTerminar.Visible = true;
            txt_fechaCarga.Text       = DateTime.Now.ToShortDateString();
            txt_horaCarga.Text        = DateTime.Now.ToShortTimeString();
            hf_soliId.Value           = sa.SOLI_ID.ToString();
            hf_soanOrden.Value        = sa.SOAN_ORDEN.ToString();
            hf_lugaId.Value           = sa.LUGA_ID.ToString();
            utils.AbrirModal(this, "modalCarga");
            break;

        case "Edit":
            string url = string.Format("Solicitud_Carga.aspx?id={0}&type=edit", sa.SOLI_ID);
            this.Response.Redirect(url);
            break;

        case "colocar_sello":
            this.hf_soliId.Value = sa.SOLI_ID.ToString();
            this.validar_sello();
            break;

        case "validar_sello":
            this.hf_soliId.Value = sa.SOLI_ID.ToString();
            this.validado_sello();
            break;
        }
    }