Ejemplo n.º 1
0
 private void ObtenerLocales()
 {
     try
     {
         SolicitudLocalesBC s         = new SolicitudLocalesBC();
         DataTable          dtlocales = s.CargaLocalesXSolicitudTrailer(Convert.ToInt32(hf_idTrailer.Value), txt_nroViaje.Text, Convert.ToInt32(this.dropsite.SelectedValue));
         string             output    = "";
         for (int i = 0; i < dtlocales.Rows.Count; i++)
         {
             output  = output + dtlocales.Rows[i]["LOCA_COD"].ToString();
             output += (i < dtlocales.Rows.Count) ? "," : string.Empty;
         }
         locales_YMS.Value = output;
         DataColumn[] key = new DataColumn[1];
         key[0] = dtlocales.Columns["LOCA_COD"];
         dtlocales.PrimaryKey = key;
         dtlocales.Columns.Add("SELLO", Type.GetType("System.String"));
         dtlocales.Columns.Add("SOBRE", Type.GetType("System.String"));
         dtlocales.Columns.Add("CARRO", Type.GetType("System.String"));
         dtlocales.Columns.Add("EMBARQUE", Type.GetType("System.String"));
         ViewState["locales"] = dtlocales;
         gilllocal.DataSource = dtlocales;
         gilllocal.DataBind();
     }
     catch (Exception ex)
     {
     }
     dv_locales.Visible = true;
     dv_destino.Visible = false;
 }
Ejemplo n.º 2
0
    private void ObtenerLocales()
    {
        try
        {
            SolicitudLocalesBC s         = new SolicitudLocalesBC();
            DataTable          dtlocales = s.CargaLocalesXSolicitudTrailer(Convert.ToInt32(hf_idTrailer.Value), this.txt_nroViaje.Text, Convert.ToInt32(this.dropsite.SelectedValue));
            string             output    = "";
            for (int i = 0; i < dtlocales.Rows.Count; i++)
            {
                output  = output + dtlocales.Rows[i]["LOCA_COD"].ToString();
                output += (i < dtlocales.Rows.Count) ? "," : string.Empty;
            }
            locales_YMS.Value = output;
            DataColumn[] key = new DataColumn[4];
            key[0] = dtlocales.Columns["SOLI_ID"];
            key[1] = dtlocales.Columns["LUGA_ID"];
            key[2] = dtlocales.Columns["SOAN_ORDEN"];
            key[3] = dtlocales.Columns["LOCA_ID"];
            dtlocales.PrimaryKey = key;
            dtlocales.Columns.Add("SOLD_SELLO", Type.GetType("System.String"));
            ViewState["locales"] = dtlocales;
            gilllocal.DataSource = dtlocales;
            gilllocal.DataBind();
        }
        catch (Exception ex)
        {
        }

        dv_locales.Style.Add("display", "block");
        dv_destino.Style.Add("display", "none");
    }
Ejemplo n.º 3
0
    protected void btn_buscar_Click(object sender, EventArgs e)
    {
        TrailerBC trailer = new TrailerBC();

        trailer = trailer.obtenerXPlaca(txt_Patente.Text);

        if (trailer.ID == 0)
        {
            utils.ShowMessage2(this, "trailer", "warn_noExiste");
            btn_limpiar_Click(null, null);
            return;
        }
        DataSet datos = trailer.obtenerDatosSalida(txt_Patente.Text);

        if (datos.Tables.Count > 0)
        {
            DataTable dt   = datos.Tables[0];
            string    site = dt.Rows[0]["SITE_ID"].ToString();
            if (!Convert.ToBoolean(dt.Rows[0]["TRUE_SITE_IN"]))
            {
                utils.ShowMessage2(this, "trailer", "warn_fueraSite");
                btn_limpiar_Click(null, null);
                return;
            }
            if (site != dropsite.SelectedValue || string.IsNullOrEmpty(site))
            {
                utils.ShowMessage2(this, "trailer", "warn_otroSite");
                btn_limpiar_Click(null, null);
                return;
            }
            hf_idTrailer.Value    = dt.Rows[0]["TRAI_ID"].ToString();
            hf_idTran.Value       = dt.Rows[0]["TRAN_ID"].ToString();
            lblPlacaTrailer.Text  = dt.Rows[0]["PLACA"].ToString();
            lblFlotaTrailer.Text  = dt.Rows[0]["FLOTA"].ToString();
            lblFechaDatos.Text    = dt.Rows[0]["FECHA_MODIFICACION"].ToString();
            lblFechaDatos2.Text   = dt.Rows[0]["FECHA_MODIFICACION"].ToString();
            lblEstado.Text        = dt.Rows[0]["TRAILER_ESTADO"].ToString();
            lblTransportista.Text = dt.Rows[0]["TRANSPORTISTA"].ToString();
            lblTipo.Text          = dt.Rows[0]["TIPO_TRAILER"].ToString();
            lblauditoria.Text     = "En Construcción";
            lblEstadoSol.Text     = dt.Rows[0]["ESTADO_SOL"].ToString();
            dv_contenido.Attributes.Add("style", "display:block");
            lblUbicacion.Text      = dt.Rows[0]["UBICACION"].ToString();
            txt_patenteTracto.Text = dt.Rows[0]["PATENTE_TRACTO"].ToString();


            if (dt.Rows[0]["COND_ID"] != DBNull.Value)
            {
                int         cond_id = Convert.ToInt32(dt.Rows[0]["COND_ID"]);
                ConductorBC c       = new ConductorBC(cond_id);
                txt_conductorRut.Text           = utils.rutANumero(c.RUT);
                txt_conductorNombre.Text        = c.NOMBRE;
                chk_conductorExtranjero.Checked = c.COND_EXTRANJERO;
                hf_idCond.Value = cond_id.ToString();
            }
            string estado = dt.Rows[0]["TRES_ID"].ToString().ToLower();
            if (site == "10")
            {
                try
                {
                    DataTable dt3 = datos.Tables[4];
                    if (dt3.Rows[0]["Cargado"].ToString() == "NO")
                    {
                        lblEstado.Text = "VACIO";
                        estado         = "100";
                    }
                    else
                    {
                        lblEstado.Text = "CARGADO";
                        estado         = "400";
                    }
                }
                catch
                { estado = dt.Rows[0]["TRES_ID"].ToString().ToLower(); }
            }
            if (estado == "400")
            {
                try
                {
                    SolicitudLocalesBC s = new SolicitudLocalesBC();
                    gilllocal.DataSource = s.CargaLocalesXSolicitudTrailer(Convert.ToInt32(hf_idTrailer.Value), "", Convert.ToInt32(this.dropsite.SelectedValue));
                    gilllocal.DataBind();
                }
                catch
                {
                    gilllocal.DataSource = null;
                    gilllocal.DataBind();
                }
                dv_locales.Visible = true;
                dv_destino.Visible = false;
            }
            else
            {
                gilllocal.DataSource = null;
                gilllocal.DataBind();
                dv_locales.Visible = false;
                dv_destino.Visible = true;
            }

            try
            {
                datosViaje(datos.Tables[2]);
                DataRow dr = datos.Tables[3].Rows[0];
                txt_gpsActivoTracto.Text = dr["STATUS"].ToString();
                lbl_tran.Text            = dr["TRANSPORTE"].ToString();
            }
            catch
            {
                txt_gpsActivoTracto.Text = "";
                lbl_tran.Text            = "";
            }

            try
            {
                DataRow dr = datos.Tables[3].Rows[0];
                lblTemperatura.Text = dr["TEMPERATURA"].ToString();
                lblGPS.Text         = dr["STATUS"].ToString();
                lblauditoria.Text   = dr["AU"].ToString();
                lblFechaDatos2.Text = dr["fh_dato"].ToString();
            }
            catch
            {
                lblTemperatura.Text = "";
                lblGPS.Text         = "";
                lblauditoria.Text   = "";
                lblFechaDatos2.Text = "";
            }
        }
    }