Exemplo n.º 1
0
    private void carga_trailers()
    {
        TrailerBC cc = new TrailerBC();
        DataTable dt = cc.obtenerXParametro("", null, dropsite.SelectedValue);

        utils.CargaDrop(trailers, "PLACA", "PLACA", dt);
    }
Exemplo n.º 2
0
    protected void btn_bloquear_Click(object sender, EventArgs e)
    {
        TrailerBC trailer = new TrailerBC();

        if (ddTipoBloqueo.SelectedItem.Text == "Seleccione...")
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Debe Seleccionar un tipo de Bloqueo');", true);
        }
        else
        {
            string resultado;

            trailer.Bloquear(int.Parse(hf_idTrailer.Value), int.Parse(ddTipoBloqueo.SelectedValue), usuario.ID, out resultado);
            if (string.IsNullOrEmpty(resultado))
            {
                ObtenerTrailer(true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "showAalert('Operacion Realizada Correctamente');", true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal1", "modalCerrar('modalBloqueo');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('" + resultado + "');", true);
            }
        }
    }
Exemplo n.º 3
0
    protected void btn_editGrabar_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(txt_editPlaca.Text))
        {
            utils.ShowMessage2(this, "crearTrailer", "warn_placaVacia"); return;
        }
        //   if (ddl_editTran.SelectedIndex < 1) { utils.ShowMessage2(this, "crearTrailer", "warn_tranVacio"); return; }
        TrailerBC t = new TrailerBC();

        t.PLACA = txt_editPlaca.Text;
        //  t.TRAN_ID = Convert.ToInt32(ddl_editTran.SelectedValue);
        if (t.CrearGenerico(t, chk_vehiculoImportado.Checked))
        {
            this.hf_idTrailer.Value              = t.ID.ToString();
            this.txt_placaTrailer.Text           = t.PLACA;
            this.ddl_transportista.SelectedValue = t.TRAN_ID.ToString();
            btnBuscarTrailer_Click(null, null);
            utils.ShowMessage2(this, "crearTrailer", "success");
            utils.CerrarModal(this, "modalTrailer");
        }
        else
        {
            utils.ShowMessage2(this, "crearTrailer", "error");
        }
    }
Exemplo n.º 4
0
    protected void limpia(object sender, EventArgs e)
    {
        this.drop_SelectedIndexChanged(null, null);
        this.hf_trailerId.Value = "";
        this.txt_nroFlota.Text  = "";
        //this.txt_buscarPatente.Text = "";
        this.ddl_destinoZona1.ClearSelection();
        this.ddl_destinoZona2.ClearSelection();
        this.ddl_buscarPatente.ClearSelection();
        this.ddl_destinoZona1.Enabled = false;
        this.ddl_destinoZona2.Enabled = false;
        this.ddl_destinoZona1_SelectedIndexChanged(null, null);
        this.ddl_destinoZona2_SelectedIndexChanged(null, null);

        this.pnl_detalleLugar.Style.Add("background-color", "#ffffff");
        this.pnl_detalleLugar.Style.Add("color", "black");
        this.pnl_detalleTrailer.Attributes.Add("style", string.Format("background-color:{0};", "#ffffff"));
        this.pnl_imgAlerta.BackColor = System.Drawing.Color.White;
        this.img_trailer.ImageUrl    = "";
        this.lbl_origenZona.Text     = "";
        this.lbl_origenPlaya.Text    = "";
        this.txt_transporte.Text     = "";
        this.lbl_lugar.Text          = "";
        TrailerBC t = new TrailerBC();

        utils.CargaDrop(this.ddl_buscarPatente, "ID", "PLACA", t.obtenerDisponiblesDrop(Convert.ToInt32(this.dropsite.SelectedValue), false, false));
    }
Exemplo n.º 5
0
    private void llenarForm()
    {
        SolicitudBC s = new SolicitudBC();
        TrailerBC   t = new TrailerBC();
        LugarBC     l = new LugarBC();
        ZonaBC      z = new ZonaBC();

        s = s.ObtenerXId(int.Parse(hf_idSolicitud.Value));
        hf_timestamp.Value = s.TIMESTAMP.ToString();
        t = t.obtenerXID(s.ID_TRAILER);
        l = l.obtenerXID(t.LUGAR_ID);
        utils.CargaDropTodos(ddl_editZona, "ID", "DESCRIPCION", z.ObtenerXSite(s.ID_SITE, false));
        ddl_editZona.SelectedValue = l.ID_ZONA.ToString();
        ddl_editZona_IndexChanged(null, null);
        ddl_editPlaya.SelectedValue = l.ID_PLAYA.ToString();
        ddl_editPlaya_IndexChanged(null, null);
        try

        { ddl_editPos.SelectedValue = l.ID.ToString(); }
        catch (Exception e)

        {}

        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalPosicion();", true);
    }
Exemplo n.º 6
0
    private void ObtenerTrailer(bool forzarBD)
    {
        if (ViewState["lista"] == null || forzarBD)
        {
            TrailerBC t = new TrailerBC();
            t.PLACA   = txt_buscarNombre.Text;
            t.NUMERO  = txt_buscarNro.Text;
            t.EXTERNO = chk_buscarInterno.Checked;
            t.TRTI_ID = Convert.ToInt32(ddl_buscarTipo.SelectedValue);
            t.TRAN_ID = Convert.ToInt32(ddl_buscarTransportista.SelectedValue);
            t.SITE_ID = Convert.ToInt32(ddl_buscarSite.SelectedValue);
            int       zona_id = Convert.ToInt32(ddl_buscarZona.SelectedValue);
            int       play_id = Convert.ToInt32(ddl_buscarPlaya.SelectedValue);
            DataTable dt      = t.obtenerXParametro(t, zona_id, play_id);
            ViewState["lista"] = dt;
        }
        DataView dw = new DataView((DataTable)ViewState["lista"]);

        if (ViewState["sortExpresion"] != null && ViewState["sortExpresion"].ToString() != "")
        {
            dw.Sort = (String)ViewState["sortExpresion"];
        }
        this.gv_listar.DataSource = dw;
        this.gv_listar.DataBind();
    }
Exemplo n.º 7
0
 protected void btn_mover_Click(object sender, EventArgs e)
 {
     if (this.ddl_bloqLugar.SelectedIndex > 0)
     {
         TrailerBC    t = new TrailerBC().obtenerXID(int.Parse(this.hf_idTrailer.Value));
         MovimientoBC m = new MovimientoBC();
         m.ID_DESTINO = int.Parse(this.ddl_bloqLugar.SelectedValue);
         m.ID_TRAILER = t.ID;
         string resultado;
         if (m.MOVIMIENTO(t.SITE_ID, this.usuario.ID, out resultado) && resultado == "")
         {
             this.ObtenerTrailer(true);
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar4", "showAlert('Movimiento Exitoso');", true);
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar3", "cerrarModal('modalBloqueo');", true);
         }
         else
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", string.Format("alert('{0}');", resultado), true);
         }
     }
     else
     {
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Seleccione un lugar de destino');", true);
     }
 }
Exemplo n.º 8
0
    private void llenarForm()
    {
        int soli_id = int.Parse(this.Request.Params["soli_id"].ToString());

        this.hf_soliId.Value = soli_id.ToString();
        SolicitudBC        solicitud = new SolicitudBC();
        SolicitudAndenesBC sa        = new SolicitudAndenesBC();
        LugarBC            l         = new LugarBC();
        TrailerBC          t         = new TrailerBC();

        solicitud = solicitud.ObtenerXId(soli_id);
        sa        = sa.ObtenerXId(soli_id, 1);
        this.txt_buscarFecha.Text = solicitud.FECHA_CREACION.ToString("dd/MM/yyyy");
        this.txt_buscarHora.Text  = solicitud.FECHA_CREACION.ToString("hh:mm");
        this.hf_trailerId.Value   = solicitud.ID_TRAILER.ToString();
        t = t.obtenerXID(solicitud.ID_TRAILER);
        this.btnBuscar_Click(null, null);
        l = l.obtenerXID(sa.LUGA_ID);
        this.dropsite.SelectedValue = l.ID_SITE.ToString();
        this.drop_SelectedIndexChanged(null, null);
        this.ddl_destinoZona1.SelectedValue = l.ID_ZONA.ToString();
        this.ddl_destinoZona1_SelectedIndexChanged(null, null);
        this.ddl_destinoPlaya1.SelectedValue = l.ID_PLAYA.ToString();
        this.ddl_destinoPlaya1_SelectedIndexChanged(null, null);
        this.ddl_destinoPos1.SelectedValue = l.ID.ToString();
    }
Exemplo n.º 9
0
 private void llenarForm(TrailerBC trailer)
 {
     hf_idTrailer.Value         = trailer.TRAI_ID.ToString();
     txt_editPlaca.Text         = trailer.TRAI_PLACA;
     txt_editNumero.Text        = trailer.TRAI_NUMERO;
     ddl_editTipo.SelectedValue = trailer.TRAILER_TIPO.TRTI_ID.ToString();
 }
Exemplo n.º 10
0
    protected void ddl_vehiculoTipo_SelectedIndexChanged(object sender, EventArgs e)
    {
        int       trti_id = Convert.ToInt32(ddl_vehiculoTipo.SelectedValue);
        DateTime  fecha   = Convert.ToDateTime(txt_buscarFecha.Text);
        DataTable dt      = new TrailerBC().ObtenerTodo(fecha: fecha
                                                        , hora_id: Convert.ToInt32(ddl_buscarHorario.SelectedValue)
                                                        , trti_id: trti_id);

        ddl_vehiculoTrailer.Items.Clear();
        ddl_vehiculoTrailer.Items.Add(new RadComboBoxItem("Sin Vehículo", "0"));
        foreach (DataRow dr in dt.Rows)
        {
            RadComboBoxItem cb = new RadComboBoxItem(dr["TRAI_PLACA"].ToString(), dr["TRAI_ID"].ToString());
            if (dr["ID_RUTA"] != DBNull.Value)
            {
                int id_ruta = Convert.ToInt32(dr["ID_RUTA"]);
                if (id_ruta.ToString() != hf_idRuta.Value)
                {
                    cb.Enabled = false;
                }
            }
            ddl_vehiculoTrailer.Items.Add(cb);
        }
        ddl_vehiculoTrailer.SelectedIndex = 0;
    }
Exemplo n.º 11
0
    protected void btn_confirmar_Click(object sender, EventArgs e)
    {
        try
        {
            if (string.IsNullOrEmpty(hf_idCond.Value))
            {
                ConductorBC c = new ConductorBC();
                c.RUT             = txt_conductorRut.Text;
                c.NOMBRE          = txt_conductorNombre.Text;
                c.TRAN_ID         = Convert.ToInt32(ddl_transportista.SelectedValue);
                c.COND_EXTRANJERO = chk_conductorExtranjero.Checked;
                hf_idCond.Value   = c.AgregarIdentity().ToString();
            }
            MovimientoBC       mov       = new MovimientoBC();
            TrailerUltEstadoBC trailerUE = new TrailerUltEstadoBC();
            TrailerBC          trailer   = new TrailerBC();

            mov.FECHA_CREACION = DateTime.Now;
            mov.ID_ESTADO      = 10;
            mov.OBSERVACION    = txt_obs.Text;
            DateTime fh = DateTime.Parse(string.Format("{0} {1}", txt_ingresoFecha.Text, txt_ingresoHora.Text));
            mov.FECHA_ORIGEN  = fh;
            mov.ID_DESTINO    = Convert.ToInt32(this.ddl_posicion.SelectedValue);
            mov.FECHA_DESTINO = fh.AddMinutes(30);

            mov.PATENTE_TRACTO = txt_buscarPatente.Text;

            mov.MANT_EXTERNO = false;
            mov.ID_TRAILER   = 0;
            trailer.ID       = 0;
            trailer.PLACA    = "";

            trailer.TRAN_ID = Convert.ToInt32(ddl_transportista.SelectedValue);

            trailerUE.SITE_ID       = Convert.ToInt32(dropsite.SelectedValue); // 1; // Cambiar después de introducir variables de sesión
            trailerUE.CHOFER_RUT    = utils.formatearRut(txt_conductorRut.Text);
            trailerUE.CHOFER_NOMBRE = txt_conductorNombre.Text;
            trailerUE.ACOMP_RUT     = txt_acomRut.Text;

            trailerUE.COND_ID = Convert.ToInt32(hf_idCond.Value);

            UsuarioBC usuario = (UsuarioBC)Session["USUARIO"];
            string    resultado;
            bool      ejecucion = mov.ProcesoEntrada(mov, trailerUE, trailer, usuario.ID, out resultado);
            if (ejecucion && resultado == "")
            {
                utils.ShowMessage2(this, "confirmar", "success");
                limpiarTodo();
            }
            else
            {
                utils.ShowMessage(this, resultado, "error", false);
            }
        }
        catch (Exception ex)
        {
            utils.ShowMessage(this, ex.Message, "error", false);
        }
    }
Exemplo n.º 12
0
    protected void btn_buscarTrailer_Click(object sender, EventArgs e)
    {
        hf_traiId.Value = "";
        carga_trailers();
        DataTable dt2 = (DataTable)ViewState["locales"];

        if (dt2.Rows.Count == 0)
        {
            hf_traiId.Value         = "";
            txt_trailerPatente.Text = "";
            txt_trailerNro.Text     = "";
            //txt_trailerTransporte.Text = "";
            utils.ShowMessage2(this, "buscarTrailer", "warn_andenLocalVacio");
            return;
        }
        else
        {
            TrailerBC trailer = (!string.IsNullOrEmpty(txt_trailerNro.Text)) ? new TrailerBC().obtenerXNro(txt_trailerNro.Text) : new TrailerBC().obtenerXPlaca(txt_trailerPatente.Text);
            int       old_id  = Convert.ToInt32(hf_traiIdOld.Value);
            if (old_id == trailer.ID)
            {
                ddl_playaDescarga.Enabled = false;
                ddl_playaDescarga.ClearSelection();
                ddl_playaDescarga_SelectedIndexChanged(null, null);
                hf_traiId.Value         = trailer.ID.ToString();
                txt_trailerPatente.Text = trailer.PLACA;
                txt_trailerNro.Text     = trailer.NUMERO;
                txt_trailerShortek.Text = trailer.ID_SHORTEK;
                // txt_trailerTransporte.Text = trailer.TRANSPORTISTA.ToString();
                utils.ShowMessage2(this, "buscarTrailer", "success");
            }
            else if (ComprobarTrailer(trailer))
            {
                ddl_playaDescarga.Enabled = true;
                ddl_playaDescarga_SelectedIndexChanged(null, null);
                hf_traiId.Value         = trailer.ID.ToString();
                txt_trailerPatente.Text = trailer.PLACA;
                txt_trailerNro.Text     = trailer.NUMERO;
                txt_trailerShortek.Text = trailer.ID_SHORTEK;
                //  txt_trailerTransporte.Text = trailer.TRANSPORTISTA.ToString();
                utils.ShowMessage2(this, "buscarTrailer", "success");
            }
            else
            {
                ddl_playaDescarga.Enabled = false;
                ddl_playaDescarga.ClearSelection();
                ddl_playaDescarga_SelectedIndexChanged(null, null);
                hf_traiId.Value         = "";
                txt_trailerPatente.Text = "";
                txt_trailerNro.Text     = "";
                //  txt_trailerTransporte.Text = "";
                utils.ShowMessage2(this, "buscarTrailer", "warn_andenLocalVacio");
                return;
            }
        }
    }
Exemplo n.º 13
0
    private bool comprobarTrailerEx()
    {
        SolicitudBC s = new SolicitudBC();

        s = s.ObtenerXId(int.Parse(this.hf_idSolicitud.Value));
        TrailerBC t = new TrailerBC();

        t = t.obtenerXID(s.ID_TRAILER);
        return(t.EXTERNO);
    }
Exemplo n.º 14
0
    protected void btn_editGrabar_Click(object sender, EventArgs e)
    {
        ServiciosExternosVehiculosBC s = new ServiciosExternosVehiculosBC();

        s = this.LlenarBC();
        TrailerBC t = new TrailerBC();

        t = t.obtenerXPlaca(s.PLACA);
        if (t.ID > 0)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Patente corresponde a Trailer');", true);
        }
        else if (this.utils.patentevalida(s.PLACA) == true)
        {
            if (string.IsNullOrEmpty(this.hf_id.Value))
            {
                if (s.ObtenerXPlaca(s.PLACA).SEVE_ID > 0)
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Patente existente');", true);
                }
                else if (s.Crear())
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "showAlert('Vehículo agregado correctamente');", true);
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalEditar');", true);
                    this.ObtenerServicios(true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Error');", true);
                }
            }
            else
            {
                s.SEVE_ID = Convert.ToInt32(this.hf_id.Value);
                if (s.ObtenerXPlaca(s.PLACA).SEVE_ID > 0)
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Patente existente');", true);
                }
                else if (s.Modificar())
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "showAlert('Vehículo modificado correctamente');", true);
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalEditar');", true);
                    this.ObtenerServicios(true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Error');", true);
                }
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Patente Invalida');", true);
        }
    }
Exemplo n.º 15
0
    protected void txt_editPlaca_TextChanged(object sender, EventArgs e)
    {
        TrailerBC t = new TrailerBC().obtenerXPlaca(txt_editPlaca.Text);

        if (t.ID != 0)
        {
            utils.ShowMessage2(this, "agregarTrailer", "warn_placaExiste");
            txt_editPlaca.Text = "";
            txt_editPlaca.Focus();
        }
    }
Exemplo n.º 16
0
    public void btn_guarda_cambios_click(object sender, EventArgs e)
    {
        LugarBC lugar = new LugarBC();

        lugar.ID = int.Parse(this.hf_idLugar.Value);
        TrailerBC t = new TrailerBC();

        t.NUMERO = this.txt_nroTrailer.Text;

        if (this.rb_tracto.Checked == true)
        {
            t.PATENTE_TRACTO = this.txt_placaTracto.Text;

            t.ID = 0;
            string msj;

            if (lugar.Cuadratura(this.usuario.ID, t, "", out msj) && msj == "")
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalPendientes');", true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('cambios realizados correctamente!');", true);
                this.recargaplayas(null, null);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", string.Format("alert('{0}');", msj), true);
            }
        }
        else
        {
            if (this.rb_trailer.Checked)
            {
                t.PLACA = this.txt_placaTrailer.Text;
                t.ID    = Convert.ToInt32(this.hf_idTrailer.Value);
            }
            else if (this.rb_vacio.Checked)
            {
                t.PLACA = "";
                t.ID    = 0;
            }
            t.PATENTE_TRACTO = "";

            string msj;
            if (lugar.Cuadratura(this.usuario.ID, t, this.ddl_estadoTrailer.SelectedValue, out msj) && msj == "")
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalPendientes');", true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('cambios realizados correctamente!');", true);
                this.recargaplayas(null, null);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", string.Format("alert('{0}');", msj), true);
            }
        }
    }
Exemplo n.º 17
0
 protected void btn_editGuardar_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txt_editPlaca.Text))
     {
         utils.ShowMessage2(this, "modificar", "warn_placaVacia"); return;
     }
     if (ddl_editTipo.SelectedIndex < 1)
     {
         utils.ShowMessage2(this, "modificar", "warn_tipoVacio"); return;
     }
     try
     {
         TrailerBC trailer = new TrailerBC();
         trailer.TRAI_PLACA  = txt_editPlaca.Text;
         trailer.TRAI_NUMERO = txt_editNumero.Text;
         if (ddl_editTipo.SelectedIndex > 0)
         {
             trailer.TRAILER_TIPO.TRTI_ID = Convert.ToInt32(ddl_editTipo.SelectedValue);
         }
         trailer.TRAI_COD = txt_editPlaca.Text;
         if (hf_idTrailer.Value == "")
         {
             if (trailer.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_nuevo");
                 utils.CerrarModal(this, "modalEdit");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error_nuevo");
             }
         }
         else
         {
             trailer.TRAI_ID = Convert.ToInt32(hf_idTrailer.Value);
             if (trailer.Guardar())
             {
                 utils.ShowMessage2(this, "guardar", "success_modificar");
             }
             else
             {
                 utils.ShowMessage2(this, "guardar", "error_modificar");
             }
         }
     }
     catch (Exception ex)
     {
         utils.ShowMessage(this, ex.Message, "error", false);
     }
     finally
     {
         ObtenerTrailer(true);
     }
 }
Exemplo n.º 18
0
    protected void txt_buscarDoc_TextChanged(object sender, EventArgs e)
    {
        TrailerBC trailer = new TrailerBC();

        trailer = trailer.obtenerXDoc(txt_buscarDoc.Text, dropsite.SelectedValue);
        if (trailer.ID != 0)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Documento ya existente.');", true);
            txt_buscarDoc.Text = "";
            txt_buscarDoc.Focus();
        }
    }
Exemplo n.º 19
0
 private void llenarForm(TrailerBC trailer)
 {
     this.hf_idTrailer.Value = trailer.ID.ToString();
     //   txt_editCodigo.Text = trailer.CODIGO;
     this.txt_editPlaca.Text         = trailer.PLACA;
     this.chk_editExterno.Checked    = trailer.EXTERNO;
     this.txt_editNumero.Text        = trailer.NUMERO;
     this.ddl_editTran.SelectedValue = trailer.TRAN_ID.ToString();
     this.ddl_editTipo.SelectedValue = trailer.TRTI_ID.ToString();
     this.hf_excluyentes.Value       = trailer.EXCLUYENTES;
     this.hf_noexcluyentes.Value     = trailer.NO_EXCLUYENTES;
 }
Exemplo n.º 20
0
    protected void drop_SelectedIndexChanged(object sender, EventArgs e)
    {
        TrailerBC t = new TrailerBC();
        ZonaBC    z = new ZonaBC();

        z.DESCRIPCION = "";
        z.SITE_ID     = Convert.ToInt32(this.dropsite.SelectedValue);
        z.ZOTI_ID     = 200;
        utils.CargaDrop(this.ddl_destinoZona1, "ID", "DESCRIPCION", z.ObtenerXParametros());
        utils.CargaDrop(this.ddl_destinoZona2, "ID", "DESCRIPCION", z.ObtenerXParametros());
        utils.CargaDrop(this.ddl_buscarPatente, "ID", "PLACA", t.obtenerDisponiblesDrop(Convert.ToInt32(this.dropsite.SelectedValue), false, false));
    }
Exemplo n.º 21
0
    protected void txt_editPlaca_TextChanged(object sender, EventArgs e)
    {
        TrailerBC t = new TrailerBC();

        t = t.obtenerXPlaca(txt_editPlaca.Text);
        if (t.ID != 0 && t.ID != null)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer ya existe en la base de datos!');", true);
            txt_editPlaca.Text = "";
            txt_editPlaca.Focus();
        }
    }
Exemplo n.º 22
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");
        }
    }
Exemplo n.º 23
0
 private void llenarForm(TrailerBC trailer)
 {
     hf_idTrailer.Value      = trailer.ID.ToString();
     txt_editPlaca.Text      = trailer.PLACA;
     chk_editExterno.Checked = trailer.EXTERNO;
     cambia_interno(null, null);
     txt_editNumero.Text            = trailer.NUMERO;
     ddl_editTran.SelectedValue     = trailer.TRAN_ID.ToString();
     ddl_editTipo.SelectedValue     = trailer.TRTI_ID.ToString();
     hf_excluyentes.Value           = trailer.EXCLUYENTES;
     hf_noexcluyentes.Value         = trailer.NO_EXCLUYENTES;
     ddl_editShorteck.SelectedValue = trailer.ID_SHORTEK;
 }
Exemplo n.º 24
0
    private void ObtenerPreIngresos(bool forzarBD)
    {
        if (ViewState["lista"] == null || forzarBD)
        {
            TrailerBC trailer = new TrailerBC();
            DataTable dt      = trailer.obtener_pre_ingresos(Convert.ToInt32(ddl_buscarSite.SelectedValue), Convert.ToInt32(ddl_buscarProveedor.SelectedValue), txt_buscarDesde.Text, txt_buscarHasta.Text);
            ViewState["lista"] = dt;
        }
        DataView dw = new DataView((DataTable)ViewState["lista"]);

        this.gv_listar.DataSource = dw.ToTable();
        this.gv_listar.DataBind();
    }
Exemplo n.º 25
0
    protected void txt_editPlaca_TextChanged(object sender, EventArgs e)
    {
        TrailerBC t = new TrailerBC();

        t = t.obtenerXPlaca(this.txt_editPlaca.Text);
        if (t.ID != 0)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer ya existe en la base de datos!');", true);
            this.txt_editPlaca.Text = "";
            this.txt_editPlaca.Focus();
        }
        utils.ShowMessage2(this, "buscarConductor", "warn_rutNovalido");
    }
Exemplo n.º 26
0
    protected void gv_listar_RowEditing(object sender, GridViewEditEventArgs e)
    {
        TrailerBC t = new TrailerBC();

        this.gv_listar.SelectedIndex = e.NewEditIndex;

        this.hf_idTrailer.Value = this.gv_listar.DataKeys[this.gv_listar.SelectedIndex].Value.ToString();

        t = t.obtenerXID(int.Parse(this.hf_idTrailer.Value));
        this.llenarForm(t);

        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "llenarForm", "llenarForm();", true);
        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalEditarTrailer();", true);
    }
Exemplo n.º 27
0
    public TrailerBC(int id)
    {
        this.ID = id;
        TrailerBC t = this.obtenerXID();

        this.PLACA           = t.PLACA;
        this.CODIGO          = t.CODIGO;
        this.EXTERNO         = t.EXTERNO;
        this.NUMERO          = t.NUMERO;
        this.TRAN_ID         = t.TRAN_ID;
        this.TRANSPORTISTA   = t.TRANSPORTISTA;
        this.CARACTERISTICAS = t.CARACTERISTICAS;
        this.EXCLUYENTES     = t.EXCLUYENTES;
        this.NO_EXCLUYENTES  = t.NO_EXCLUYENTES;
        this.TRTI_ID         = t.TRTI_ID;
        this.TIPO            = t.TIPO;
        this.BLOQUEADO       = t.BLOQUEADO;
        this.SITE_ID         = t.SITE_ID;
        this.SITE_IN         = t.SITE_IN;
        this.LUGAR_ID        = t.LUGAR_ID;
        this.LUGAR           = t.LUGAR;
        this.SOCA_ID         = t.SOCA_ID;
        this.SOLI_ID         = t.SOLI_ID;
        this.CARGADO         = t.CARGADO;
        this.PROV_ID         = t.PROV_ID;
        this.MOVI_ID         = t.MOVI_ID;
        this.MOES_ID         = t.MOES_ID;
        this.FECHA_INGRESO   = t.FECHA_INGRESO;
        this.FECHA_RETIRO    = t.FECHA_RETIRO;
        this.DOC_INGRESO     = t.DOC_INGRESO;
        this.SELLO_INGRESO   = t.SELLO_INGRESO;
        this.SELLO_CARGA     = t.SELLO_CARGA;
        this.CHOFER_RUT      = t.CHOFER_RUT;
        this.CHOFER_NOMBRE   = t.CHOFER_NOMBRE;
        this.ACOMP_RUT       = t.ACOMP_RUT;
        this.SOLI_ID         = t.SOLI_ID;
        this.SOES_ID         = t.SOES_ID;
        this.OBSERVACION     = t.OBSERVACION;
        this.PATENTE_TRACTO  = t.PATENTE_TRACTO;
        this.TRES_ID         = t.TRES_ID;
        this.USUA_ID         = t.USUA_ID;
        this.TCAR_ID         = t.TCAR_ID;
        this.TIIC_ID         = t.TIIC_ID;
        this.MOIC_ID         = t.MOIC_ID;
        this.PRING_ID        = t.PRING_ID;
        this.DEST_ID         = t.DEST_ID;
        this.LOCA_ID         = t.LOCA_ID;
        this.COND_ID         = t.COND_ID;
        this.REQ_SELLO       = t.REQ_SELLO;
    }
Exemplo n.º 28
0
    //private void CreaGrafico()
    //{
    //    string[] script = (string[])ViewState["script"];
    //    int cont = 0;
    //    DataTable dt = (DataTable)ViewState["grafico"];
    //    foreach (DataRow dr in dt.Rows)
    //    {
    //        cont++;
    //        ClientScript.RegisterStartupScript(this.GetType(), "grafico_" + dr["SITE_ID"].ToString(), script[cont], true);
    //        //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "grafico_" + dr["SITE_ID"].ToString(), script , true);
    //    }
    //}

    private string CreaTablas()
    {
        DataSet   ds = new DataSet();
        TrailerBC t  = new TrailerBC();

        ds = t.CargaGrafico();
        StringBuilder sb      = new StringBuilder();
        DataTable     dtSites = ds.Tables[0];

        ViewState["grafico"] = dtSites;
        int cont = 0;

        foreach (DataRow dr in dtSites.Rows)
        {
            sb.Append("<div class='col-xs-3'>").
            Append("<div class='col-xs-12'>").
            Append("<center>").
            Append("<h4>").
            Append(dr["SITE_DESC"].ToString()).
            Append("</h4>").
            Append("</center>");
            DataView dwSite = ds.Tables[1].AsDataView();
            dwSite.RowFilter = "SITE_ID = " + dr["SITE_ID"].ToString();
            DataTable dtSite = dwSite.ToTable();
            sb.Append(CreaTablaSite(dtSite));
            string datos   = DatosGrafico(dtSite);
            string labels  = LabelsGrafico(dtSite);
            string colores = ColoresGrafico(dtSite);
            sb.Append("</div>").
            Append("<div class='col-xs-12 separador'>").
            Append("</div>").
            Append("<div class='col-xs-12'>").
            Append("<canvas id='pieChart_").
            Append(dr["SITE_ID"].ToString()).
            //Append("' width='200' height='200'>").
            Append("' role='img'></canvas>").
            Append("</div>").
            Append("</div>");
            hf_script.Value += "cargaGrafico(" + dr["SITE_ID"].ToString() + "," + datos + "," + labels + "," + colores + ");";
            cont++;
        }
        DataTable dtRuta = ds.Tables[2];

        lbl_ruta.Text = dtRuta.Rows[0]["CANTIDAD"].ToString();
        cont++;
        //ViewState["script"] = script;
        hf_html.Value = sb.ToString();
        return(sb.ToString());
    }
Exemplo n.º 29
0
    protected void btn_editGrabar_Click(object sender, EventArgs e)
    {
        TrailerBC t = new TrailerBC();

        t.PLACA   = txt_editPlaca.Text;
        t.TRAN_ID = int.Parse(ddl_editTran.SelectedValue);
        if (t.CrearGenerico(t, extranjero.Checked))
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('Trailer agregado correctamente.');", true);
            this.hf_idTrailer.Value              = t.ID.ToString();
            this.txt_buscarPatente.Text          = t.PLACA;
            this.ddl_transportista.SelectedValue = t.TRAN_ID.ToString();
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "$('#modalTrailer').modal('hide');", true);
        }
    }
Exemplo n.º 30
0
    protected void btn_editGrabar_Click(object sender, EventArgs e)
    {
        TrailerBC t = new TrailerBC();

        t.PLACA   = this.txt_editPlaca.Text;
        t.TRAN_ID = Convert.ToInt32(this.ddl_editTran.SelectedValue);
        if (t.CrearGenerico(t, false))
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer agregado correctamente.');", true);
            this.hf_idTrailer.Value              = t.ID.ToString();
            this.txt_buscarPatente.Text          = t.PLACA;
            this.ddl_transportista.SelectedValue = t.TRAN_ID.ToString();
            utils.CerrarModal(this, "modalTrailer");
        }
    }