コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //this.nuevo_trailer.ButtonClickDemo += new EventHandler(trailercreado);
        if (!this.IsPostBack)
        {
            this.CreaDataTable();

            //     Page.LoadComplete += new EventHandler(Page_LoadComplete);
            this.txt_ingresoFecha.Text = DateTime.Now.ToShortDateString();
            this.txt_ingresoHora.Text  = DateTime.Now.ToShortTimeString();
            TransportistaBC tran      = new TransportistaBC();
            ProveedorBC     proveedor = new ProveedorBC();
            CargaTipoBC     c         = new CargaTipoBC();
            YMS_ZONA_BC     yms       = new YMS_ZONA_BC();
            DataTable       ds        = yms.ObteneSites(((UsuarioBC)this.Session["Usuario"]).ID);
            utils.CargaDropNormal(this.dropsite, "ID", "NOMBRE", ds);
            this.drop_SelectedIndexChanged(null, null);

            LugarBC lugar = new LugarBC();
            utils.CargaDrop(this.ddl_proveedor, "ID", "DESCRIPCION", proveedor.obtenerTodo());
            this.ddl_proveedor.SelectedValue = ((UsuarioBC)this.Session["Usuario"]).ID_PROVEEDOR.ToString();
            //  utils.CargaDrop(ddl_zona, "ID", "DESCRIPCION", zona.ObtenerTodas());
            utils.CargaDrop(this.ddl_transportista, "ID", "NOMBRE", tran.ObtenerTodos());
            utils.CargaDrop(this.ddl_editTran, "ID", "NOMBRE", tran.ObtenerTodos());
            utils.CargaDrop(this.ddl_tipo_carga, "ID", "DESCRIPCION", yms.obtenerTipoCarga(null, true, false));
        }
    }
コード例 #2
0
    protected void gv_listaPosicion_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        LugarBC lugar = new LugarBC();

        if (e.CommandName == "ELIMINAR")
        {
            hf_idPosicion.Value = e.CommandArgument.ToString();
            lugar = lugar.obtenerXID(int.Parse(hf_idPosicion.Value));
            lblRazonEliminacion.Text = "Eliminar Posicion";
            msjEliminacion.Text      = "Se eliminará la posición seleccionada, ¿desea continuar?";
            btnModalEliminar.Attributes.Remove("onclick");
            btnModalEliminar.Attributes.Add("onclick", "eliminarPosicion();");
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalConfirmacion();", true);
        }
        if (e.CommandName == "HABILITAR")
        {
            hf_idPosicion.Value = e.CommandArgument.ToString();
            lugar = lugar.obtenerXID(int.Parse(hf_idPosicion.Value));
            lblRazonEliminacion.Text = "Habilitar/Deshabilitar Posicion";
            msjEliminacion.Text      = "Se habilitará/deshabilitará la posición seleccionada, ¿desea continuar?";
            btnModalEliminar.Attributes.Remove("onclick");
            btnModalEliminar.Attributes.Add("onclick", "habilitarPosicion();");
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalConfirmacion();", true);
        }
    }
コード例 #3
0
    protected void ObtenerPosicion(bool forzarBD)
    {
        if (ViewState["lista"] == null || forzarBD)
        {
            LugarBC   lugar = new LugarBC();
            DataTable dt    = lugar.ObtenerTodos1(-1, -1);
            ViewState["lista"] = dt;
            ViewState.Remove("filtrados");
        }
        DataView dw;

        if (ViewState["filtrados"] == null)
        {
            dw = new DataView((DataTable)ViewState["lista"]);
        }
        else
        {
            dw = new DataView((DataTable)ViewState["filtrados"]);
        }
        if (ViewState["sortExpresion"] != null && ViewState["sortExpresion"].ToString() != "")
        {
            dw.Sort = (String)ViewState["sortExpresion"];
        }
        this.gv_listar.DataSource = dw;
        this.gv_listar.DataBind();
    }
コード例 #4
0
    private void llenarForm()
    {
        int soli_id = Convert.ToInt32(Request.Params["soli_id"].ToString());

        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);
        txt_buscarFecha.Text = solicitud.FECHA_CREACION.ToString("dd/MM/yyyy");
        txt_buscarHora.Text  = solicitud.FECHA_CREACION.ToString("hh:mm");
        hf_trailerId.Value   = solicitud.ID_TRAILER.ToString();
        t = t.obtenerXID(solicitud.ID_TRAILER);
        txt_buscarPatente.Text = t.PLACA;
        btnBuscar_Click(null, null);
        l = l.obtenerXID(sa.LUGA_ID);
        dropsite.SelectedValue = l.ID_SITE.ToString();
        drop_SelectedIndexChanged(null, null);
        ddl_destinoZona.SelectedValue = l.ID_ZONA.ToString();
        ddl_destinoZona_SelectedIndexChanged(null, null);
        ddl_destinoPlaya.SelectedValue = l.ID_PLAYA.ToString();
        ddl_destinoPlaya_SelectedIndexChanged(null, null);
        ddl_destinoPos.SelectedValue = l.ID.ToString();
    }
コード例 #5
0
    protected void llenaformulario(object sender, EventArgs e)
    {
        //    cargaYMS(false);
        //  uptform.Controls.Clear();

        LugarBC lugar = new LugarBC();

        lugar = lugar.obtenerXID(Int32.Parse(id_destino_formulario.Value.Replace("lug_", "")));


        if (solicitudMovimiento.SelectedValue == "1" || 1 == 1)

        {
            //  Spinner1 = (control_descarga)LoadControl("~/control_descarga.ascx");
            solicud_descarga.Visible   = true;
            this.btn_confirmar.Enabled = solicud_descarga.carga(DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), Convert.ToInt32(dropsite.SelectedValue), trailer_seleccionado.Value, lugar.ID, lugar.ID_PLAYA, lugar.ID_ZONA);


            //    ScriptManager.GetCurrent(this.Page).RegisterAsyncPostBackControl(Spinner1);

            //   uptform.Controls.Add(Spinner1);

            //   AsyncPostBackTrigger trigger1 = new AsyncPostBackTrigger();
            //   trigger1.EventName = "selectedindexchanged";
            //   trigger1.ControlID = Spinner1.FindControl("ddl_origenZona").UniqueID;
            //   this.UPT.Triggers.Add(trigger1);
        }

        UPT.Update();

        this.ClientScript.RegisterStartupScript(this.GetType(), "modal2", " $('#ModalFiltro').modal();");
    }
コード例 #6
0
 public void ddl_destinoPlaya_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!(ddl_destinoPlaya.SelectedIndex == 0) || (ddl_destinoZona.SelectedIndex == 0))
     {
         int         id_playa = int.Parse(ddl_destinoPlaya.SelectedValue);
         LugarBC     lugar    = new LugarBC();
         YMS_ZONA_BC yms      = new YMS_ZONA_BC();
         DataTable   ds1      = yms.Obtenerlugares_playa(id_playa, null, "0");
         utils.CargaDrop(ddl_destinoPos, "ID", "DESCRIPCION", ds1);
         if (ddl_destinoPos.Items.Count > 1)
         {
             ddl_destinoPos.Enabled = true;
         }
         else
         {
             ddl_destinoPos.Enabled = false;
         }
     }
     else
     {
         ddl_destinoPos.SelectedIndex = 0;
         ddl_destinoPos.Enabled       = false;
     }
     ButtonClickDemo(null, null);
 }
コード例 #7
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);
    }
コード例 #8
0
    protected void ddl_buscarPlaya_SelectedIndexChanged(object sender, EventArgs e)
    {
        LugarBC l       = new LugarBC();
        int     play_id = Convert.ToInt32(this.ddl_buscarPlaya.SelectedValue);
        int     site_id = Convert.ToInt32(ddl_buscarSite.SelectedValue);

        this.utils.CargaDropTodos(this.ddl_buscarAnden, "ID", "DESCRIPCION", l.ObtenerTodos1(-1, 1, -1, play_id, 0, site_id, 100));
    }
コード例 #9
0
    protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName != "Page")
        {
            //      int index = int.Parse(e.CommandArgument.ToString());
            string[] arg = new string[3];
            arg = e.CommandArgument.ToString().Split(';');
            this.hf_idSolicitud.Value = arg[0]; //  index.ToString();// gv_listar.DataKeys[index].Values[0].ToString();
            this.hf_idLugar.Value     = arg[1]; // gv_listar.DataKeys[index].Values[1].ToString();
            this.hf_orden.Value       = arg[2]; // gv_listar.DataKeys[index].Values[2].ToString();
            this.txt_fechaCarga.Text  = DateTime.Now.ToString("dd/MM/yyyy");
            this.txt_horaCarga.Text   = DateTime.Now.ToShortTimeString();
            this.hf_idEstado.Value    = e.CommandName;
            switch (e.CommandName)
            {
            case "Cargado":
                this.dv_pallets.Visible = false;
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalCarga();", true);
                break;

            case "Parcial":
                this.dv_pallets.Visible = true;
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalCarga();", true);
                break;

            case "Continuar":
                SolicitudBC s = new SolicitudBC();
                LugarBC     l = new LugarBC();
                s = s.ObtenerXId(int.Parse(this.hf_idSolicitud.Value));
                this.drops.Lugar1(this.ddl_origenAnden, 0, s.PLAY_ID, 0, 1);
                this.hf_caractSolicitud.Value      = s.CARACTERISTICAS;
                this.hf_localesSeleccionados.Value = s.LOCALES;
                this.hf_timeStamp.Value            = s.TIMESTAMP.ToString();
                DataTable dsol = s.ObtenerAndenesXSolicitudId(s.SOLI_ID);
                this.ViewState["datosA"]      = dsol;
                this.gv_solLocales.DataSource = dsol;
                this.gv_solLocales.DataBind();
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalReanudar();", true);
                break;

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

                //    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('" + hf_idSolicitud.Value + "');", true);
                break;

            case "colocar_sello":
                this.validar_sello();
                break;

            case "validar_sello":
                this.validado_sello();
                break;
            }
        }
    }
コード例 #10
0
    protected void rb_pos_CheckedChanged(object sender, EventArgs e)
    {
        if (hf_idTrailer.Value != "")
        {
            if (rb_posAuto.Checked)
            {
                CargaTipoBC ct = new CargaTipoBC();
                if (ct.CargaDestinos(int.Parse(this.ddl_tipo_carga.SelectedValue)).Rows.Count == 0)
                {
                    LugarBC l = new LugarBC();
                    ddl_zona.Enabled     = false;
                    ddl_playa.Enabled    = false;
                    ddl_posicion.Enabled = false;
                    l = l.obtenerLugarAuto(int.Parse(dropsite.SelectedValue), usuario.ID, null);
                    if (l.ID == 0 || l.ID == null)
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Error. Intente designar un lugar manualmente.');", true);
                    }
                    else
                    {
                        PlayaBC p    = new PlayaBC();
                        ZonaBC  zona = new ZonaBC();
                        try
                        {
                            ddl_zona.SelectedValue = l.ID_ZONA.ToString();
                        }
                        catch (Exception ex)
                        {
                            zona = zona.ObtenerXId(l.ID_ZONA);
                            ddl_zona.Items.Add(new System.Web.UI.WebControls.ListItem(zona.DESCRIPCION, zona.ID.ToString()));
                            ddl_zona.SelectedValue = zona.ID.ToString();
                        }


                        utils.CargaDrop(this.ddl_playa, "ID", "DESCRIPCION", p.ObtenerXZona(l.ID_ZONA));
                        ddl_playa.SelectedValue = l.ID_PLAYA.ToString();
                        LugarBC    lugar = new LugarBC();
                        CargaDrops drops = new CargaDrops();
                        drops.Lugar1(ddl_posicion, 0, l.ID_PLAYA, 0, 1);
                        //utils.CargaDrop(this.ddl_posicion, "ID", "DESCRIPCION", lugar.ObtenerXPlaya(l.ID_PLAYA));
                        ddl_posicion.SelectedValue = l.ID.ToString();
                    }
                }
            }
            else
            {
                ddl_zona.Enabled = true;
                if (ddl_playa.SelectedIndex > 0)
                {
                    ddl_playa.Enabled = true;
                }
                if (ddl_posicion.SelectedIndex > 0)
                {
                    ddl_posicion.Enabled = true;
                }
            }
        }
    }
コード例 #11
0
    public void btn_pendienteClick(object sender, EventArgs e)
    {
        LugarBC   lugar    = new LugarBC();
        int       id_lugar = int.Parse(this.hf_idLugar.Value);
        DataTable dt       = lugar.obtenerSolicitudesPendientesXLugar(id_lugar);

        this.gv_solicitudesPendientes.DataSource = dt;
        this.gv_solicitudesPendientes.DataBind();

        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "$('#modalPendientes').modal();", true);
    }
コード例 #12
0
    protected void gv_listaPosicion_RowEditing(object sender, GridViewEditEventArgs e)
    {
        LugarBC lugar = new LugarBC();

        gv_listar.SelectedIndex = e.NewEditIndex;
        hf_idPosicion.Value     = this.gv_listar.SelectedDataKey.Value.ToString();

        lugar = lugar.obtenerXID(int.Parse(this.gv_listar.SelectedDataKey.Value.ToString()));
        llenarForm(lugar);
        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalEditarPosicion();", true);
    }
コード例 #13
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);
            }
        }
    }
コード例 #14
0
 public bool Modificar(LugarBC lugar, out string mensaje)
 {
     try
     {
         mensaje = "";
         return(tran.Lugar_Modificar(lugar));
     }
     catch (Exception ex)
     {
         mensaje = ex.Message;
         return(false);
     }
 }
コード例 #15
0
    protected void btn_EliminarPosicion_Click(object sender, EventArgs e)
    {
        LugarBC lugar = new LugarBC();

        if (lugar.Eliminar(int.Parse(hf_idPosicion.Value)))
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Posicion eliminado exitosamente');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Ocurrió un error al eliminar lugar. Revise si tiene otros datos asociados');", true);
        }
        ObtenerPosicion(true);
    }
コード例 #16
0
 private void llenarForm(LugarBC lugar)
 {
     txt_editCodigo.Text        = lugar.CODIGO.ToString();
     txt_editDesc.Text          = lugar.DESCRIPCION;
     ddl_editSite.SelectedValue = lugar.ID_SITE.ToString();
     ddl_editSite_onChange(null, null);
     try
     {
         ddl_editZona.SelectedValue = lugar.ID_ZONA.ToString();
         ddl_editZona_onChange(null, null);
         ddl_editPlaya.SelectedValue = lugar.ID_PLAYA.ToString();
     }
     catch (Exception ex)
     { }
 }
コード例 #17
0
    protected void btn_habilitarPosicion_Click(object sender, EventArgs e)
    {
        LugarBC lugar   = new LugarBC();
        string  mensaje = "";

        if (lugar.Habilitar(int.Parse(hf_idPosicion.Value), out mensaje))
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Posicion habilitado/deshabilitado');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('" + mensaje + "');", true);
        }
        ObtenerPosicion(true);
        btn_buscarPosicion_Click(null, null);
    }
コード例 #18
0
    protected void DDL_playa_INDEX_CHANGED(object SENDER, EventArgs E)
    {
        DropDownList ddl_playa = (DropDownList)SENDER;
        DropDownList ddl_lugar = (DropDownList)panel_ddl.FindControl(ddl_playa.ID.Replace("PLAYA", "LUGAR"));

        if (!string.IsNullOrEmpty(ddl_playa.SelectedValue) && ddl_playa.SelectedValue != "0")
        {
            ddl_lugar.Enabled = true;
            LugarBC l = new LugarBC();
            utils.CargaDrop(ddl_lugar, "ID", "DESCRIPCION", l.obtenerLugaresXPlayaDrop(Convert.ToInt32(ddl_playa.SelectedValue)));
        }
        else
        {
            ddl_lugar.ClearSelection();
            ddl_lugar.Enabled = false;
        }
    }
コード例 #19
0
 protected void ddl_playa_SelectedIndexChanged(object sender, EventArgs e)
 {
     if ((this.ddl_playa.SelectedIndex != 0) && (this.ddl_zona.SelectedIndex != 0))
     {
         int         id_playa = int.Parse(this.ddl_playa.SelectedValue);
         LugarBC     lugar    = new LugarBC();
         YMS_ZONA_BC yms      = new YMS_ZONA_BC();
         DataTable   ds1      = yms.Obtenerlugares_playa(id_playa, null, "0");
         utils.CargaDrop(this.ddl_posicion, "ID", "DESCRIPCION", ds1);
         this.ddl_posicion.Enabled = true;
     }
     else
     {
         this.ddl_posicion.ClearSelection();
         this.ddl_posicion.Enabled = false;
     }
 }
コード例 #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ZonaBC          zona          = new ZonaBC();
        PlayaBC         playa         = new PlayaBC();
        LugarBC         lugar         = new LugarBC();
        TransportistaBC transportista = new TransportistaBC();

        if (!this.IsPostBack)
        {
            this.txt_fechaMovimiento.Text = DateTime.Now.ToShortDateString();
            utils.CargaDrop(this.ddl_transportista, "ID", "NOMBRE", transportista.ObtenerTodos());
            YMS_ZONA_BC yms = new YMS_ZONA_BC();
            DataTable   ds  = yms.ObteneSites(((UsuarioBC)Session["Usuario"]).ID);
            utils.CargaDropNormal(this.dropsite, "ID", "NOMBRE", ds);
            this.drop_SelectedIndexChanged(null, null);
        }
    }
コード例 #21
0
    private LugarBC llenarPosicion()
    {
        LugarBC lugar = new LugarBC();

        lugar.CODIGO      = txt_editCodigo.Text;
        lugar.DESCRIPCION = txt_editDesc.Text;
        lugar.ID_SITE     = int.Parse(ddl_editSite.SelectedValue);
        //lugar.LUGAR_X = double.Parse(txt_editPosX.Text);
        //lugar.LUGAR_Y = double.Parse(txt_editPosY.Text);
        //lugar.POSICION = double.Parse(txt_editPosicion.Text);
        //lugar.ORDEN = int.Parse(txt_editOrden.Text);
        //lugar.ANCHO = double.Parse(txt_editAncho.Text);
        //lugar.ALTO = double.Parse(txt_editAlto.Text);
        //lugar.ROTACION = int.Parse(txt_editRotacion.Text);
        lugar.ID_PLAYA = int.Parse(ddl_editPlaya.SelectedValue);
        lugar.ID_ZONA  = int.Parse(ddl_editZona.SelectedValue);
        return(lugar);
    }
コード例 #22
0
 protected void ddl_playa_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddl_playa.SelectedIndex > 0)
     {
         LugarBC l       = new LugarBC();
         int     play_id = Convert.ToInt32(ddl_playa.SelectedValue);
         int     trai_id = Convert.ToInt32(hf_idTrailer.Value);
         ddl_posicion.Enabled = true;
         //    DataTable dt = l.ObtenerXPlaya(play_id, 0, 1, trai_id);
         //    utils.CargaDrop(ddl_posicion, "ID", "DESCRIPCION", dt);
         int solicitudtipo = Convert.ToInt32(hf_soli_tipo.Value);
         drop.Lugar1(ddl_posicion, Convert.ToInt32(dropsite.SelectedValue), Convert.ToInt32(ddl_playa.SelectedValue), 0, 1, trai_id, solicitudtipo);
     }
     else
     {
         ddl_posicion.ClearSelection();
         ddl_posicion.Enabled = false;
     }
 }
コード例 #23
0
    protected void ddl_bloqPlaya_onChange(object sender, EventArgs e)
    {
        PlayaBC playa    = new PlayaBC();
        int     playa_id = int.Parse(ddl_bloqPlaya.SelectedValue);
        LugarBC lugar    = new LugarBC();

        CargaDrops drops = new CargaDrops();

        drops.Lugar1(ddl_bloqLugar, 0, playa_id, -1, 1);
        //utils.CargaDrop(ddl_bloqLugar, "ID", "DESCRIPCION", lugar.ObtenerXPlaya(playa_id));
        if (ddl_bloqLugar.Items.Count <= 1)
        {
            ddl_bloqLugar.Enabled = false;
        }
        else
        {
            ddl_bloqLugar.Enabled = true;
        }
    }
コード例 #24
0
    protected void ddl_buscarPatente_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddl_buscarPatente.SelectedIndex > 0)
        {
            TrailerBC trailer = new TrailerBC();
            trailer = trailer.obtenerXID(Convert.ToInt32(this.ddl_buscarPatente.SelectedValue));
            LugarBC lugar = new LugarBC();
            bool    error = true;
            lugar = lugar.obtenerXID(trailer.LUGAR_ID);
            DataTable dt_lugares = lugar.obtenerLugarEstado(lugar.ID_PLAYA, lugar.ID, lugar.ID_SITE);
            DataRow   row_lugar  = dt_lugares.Rows[0];
            this.hf_trailerId.Value = trailer.ID.ToString();
            this.pnl_detalleLugar.Style.Add("background-color", row_lugar["COLOR_LUGAR"].ToString());
            this.pnl_detalleLugar.Style.Add("color", "black");
            this.lbl_lugar.Text = row_lugar["LUGA_COD"].ToString();
            this.pnl_detalleTrailer.Attributes.Add("style", string.Format("background-color:{0};", row_lugar["TRTI_COLOR"].ToString()));
            int estado_sol = int.Parse(row_lugar["SOES_ID"].ToString());
            this.pnl_imgAlerta.BackColor = System.Drawing.ColorTranslator.FromHtml(row_lugar["COLOR"].ToString());
            if (row_lugar["tres_icono"].ToString() != "")
            {
                this.img_trailer.ImageUrl = row_lugar["tres_icono"].ToString();
            }
            this.lbl_origenZona.Text      = lugar.ZONA;
            this.lbl_origenPlaya.Text     = lugar.PLAYA;
            this.ddl_destinoZona1.Enabled = true;
            this.ddl_destinoZona2.Enabled = true;
            this.txt_nroFlota.Text        = trailer.NUMERO;
            this.txt_transporte.Text      = trailer.TRANSPORTISTA;
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "showAlert('Se cargaron los datos del trailer seleccionado.');", true);
            error = false;

            if (error)
            {
                this.limpia(null, null);
            }
        }
        else
        {
            limpia(null, null);
        }
    }
コード例 #25
0
    protected void btn_editGrabar_Click(object sender, EventArgs e)
    {
        LugarBC lugar  = llenarPosicion();
        LugarBC lugar2 = new LugarBC();


        if (hf_idPosicion.Value == "")
        {
            if (lugar2.obtenerXParametro(lugar.CODIGO, "", lugar.ID_SITE, false, 0, 0).Rows.Count > 0)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Posicion ya existe en el site');", true);
            }
            else if (lugar.Crear(lugar))
            {
                ObtenerPosicion(true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Posicion creado exitosamente');", true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalPosicion');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Ocurrió un error al agregar lugar. Intente nuevamente.');", true);
            }
        }
        else
        {
            lugar.ID = int.Parse(hf_idPosicion.Value);
            string mensaje = "";
            if (lugar.Modificar(lugar, out mensaje))
            {
                ObtenerPosicion(true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Posicion modificada exitosamente');", true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalPosicion');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('" + mensaje + "');", true);
            }
        }
    }
コード例 #26
0
    protected void btnBuscar_Click(object sender, EventArgs e)
    {
        TrailerBC trailer = new TrailerBC();
        LugarBC   lugar   = new LugarBC();
        bool      error   = true;

        trailer = (txt_buscarNro.Text != "") ? trailer.obtenerXNro(txt_buscarNro.Text): trailer.obtenerXPlaca(txt_buscarPatente.Text);
        if ((trailer.ID == 0)) //Trailer no existe
        {
            limpia(null, null);
            utils.ShowMessage2(this, "buscarTrailer", "warn_trailerNoExiste");
            return;
        }

        if (trailer.SITE_ID == 0 || !trailer.SITE_IN || trailer.LUGAR_ID == 0)
        {
            limpia(null, null);
            utils.ShowMessage2(this, "buscarTrailer", "warn_trailerFueraCD");
            return;
        }
        if (trailer.SITE_ID != Convert.ToInt32(this.dropsite.SelectedValue))
        {
            limpia(null, null);
            utils.ShowMessage2(this, "buscarTrailer", "warn_trailerOtroCD");
            return;
        }
        if (string.IsNullOrEmpty(hf_soliId.Value) && trailer.SOLI_ID != 0)
        {
            limpia(null, null);
            utils.ShowMessage2(this, "buscarTrailer", "warn_trailerSolPendiente");
            return;
        }
        if (!string.IsNullOrEmpty(hf_soliId.Value) && trailer.SOLI_ID.ToString() != hf_soliId.Value && trailer.SOLI_ID != 0)
        {
            limpia(null, null);
            utils.ShowMessage2(this, "buscarTrailer", "warn_trailerSolDistinta");
            return;
        }
        if (trailer.MOVI_ID != 0)
        {
            limpia(null, null);
            utils.ShowMessage2(this, "buscarTrailer", "warn_trailerMovPendiente");
            return;
        }
        else if (trailer.TRES_ID != 400)
        {
            switch (trailer.TRES_ID)
            {
            case 100:
                utils.ShowMessage2(this, "buscarTrailer", "warn_trailerDescargado");
                break;

            case 150:
            case 200:
                utils.ShowMessage2(this, "buscarTrailer", "warn_trailerCargando");
                break;

            case 300:
            case 310:
                utils.ShowMessage2(this, "buscarTrailer", "warn_trailerDescargando");
                break;

            case 500:
                utils.ShowMessage2(this, "buscarTrailer", "warn_trailerRuta");
                break;

            case 600:
                utils.ShowMessage2(this, "buscarTrailer", "warn_trailerBloqueado");
                break;
            }
            limpia(null, null);
            return;
        }

        table.Rows.Clear();
        gv_Seleccionados.DataSource = null;
        gv_Seleccionados.DataBind();
        lugar = lugar.obtenerXID(trailer.LUGAR_ID);
        DataTable dt_lugares = lugar.obtenerLugarEstado(lugar.ID_PLAYA, lugar.ID, lugar.ID_SITE);
        DataRow   row_lugar  = dt_lugares.Rows[0];

        hf_trailerId.Value = trailer.ID.ToString();
        pnl_detalleLugar.Style.Add("background-color", row_lugar["COLOR_LUGAR"].ToString());
        pnl_detalleLugar.Style.Add("color", "black");
        lbl_lugar.Text = row_lugar["LUGA_COD"].ToString();
        pnl_detalleTrailer.Attributes.Add("style", string.Format("background-color:{0};", row_lugar["TRTI_COLOR"].ToString()));
        int estado_sol = Convert.ToInt32(row_lugar["SOES_ID"].ToString());

        pnl_imgAlerta.BackColor = System.Drawing.ColorTranslator.FromHtml(row_lugar["COLOR"].ToString());
        if (row_lugar["tres_icono"].ToString() != "")
        {
            img_trailer.ImageUrl = row_lugar["tres_icono"].ToString();
        }
        lbl_origenZona.Text     = lugar.ZONA;
        lbl_origenPlaya.Text    = lugar.PLAYA;
        ddl_destinoZona.Enabled = true;
        txt_nroFlota.Text       = trailer.NUMERO;
        txt_transporte.Text     = trailer.TRANSPORTISTA;
        utils.ShowMessage2(this, "buscarTrailer", "success");
    }
コード例 #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["usuario"] == null)
        {
            Response.Redirect("~/InicioQYMS2.aspx");
        }
        usuario = (UsuarioBC)Session["usuario"];

        if (!this.IsPostBack)
        {
            SolicitudBC sol = new SolicitudBC();
            CargaDrops();
            volver.Visible     = false;
            sol.ID_TIPO        = 1;
            sol.FECHA_CREACION = DateTime.Now;
            txt_solHora.Text   = DateTime.Now.AddMinutes(63).ToShortTimeString();

            txt_solFecha.Text = DateTime.Now.AddMinutes(63).ToShortDateString();
            ddl_solTemp.ClearSelection();
            ddl_largoMax.ClearSelection();
            LimpiarLocales();
            ddl_idShortek.Enabled = true;
            string request = Request.Params["type"];
            if (request != null && request == "edit")
            {
                CaractCargaBC      cc = new CaractCargaBC();
                SolicitudAndenesBC sa = new SolicitudAndenesBC();
                TrailerBC          trailer;
                DataTable          dsol;
                ddl_idShortek.Enabled = false;
                hf_soliId.Value       = Request.Params["id"].ToString();

                btn_limpiarDatos.Visible = false;
                txt_solNumero.Text       = this.hf_soliId.Value;

                sol = sol.ObtenerXId(Convert.ToInt32(hf_soliId.Value));
                dropsite.SelectedValue = sol.ID_SITE.ToString();
                drop_SelectedIndexChanged(null, null);
                hf_localesSeleccionados.Value = sol.LOCALES;
                txt_totalPallets.Text         = sol.Pallets.ToString();
                txt_ruta.Text = sol.RUTA;
                ddl_idShortek.SelectedValue = sol.ID_SHORTECK;
                hf_timeStamp.Value          = sol.TIMESTAMP.ToString();
                volver.Visible  = true;
                volver2.Visible = false;
                string[] caract = sol.CARACTERISTICAS.Split(",".ToCharArray());
                foreach (string c in caract)
                {
                    if (c != "")
                    {
                        cc = cc.obtenerSeleccionado(Convert.ToInt32(c));
                        switch (cc.CODIGO)
                        {
                        case "CCF":
                            chk_solFrio.Checked = true;
                            break;

                        case "CCS":
                            chk_solSeco.Checked = true;
                            break;

                        case "CCC":
                            chk_solCongelado.Checked = true;
                            break;

                        case "CCMF":
                            chk_solMultifrio.Checked = true;
                            break;

                        case "CCCP":
                            chk_plancha.Checked = true;
                            break;

                        case "CCWAY":
                            chk_solWays.Checked = true;
                            break;
                        }
                    }
                }
                chk_frio_CheckedChanged(null, null);
                chk_solMultifrio.Enabled = false;
                chk_solCongelado.Enabled = false;
                chk_solSeco.Enabled      = false;
                chk_solFrio.Enabled      = false;
                chk_solWays.Enabled      = false;
                dropsite.Enabled         = false;
                txt_solFecha.Enabled     = false;
                txt_solHora.Enabled      = false;
                ObtenerLocalesSolicitud(true);
                dsol = (DataTable)ViewState["locales"];
                carga_playas();
                ddl_solPlaya.SelectedValue = new LugarBC().obtenerXID(Convert.ToInt32(dsol.Rows[0]["LUGA_ID"])).ID_PLAYA.ToString();  // dsol.Rows[0]["id_playa"].ToString() ;
                ddl_solPlaya_SelectedIndexChanged(null, null);
                if (sol.TETR_ID != 0)
                {
                    DDL_TEMP.SelectedValue = sol.TETR_ID.ToString();
                }
                if (sol.ID_TRAILER != 0)
                {
                    trailer                    = new TrailerBC().obtenerXID(sol.ID_TRAILER);
                    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;
                }
                calcula_solicitud(null, null);

                if (hf_traiId.Value != "" && sol.SOES_ID > 101)
                {
                    visiblasignamanual.Enabled = false;
                }
            }
            if (request != null && request == "new")
            {
                TrailerBC     trailer = new TrailerBC();
                CaractCargaBC cc      = new CaractCargaBC();
                string        trai_id = this.Request.Params["trai_id"];
                ddl_idShortek.Enabled         = false;
                btn_limpiarDatos.Visible      = false;
                txt_solNumero.Text            = "";
                hf_localesSeleccionados.Value = sol.LOCALES;
                txt_totalPallets.Text         = "0";
                txt_ruta.Text = "Ways";
                ddl_idShortek.SelectedValue = "0";
                hf_timeStamp.Value          = DateTime.Now.ToString();
                volver.Visible           = false;
                volver2.Visible          = true;
                chk_solWays.Checked      = true;
                chk_solMultifrio.Enabled = false;
                chk_solCongelado.Enabled = false;
                chk_solSeco.Enabled      = false;
                chk_solFrio.Enabled      = false;
                dropsite.Enabled         = false;
                string    resultado = "";
                DataTable dsol      = sol.ObtenerAndenesXNewWays(trai_id, out resultado);

                ViewState["datosA"]      = dsol;
                gv_solLocales.DataSource = dsol;
                gv_solLocales.DataBind();
                stringCaractSolicitud();
                carga_playas();
                LugarBC lugar = new LugarBC();
                lugar = lugar.obtenerXID(Convert.ToInt32(dsol.Rows[0]["luga_id"].ToString()));
                ddl_solPlaya.SelectedValue = lugar.ID_PLAYA.ToString();  // dsol.Rows[0]["id_playa"].ToString() ;
                ddl_solPlaya_SelectedIndexChanged(null, null);
                trailer = trailer.obtenerXID(Convert.ToInt32(trai_id));
                txt_trailerPatente.Text = trailer.PLACA;
                calcula_solicitud(null, null);
                ddl_trailers.Enabled       = false;
                txt_trailerNro.Enabled     = false;
                txt_trailerPatente.Enabled = false;
                btn_buscarTrailer.Enabled  = false;
                btn_buscarTrailer_Click(null, null);
            }
        }
        visibleasignamovilmanual();
    }
コード例 #28
0
    internal string crearPlayasLugares2(DataTable dt_zona)
    {
        SolicitudBC s   = new SolicitudBC();
        DataTable   dtl = s.ObtenerColorXSite(int.Parse(this.ddl_Site.SelectedValue));

        this.crearLeyenda(dtl, this.pnl_leyendaEstado, "SOLICITUD_ESTADO");

        PlayaBC playa = new PlayaBC();
        LugarBC lugar = new LugarBC();

        bool  primero = false;
        int   idzona, idplaya;
        Panel tab;

        foreach (DataRow row_zona in dt_zona.Rows)                          //Tabs Zonas
        {
            if (!primero)
            {
                tab = new Panel();
                tab.ClientIDMode = ClientIDMode.Static;
                tab.ID           = string.Format("cont_zona_{0}", row_zona["ID"].ToString());
                tab.CssClass     = "tab-pane fade active in";
                this.playaslugares.Controls.Add(tab);
                primero = true;
            }
            else
            {
                tab = new Panel();
                tab.ClientIDMode = ClientIDMode.Static;
                tab.ID           = string.Format("cont_zona_{0}", row_zona["ID"].ToString());
                tab.CssClass     = "tab-pane fade";
                this.playaslugares.Controls.Add(tab);
            }
            idzona = int.Parse(row_zona["ID"].ToString());

            DataTable dt_playas = playa.ObtenerXZona(idzona);         //Playas Agrupadas
            foreach (DataRow row_playa in dt_playas.Rows)
            {
                HtmlGenericControl h4 = new HtmlGenericControl("h4");
                h4.InnerText = row_playa["DESCRIPCION"].ToString();
                Panel contenido = new Panel();
                contenido.ClientIDMode = ClientIDMode.Static;
                contenido.ID           = string.Format("cont_playa_{0}", row_playa["ID"].ToString());
                tab.Controls.Add(h4);
                h4.Style.Add("display", "inline-block");
                tab.Controls.Add(contenido);

                //Append("<table>");
                idplaya = int.Parse(row_playa["ID"].ToString());
                DataTable dt_lugares = lugar.obtenerLugarEstado(idplaya, 0, int.Parse(this.ddl_Site.SelectedValue));
                int       cont       = 20;
                int       cont2      = 1;
                Panel     Row        = new Panel();
                Row.CssClass = "panel-control";
                Row.Style.Add("display", "inline-block");
                contenido.Controls.Add(Row);
                Random random = new Random();
                foreach (DataRow row_lugar in dt_lugares.Rows)              //Andenes
                {
                    if (cont == 10)
                    {
                        Row          = new Panel();
                        Row.CssClass = "panel-control";
                        Row.Style.Add("display", "inline-block");
                        contenido.Controls.Add(Row);                           //Nueva Row cada vez que empieza o cada 20 registros
                        cont = 0;
                    }

                    Panel Celda = new Panel();
                    Celda.ClientIDMode = ClientIDMode.Static;


                    Celda.ID = string.Format("cont_lugar_{0}", row_lugar["LUGA_ID"].ToString() + random.Next(1, 1000000).ToString());

                    //     Celda.ID = string.Format("cont_lugar_{0}", row_lugar["LUGA_ID"].ToString());
                    Celda.CssClass = "lugar";

                    Row.Controls.Add(Celda);

                    Panel DetallessuperiorCelda = new Panel();
                    Celda.Controls.Add(DetallessuperiorCelda);

                    Panel DetallesinferiorCelda = new Panel();
                    Celda.Controls.Add(DetallesinferiorCelda);

                    Panel PanelColorAlerta  = new Panel();
                    Panel PanelIconoTrailer = new Panel();

                    PanelColorAlerta.CssClass = "col-xs-6";
                    PanelColorAlerta.Style.Add("padding", "0");

                    PanelIconoTrailer.CssClass = "col-xs-6";
                    PanelIconoTrailer.Style.Add("padding", "0");

                    //Image imagenreloj = new Image();
                    Image iconotrailer = new Image();
                    DetallessuperiorCelda.Style.Add("background-color", row_lugar["COLOR_LUGAR"].ToString());
                    DetallessuperiorCelda.Style.Add("color", "black");
                    if (row_lugar["LUES_ID"].ToString() != "10")            //Si está habilitado/disponible
                    {
                        DetallessuperiorCelda.CssClass = "row columna-anden detalle-lugar";
                        //if (row_lugar["MOVI_ORIGEN"].ToString() != "0" ||
                        //    row_lugar["MOVI_DEST"].ToString() != "0")
                        //{ //Si tiene movimiento pendiente
                        //    DetallessuperiorCelda.Style.Add("background-color", "yellow");
                        //}
                        //else if (row_lugar["LUGA_OCUPADO"].ToString() == "True")
                        //{
                        //    DetallessuperiorCelda.Style.Add("background-color", "lime");
                        //}

                        HyperLink lnk = new HyperLink();
                        // LinkButton lnk = new LinkButton();
                        lnk.NavigateUrl = "#";
                        // lnk.Click += detallesolicitudes;
                        // lnk.CommandArgument = row_lugar["LUGA_ID"].ToString();
                        lnk.Attributes.Add("onclick", string.Format("modalPendientes({0});", row_lugar["LUGA_ID"].ToString()));

                        lnk.Text = row_lugar["LUGA_COD"].ToString();
                        DetallessuperiorCelda.Controls.Add(lnk);
                        string clrAlerta = row_lugar["COLOR"].ToString();
                        if (clrAlerta != "#FFFFFF")
                        {
                            PanelColorAlerta.Style.Add("background-color", clrAlerta);
                            PanelColorAlerta.Style.Add("border-radius", "20px");
                            Image imagen = new Image();
                            PanelColorAlerta.Controls.Add(imagen);
                            imagen.Style.Add("position", "absolute");
                            imagen.Style.Add("top", "0px");
                            imagen.Style.Add("left", "0px");
                            imagen.ImageUrl = "../img/reloj.png";
                            imagen.Width    = 20;
                            imagen.Height   = 20;
                        }
                        DetallesinferiorCelda.CssClass = "row columna-anden detalle-trailer";
                        DetallesinferiorCelda.Style.Add("background-color", row_lugar["TRTI_COLOR"].ToString());
                        PanelColorAlerta.Width  = 20;
                        PanelColorAlerta.Height = 20;

                        if (row_lugar["TRAI_ID"].ToString() == "-1")
                        {
                            Label tracto = new Label();
                            tracto.Text = "T";
                            PanelIconoTrailer.Controls.Add(tracto);
                        }
                        else
                        {
                            if (row_lugar["TRAI_PLACA"].ToString() != "0")
                            {
                                iconotrailer.Width  = 20;
                                iconotrailer.Height = 20;
                                string mensaje = string.Format("Anden: {0}", row_lugar["LUGA_COD"].ToString());
                                mensaje += string.Format(" Placa: {0}", row_lugar["TRAI_PLACA"].ToString());
                                mensaje += string.Format(" Número Flota: {0}", row_lugar["TRAI_NUMERO"].ToString());
                                mensaje += string.Format(" Locales Solicitud: {0}", row_lugar["locales"].ToString());
                                PanelIconoTrailer.Attributes.Add("onmouseover", string.Format("mostrarDatos('{0}', {1});", mensaje, row_playa["ID"].ToString()));
                                PanelIconoTrailer.Attributes.Add("onmouseout", string.Format("mostrarDatos('', {0});", row_playa["ID"].ToString()));
                                PanelIconoTrailer.Style.Add("padding-left", "2px");
                                if (row_lugar["tres_icono"].ToString() != "")
                                {
                                    iconotrailer.ImageUrl = row_lugar["tres_icono"].ToString();
                                }
                            }
                            PanelIconoTrailer.Controls.Add(iconotrailer);
                        }
                    }
                    else
                    {
                        Celda.CssClass = string.Format("{0} inhabilitado", Celda.CssClass);
                        Label codigo = new Label();
                        codigo.Text = row_lugar["LUGA_COD"].ToString();
                        DetallessuperiorCelda.Controls.Add(codigo);
                    }
                    DetallesinferiorCelda.Controls.Add(PanelColorAlerta);
                    DetallesinferiorCelda.Controls.Add(PanelIconoTrailer);

                    cont++;
                    cont2++;
                }
                Panel div_mensaje = new Panel();
                contenido.Controls.Add(div_mensaje);
                div_mensaje.ClientIDMode = ClientIDMode.Static;

                div_mensaje.ID = string.Format("msj_play_{0}", row_playa["ID"].ToString());
                //  div_mensaje.CssClass = "col-xs-12";
                div_mensaje.Style.Add("display", "block");
                div_mensaje.Style.Add("clear", "both");
            }
        }

        //   return strb.ToString();
        return("");
    }
コード例 #29
0
    public bool buscar(string patente, string site)
    {
        TrailerBC trailer = new TrailerBC();
        LugarBC   lugar   = new LugarBC();

        this.pnl_detalleLugar.Attributes.Remove("style");
        this.pnl_detalleTrailer.CssClass = "";
        this.pnl_detalleTrailer.Attributes.Remove("style");
        this.img_reloj.ImageUrl   = "";
        this.img_trailer.ImageUrl = "";
        this.lbl_lugar.Text       = "";
        this.lbl_origenZona.Text  = "";
        this.lbl_origenPlaya.Text = "";

        trailer = trailer.obtenerXPlaca(patente);
        if (trailer.ID == 0 || trailer.ID == null) //Trailer no existe
        {
            this.txt_nroPista.Text   = "";
            this.txt_transporte.Text = "";

            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer no existe en la base de datos.');", true);
            return(false);
        }
        else //Trailer existente, trae datos
        {
            if (trailer.SITE_ID == null || trailer.SITE_ID == 0 || !trailer.SITE_IN ||              //Si trailer no tiene un último estado se asume que no está en ningún site
                trailer.LUGAR_ID == null || trailer.LUGAR_ID == 0)
            {
                this.ddl_destinoZona.Enabled = false;
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer no ingresado correctamente. Realice el proceso de entrada correspondiente.');", true);
                return(false);
            }
            else if (trailer.SITE_ID != int.Parse(site))
            {
                this.ddl_destinoZona.Enabled = false;
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer no se encuentra en el site. Realice el proceso de entrada correspondiente.');", true);
                return(false);
            }
            else if (trailer.SOLI_ID != null &&
                     trailer.SOLI_ID != 0)
            {
                this.ddl_destinoZona.Enabled = false;
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer tiene solicitud pendiente.');", true);
                return(false);
            }
            else if (trailer.MOVI_ID != null &&
                     trailer.MOVI_ID != 0)
            {
                this.ddl_destinoZona.Enabled = false;
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Trailer tiene movimiento pendiente.');", true);
                return(false);
            }
            else
            {
                lugar = lugar.obtenerXID(trailer.LUGAR_ID);
                DataTable dt_lugares = lugar.obtenerLugarEstado(lugar.ID_PLAYA, lugar.ID, lugar.ID_SITE);
                DataRow   row_lugar  = dt_lugares.Rows[0];
                this.hf_trailerId.Value = trailer.ID.ToString();
                if (row_lugar["MOVI_ORIGEN"].ToString() != "0" ||
                    row_lugar["MOVI_DEST"].ToString() != "0")    //Si tiene movimiento pendiente
                {
                    this.pnl_detalleLugar.Attributes.Add("style", "background-color:yellow;");
                }
                else if (row_lugar["LUGA_OCUPADO"].ToString() == "True")
                {
                    this.pnl_detalleLugar.Attributes.Add("style", "background-color:green;");
                }
                this.lbl_lugar.Text = row_lugar["LUGA_COD"].ToString();
                this.pnl_detalleTrailer.CssClass = "row columna-anden detalle-trailer";
                this.pnl_detalleTrailer.Attributes.Add("style", string.Format("background-color:{0};", row_lugar["TRTI_COLOR"].ToString()));
                int estado_sol = int.Parse(row_lugar["SOES_ID"].ToString());
                if (estado_sol != 0)                                     //Si tiene carga en proceso o está cargado, a la espera de finalizar solicitud
                {
                    if (row_lugar["TRUE_CARGADO"].ToString() == "False") //Si está en carga
                    {
                        if (int.Parse(row_lugar["SOAN_MINS_CARGA_REAL"].ToString()) <= 120 &&
                            int.Parse(row_lugar["SOAN_MINS_CARGA_REAL"].ToString()) >= 0)
                        {
                            this.img_reloj.ImageUrl = "./Img/relojverde.png";
                        }
                        else if (int.Parse(row_lugar["SOAN_MINS_CARGA_REAL"].ToString()) <= 180 &&
                                 int.Parse(row_lugar["SOAN_MINS_CARGA_REAL"].ToString()) >= 121)
                        {
                            this.img_reloj.ImageUrl = "./Img/relojnaranja.png";
                        }
                        else if (int.Parse(row_lugar["SOAN_MINS_CARGA_REAL"].ToString()) >= 181)
                        {
                            this.img_reloj.ImageUrl = "./Img/relojrojo.png";
                        }
                    }
                    else
                    {
                        if (int.Parse(row_lugar["MOVI_MINS_ASIGNA_EJECUTA"].ToString()) <= 15 &&
                            int.Parse(row_lugar["MOVI_MINS_ASIGNA_EJECUTA"].ToString()) >= 0)
                        {
                            this.img_reloj.ImageUrl = "./Img/relojverde.png";
                        }
                        else if (int.Parse(row_lugar["MOVI_MINS_ASIGNA_EJECUTA"].ToString()) <= 30 &&
                                 int.Parse(row_lugar["MOVI_MINS_ASIGNA_EJECUTA"].ToString()) >= 16)
                        {
                            this.img_reloj.ImageUrl = "./Img/relojnaranja.png";
                        }
                        else if (int.Parse(row_lugar["MOVI_MINS_ASIGNA_EJECUTA"].ToString()) >= 31)
                        {
                            this.img_reloj.ImageUrl = "./Img/relojrojo.png";
                        }
                    }
                }
                if (row_lugar["TRAI_PLACA"].ToString() != "0")
                {
                    //strb.Append("<img ");
                    if (estado_sol >= 0 && estado_sol < 20)
                    {
                        this.img_trailer.ImageUrl = "./Img/tra_vacio.png";
                    }
                    else if (estado_sol >= 20 && estado_sol < 30)
                    {
                        this.img_trailer.ImageUrl = "./Img/tra_semivacio.png";
                    }
                    else if (estado_sol == 30)
                    {
                        this.img_trailer.ImageUrl = "./Img/tra_ocupado.png";
                    }
                }
                this.lbl_origenZona.Text     = lugar.ZONA;
                this.lbl_origenPlaya.Text    = lugar.PLAYA;
                this.ddl_destinoZona.Enabled = true;
                this.txt_nroPista.Text       = trailer.PLACA.ToString();
                txt_transporte.Text          = trailer.TRANSPORTISTA.ToString();
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Se cargaron los datos del trailer seleccionado.');", true);
                return(true);
            }
        }
    }
コード例 #30
0
    public void btn_pendienteClick(object sender, EventArgs e)
    {
        LugarBC lugar = new LugarBC();

        lugar = lugar.obtenerXID(int.Parse(this.hf_idLugar.Value));
        DataTable dt = lugar.obtenerLugarEstado(lugar.ID_PLAYA, lugar.ID, lugar.ID_SITE);
        DataRow   l  = dt.Rows[0];

        this.pnl_detalleLugar.Style.Add("background-color", l["COLOR_LUGAR"].ToString());
        this.pnl_detalleLugar.Style.Add("color", "black");
        this.lbl_lugar.Text = l["LUGA_COD"].ToString();
        this.pnl_detalleTrailer.Attributes.Add("style", string.Format("background-color:{0};", l["TRTI_COLOR"].ToString()));
        this.lbl_origenZona.Text  = lugar.ZONA;
        this.lbl_origenPlaya.Text = lugar.PLAYA;
        if (l["COLOR"].ToString() != "#FFFFFF")
        {
            this.pnl_imgAlerta.BackColor = System.Drawing.ColorTranslator.FromHtml(l["COLOR"].ToString());
            this.img_alerta.Visible      = true;
        }
        else
        {
            this.img_alerta.Visible = false;
        }

        if (l["tres_icono"].ToString() != "")
        {
            this.img_trailer.ImageUrl = l["tres_icono"].ToString();
        }

        limpiar();

        switch (l["TRAI_ID"].ToString())
        {
        case "-1":
            this.rb_tracto.Checked = true;
            activarTracto(true);
            activarTrailer(false);
            this.img_trailer.Visible = false;
            this.spn_tracto.Visible  = true;
            TractoBC trac = new TractoBC();
            trac.LUGA_ID = Convert.ToInt32(l["LUGA_ID"]);
            trac         = trac.ObtenerTractoXLugar(trac.LUGA_ID);
            this.llenarDatos(trac);
            break;

        case "0":
            this.rb_vacio.Checked = true;
            activarTracto(false);
            activarTrailer(false);
            this.img_trailer.Visible = false;
            this.spn_tracto.Visible  = false;
            break;

        default:
            this.rb_trailer.Checked = true;
            activarTracto(false);
            activarTrailer(true);
            this.img_trailer.Visible = true;
            this.spn_tracto.Visible  = false;
            TrailerBC t = new TrailerBC();
            t.ID = Convert.ToInt32(l["TRAI_ID"]);
            t    = t.obtenerXID();
            this.llenarDatos(t);
            break;
        }
        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "$('#modalPendientes').modal();", true);
    }