Exemple #1
0
    protected void btn_editGrabar_Click(object sender, EventArgs e)
    {
        SiteBC site = new SiteBC();

        site.NOMBRE      = txt_editNombre.Text;
        site.DESCRIPCION = txt_editDesc.Text;
        site.EMPRESA_ID  = Convert.ToInt32(ddl_editEmpresa.SelectedValue);
        site.COD_SAP     = Convert.ToInt32(txt_editCodSap.Text);
        if (string.IsNullOrEmpty(hf_idSite.Value))
        {
            if (site.Crear(site))
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Site creado exitosamente');cerrarModal('modalSite');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Ocurrió un error al agregar site. Intente nuevamente.');", true);
            }
            ObtenerSite(true);
        }
        else
        {
            site.ID = Convert.ToInt32(hf_idSite.Value);
            if (site.Modificar(site))
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Site modificado exitosamente');cerrarModal('modalSite');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Ocurrió un error al modificar site. Intente nuevamente.');", true);
            }
            ObtenerSite(true);
        }
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["usuario"] == null)
        {
            this.Response.Redirect("~/InicioQYMS2.aspx");
        }

        this.usuario = (UsuarioBC)this.Session["usuario"];

        if (!this.IsPostBack)
        {
            TransportistaBC tran = new TransportistaBC();
            TrailerTipoBC   tipo = new TrailerTipoBC();
            SiteBC          site = new SiteBC();
            utils.CargaDrop(this.ddl_buscarSite, "ID", "NOMBRE", site.ObtenerTodos());
            this.utils.CargaDrop(this.ddl_editTran, "ID", "NOMBRE", tran.ObtenerTodos());
            this.utils.CargaDrop(this.ddl_editTipo, "ID", "DESCRIPCION", tipo.obtenerTodo());
            this.utils.CargaDrop(this.ddl_buscarTransportista, "ID", "NOMBRE", tran.ObtenerTodos());
            this.utils.CargaDrop(this.ddl_buscarTipo, "ID", "DESCRIPCION", tipo.obtenerTodo());
            YMS_ZONA_BC yms = new YMS_ZONA_BC();
            utils.CargaDropNormal(this.ddl_site, "ID", "NOMBRE", yms.ObteneSites(this.usuario.ID));


            this.utils.CargaDrop(this.ddl_buscarMotivo, "ID", "NOMBRE", tran.ObtenerMotivoBloqueo("1"));
            this.ltl_contenidoCaract.Text = this.crearContenido();
        }
        this.ObtenerTrailer(false);
    }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["usuario"] == null)
        {
            Response.Redirect("~/InicioQYMS2.aspx");
        }
        user = (UsuarioBC)Session["usuario"];
        if (!IsPostBack)
        {
            Session["panel"] = null;

            SiteBC      site    = new SiteBC();
            EmpresaBC   empresa = new EmpresaBC();
            PerfilBC    perfil  = new PerfilBC();
            ProveedorBC pr      = new ProveedorBC();
            rlcli.DataSource     = site.ObtenerTodos();
            rlcli.DataTextField  = "DESCRIPCION";
            rlcli.DataValueField = "ID";
            rlcli.DataBind();
            utils.CargaDropNormal(this.ddl_editEmpresa, "ID", "NOMBRE_FANTASIA", empresa.ObtenerTodas());
            ddl_editEmpresa.Enabled = false;
            utils.CargaDrop(this.ddl_editTipoUsuario, "ID", "NOMBRE", user.ObtenerPerfilesAutorizados());
            utils.CargaDrop(this.ddl_buscarTipoUsuario, "ID", "NOMBRE", perfil.ObtenerTodo());
            utils.CargaDrop(this.ddl_editProveedores, "ID", "DESCRIPCION", pr.obtenerTodo());
            ObtenerUsuarios(true);
        }
    }
Exemple #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["usuario"] == null)
         {
             Response.Redirect("../InicioQYMS.aspx");
         }
         usuario = (UsuarioBC)Session["usuario"];
         CaractCargaBC   catt = new CaractCargaBC();
         TransportistaBC tran = new TransportistaBC();
         TrailerTipoBC   tipo = new TrailerTipoBC();
         SiteBC          site = new SiteBC();
         DataTable       dt   = catt.obtenerTodo();
         //rlcli.DataSource = dt;
         //rlcli.DataTextField = "DESCRIPCION";
         //rlcli.DataValueField = "ID";
         //rlcli.DataBind();
         //utils.CargaCheck(this.chklst_editCaracteristicas, "ID", "DESCRIPCION", catt.obtenerTodo());
         utils.CargaDrop(ddl_editTran, "ID", "NOMBRE", tran.ObtenerTodos());
         utils.CargaDrop(ddl_editTipo, "ID", "DESCRIPCION", tipo.obtenerTodo());
         utils.CargaDrop(ddl_buscarTransportista, "ID", "NOMBRE", tran.ObtenerTodos());
         utils.CargaDrop(ddl_buscarTipo, "ID", "DESCRIPCION", tipo.obtenerTodo());
         utils.CargaDropNormal(ddl_site, "ID", "NOMBRE", site.ObtenerTodos());
         utils.CargaDrop(ddl_buscarMotivo, "ID", "NOMBRE", tran.ObtenerMotivoBloqueo("1"));
         ltl_contenidoCaract.Text = crearContenido();
         ObtenerTrailer(true);
     }
 }
Exemple #5
0
    protected void drop_SelectedIndexChanged(object sender, EventArgs e)
    {
        SiteBC s = new SiteBC();

        s             = s.ObtenerXId(Convert.ToInt32(dropsite.SelectedValue));
        lbl_site.Text = "CD " + s.DESCRIPCION;
        if (!string.IsNullOrEmpty(txt_placaTrailer.Text))
        {
            this.btnBuscarTrailer_Click(null, null);
        }
    }
Exemple #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         SiteBC          s    = new SiteBC();
         TransportistaBC tran = new TransportistaBC();
         TrailerTipoBC   tipo = new TrailerTipoBC();
         this.utils.CargaDrop(this.ddl_buscarTransportista, "ID", "NOMBRE", tran.ObtenerTodos());
         this.utils.CargaDrop(this.ddl_buscarTipo, "ID", "DESCRIPCION", tipo.obtenerTodo());
         this.utils.CargaDrop(this.ddl_site, "ID", "DESCRIPCION", s.ObtenerTodos());
     }
 }
Exemple #7
0
 protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EDITAR")
     {
         SiteBC site = new SiteBC();
         hf_idSite.Value               = e.CommandArgument.ToString();
         site                          = site.ObtenerXId(Convert.ToInt32(hf_idSite.Value));
         txt_editNombre.Text           = site.NOMBRE;
         txt_editDesc.Text             = site.DESCRIPCION;
         ddl_editEmpresa.SelectedValue = site.EMPRESA_ID.ToString();
         txt_editCodSap.Text           = site.COD_SAP.ToString();
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalSite();", true);
     }
     if (e.CommandName == "ELIMINAR")
     {
         hf_idSite.Value          = e.CommandArgument.ToString();
         lblRazonEliminacion.Text = "Eliminar Site";
         msjEliminacion.Text      = "Se eliminará el Site seleccionado, ¿desea continuar?";
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalConfirmacion();", true);
     }
     if (e.CommandName == "ACTIVAR")
     {
         SiteBC site = new SiteBC();
         if (site.TrailerAuto(u.ID, Convert.ToInt32(e.CommandArgument.ToString())))
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Todo OK');", true);
         }
         else
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Error');", true);
         }
         ObtenerSite(true);
     }
     if (e.CommandName == "VIRTUAL")
     {
         hf_idSite.Value = e.CommandArgument.ToString();
         SiteBC site = new SiteBC();
         site.ObtenerXId(Convert.ToInt32(hf_idSite.Value));
         ZonaBC z = new ZonaBC();
         utils.CargaDrop(ddl_virtualZona, "ID", "DESCRIPCION", z.ObtenerXSite(Convert.ToInt32(hf_idSite.Value), true));
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalVirtual();", true);
         YMS_ZONA_BC p  = new YMS_ZONA_BC();
         DataTable   dt = p.ObtenerPlayas_Site(Convert.ToInt32(hf_idSite.Value), "", "1");
         if (dt.Rows.Count == 1)
         {
             ddl_virtualZona.SelectedValue = dt.Rows[0]["zona_id"].ToString();
             ddl_virtualZona_SelectedIndexChanged(null, null);
             ddl_virtualPlaya.SelectedValue = dt.Rows[0]["id"].ToString();
         }
     }
 }
Exemple #8
0
    protected void btn_virtualGuardar_Click(object sender, EventArgs e)
    {
        SiteBC s = new SiteBC();

        if (s.Virtual(Convert.ToInt32(hf_idSite.Value), Convert.ToInt32(ddl_virtualPlaya.SelectedValue)))
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Todo OK');cerrarModal('modalVirtual');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('Error');cerrarModal('modalVirtual');", true);
        }
        ObtenerSite(true);
    }
Exemple #9
0
    protected void btn_EliminarSite_Click(object sender, EventArgs e)
    {
        SiteBC site = new SiteBC();

        if (site.Eliminar(Convert.ToInt32(hf_idSite.Value)))
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Site eliminado exitosamente');cerrarModal('modalSite');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Ocurrió un error al eliminar site. Revise si tiene otros datos asociados');cerrarModal('modalSite');", true);
        }
        ObtenerSite(true);
    }
Exemple #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Session["usuario"] == null)
     {
         this.Response.Redirect("~/InicioQYMS2.aspx");
     }
     this.user = (UsuarioBC)this.Session["usuario"];
     if (!this.IsPostBack)
     {
         SiteBC s = new SiteBC();
         this.txt_desde.Text = DateTime.Now.AddDays(-1).ToShortDateString();
         this.txt_hasta.Text = DateTime.Now.ToShortDateString();
         this.utils.CargaDrop(this.ddl_site, "ID", "DESCRIPCION", s.ObtenerTodos());
     }
 }
Exemple #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Tipo_ZonaBC zoti = new Tipo_ZonaBC();
         SiteBC      site = new SiteBC();
         utils.CargaDropNormal(ddl_buscarTipoZona, "ID", "DESCRIPCION", zoti.ObtenerTodos());
         ddl_buscarTipoZona.Items.Insert(0, new ListItem("TODOS", "-1"));
         ddl_buscarTipoZona.SelectedValue = "-1";
         // ddl_buscarTipoZona.Items[0].Value = "0";
         utils.CargaDropTodos(ddl_buscarSite, "ID", "NOMBRE", site.ObtenerTodos());
         utils.CargaDropDefaultValue(ddl_editTipoZona, "ID", "DESCRIPCION", zoti.ObtenerTodos());
         utils.CargaDrop(ddl_editSite, "ID", "NOMBRE", site.ObtenerTodos());
         ObtenerZona(true);
     }
 }
Exemple #12
0
    public void Site(DropDownList ddl, int user_id = 0)
    {
        DataView dw;

        if (user_id != 0)
        {
            YMS_ZONA_BC y = new YMS_ZONA_BC();
            dw = y.ObteneSites(user_id).AsDataView();
        }
        else
        {
            SiteBC s = new SiteBC();
            dw = s.ObtenerTodos().AsDataView();
        }
        dw.Sort = "NOMBRE ASC";
        u.CargaDrop(ddl, "ID", "NOMBRE", dw.ToTable());
    }
Exemple #13
0
    protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "MODIFICAR")
        {
            TrailerBC trailer = new TrailerBC();
            hf_idTrailer.Value = e.CommandArgument.ToString();
            trailer            = trailer.obtenerXID(int.Parse(hf_idTrailer.Value));
            llenarForm(trailer);
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "llenarForm", "llenarForm();", true);
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalEditarTrailer();", true);
        }
        if (e.CommandName == "ELIMINAR")
        {
            ddTipoBloqueo.Visible       = false;
            hf_idTrailer.Value          = e.CommandArgument.ToString();
            lblRazonEliminacion.Text    = "Eliminar Trailer";
            msjEliminacion.Text         = "Se eliminará el trailer seleccionado, ¿desea continuar?";
            btnModalEliminar.Visible    = true;
            btn_BloquearTrailer.Visible = false;
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalConfirmar();", true);
        }
        if (e.CommandName == "BLOQUEAR")
        {
            SiteBC site = new SiteBC();
            utils.CargaDrop(ddl_buscarSite, "ID", "NOMBRE", site.ObtenerTodos());
            ddTipoBloqueo.Visible = true;
            hf_idTrailer.Value    = e.CommandArgument.ToString();

            TrailerBC trailer = new TrailerBC();
            trailer = trailer.obtenerXID(int.Parse(hf_idTrailer.Value.ToString()));
            lblRazonEliminacion.Text     = "Bloquear Trailer";
            ddl_buscarSite.SelectedValue = trailer.SITE_ID.ToString();
            ddl_buscarSite_onChange(null, null);
            msjEliminacion.Text         = "Motivo de Bloqueo";
            btnModalEliminar.Visible    = false;
            btn_BloquearTrailer.Visible = true;
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalConfirmar();", true);
        }
        if (e.CommandName == "inventario")
        {
            TrailerBC trailer = new TrailerBC();
            hf_idTrailer.Value = e.CommandArgument.ToString();
            trailer.temporal_estado_cargado(int.Parse(hf_idTrailer.Value.ToString()));
            btn_buscarTrailer_Click(null, null);
        }
    }
Exemple #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         SiteBC      s   = new SiteBC();
         SolicitudBC sol = new SolicitudBC();
         sol.ObtenerEstados();
         //TrailerEstadoBC t = new TrailerEstadoBC();
         Tipo_ZonaBC tz = new Tipo_ZonaBC();
         utils.CargaDrop(ddl_buscaSite, "ID", "NOMBRE", s.ObtenerTodos());
         utils.CargaDrop(ddl_buscaEstadoSol, "ID", "DESCRIPCION", sol.ObtenerEstados());
         utils.CargaDropDefaultValue(ddl_buscaTipoZona, "ID", "DESCRIPCION", tz.ObtenerTodos());
         utils.CargaDrop(ddl_editSite, "ID", "NOMBRE", s.ObtenerTodos());
         utils.CargaDrop(ddl_editEstadoSoli, "ID", "DESCRIPCION", sol.ObtenerEstados());
         utils.CargaDropDefaultValue(ddl_editTipoZona, "ID", "DESCRIPCION", tz.ObtenerTodos());
         ObtenerTimers(true);
     }
 }
Exemple #15
0
    protected void ObtenerSite(bool forzarBD)
    {
        if (ViewState["lista"] == null || forzarBD)
        {
            SiteBC    site    = new SiteBC();
            string    nombre  = txt_buscarNombre.Text;
            int       empr_id = Convert.ToInt32(ddl_buscarEmpresa.SelectedValue);
            DataTable dt      = site.ObtenerXCriterio(nombre, empr_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();
    }
Exemple #16
0
    protected void btn_grabar_Click(object sender, EventArgs e)
    {
        SiteBC    s   = new SiteBC();
        DataTable dt  = s.ObtenerTodos();
        DataTable dt2 = new DataTable();

        dt2.Columns.Add("SITE_ID");
        dt2.Columns.Add("COLOR");
        bool exito = true;

        foreach (DataRow dr in dt.Rows)
        {
            TextBox txtsite = (TextBox)pnl_Sites.FindControl("txt_colorSite_" + dr["ID"].ToString());
            if (string.IsNullOrEmpty(txtsite.Text))
            {
                //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "error", "alert('Debe completar todos los datos');", true);
                exito = false;
                break;
            }
            else
            {
                dt2.Rows.Add(dr["ID"].ToString(), txtsite.Text);
            }
        }
        if (exito)
        {
            SolicitudBC sol = new SolicitudBC();
            if (sol.EditarColorEstadoSite(dt2, int.Parse(hf_id.Value)))
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ok", "alert('Todo OK');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "error", "alert('Error');", true);
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "error", "alert('Debe completar todos los datos');", true);
        }
        //DropDownList ddlzona = (DropDownList)panel_temp.FindControl(dr["SITE_ID"].ToString() + "ZONA__DDL");    // new DropDownList();
    }
Exemple #17
0
    protected void drop_SelectedIndexChanged(object sender, EventArgs e)
    {
        SiteBC s = new SiteBC();

        s             = s.ObtenerXId(Convert.ToInt32(dropsite.SelectedValue));
        lbl_site.Text = "CD " + s.DESCRIPCION;
        //YMS_ZONA_BC yms = new YMS_ZONA_BC();
        string tipo_zona;

        if (this.rb_ingresoCargado.Checked == true)
        {
            tipo_zona = "200";
        }
        else
        {
            tipo_zona = "100";
        }

        if (txt_placaTrailer.Text != "" && txt_placaTrailer.Text != null)
        {
            this.btnBuscarTrailer_Click(null, null);
        }
    }
Exemple #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["usuario"] == null)
        {
            Response.Redirect("../InicioQYMS.aspx");
        }
        usuario = (UsuarioBC)Session["usuario"];
        if (!IsPostBack)
        {
            YMS_ZONA_BC y    = new YMS_ZONA_BC();
            SiteBC      site = new SiteBC();
            DataTable   dt   = y.ObteneSites(usuario.ID);
            DataTable   dt2  = site.ObtenerTodos();

            utils.CargaDropNormal(ddl_site, "ID", "NOMBRE", dt);
            utils.CargaDropNormal(ddl_editSite, "ID", "NOMBRE", dt2);
            ddl_site_SelectedIndexChanged(null, null);
            ddl_editSite_SelectedIndexChanged(null, null);
            //ZonaBC zona = new ZonaBC();
            //utils.CargaDrop(ddl_buscarZona, "ID", "DESCRIPCION", zona.ObtenerTodas());
            //utils.CargaDrop(ddl_editZona, "ID", "DESCRIPCION", zona.ObtenerTodas());
            //ObtenerPlaya(true);
        }
    }
Exemple #19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ProveedorBC p  = new ProveedorBC();
         SiteBC      s  = new SiteBC();
         CargaTipoBC ct = new CargaTipoBC();
         DataTable   dt;
         txt_buscarDesde.Text = DateTime.Now.AddDays(-utils.Intervalo_preingreso).ToShortDateString();
         txt_buscarHasta.Text = DateTime.Now.AddDays(utils.Intervalo_preingreso).ToShortDateString();
         dt = s.ObtenerTodos();
         utils.CargaDropNormal(ddl_buscarSite, "ID", "NOMBRE", dt);
         utils.CargaDrop(ddl_editSite, "ID", "NOMBRE", dt);
         dt = p.obtenerTodo();
         utils.CargaDropTodos(ddl_buscarProveedor, "ID", "DESCRIPCION", dt);
         utils.CargaDrop(ddl_editProveedor, "ID", "DESCRIPCION", dt);
         dt = ct.obtenerTodo();
         DataView dw = dt.AsDataView();
         dw.RowFilter = "ID IN (3,15)";
         utils.CargaDropTodos(ddl_buscarTipoCarga, "ID", "DESCRIPCION", dw.ToTable());
         utils.CargaDrop(ddl_editTipoCarga, "ID", "DESCRIPCION", dw.ToTable());
         ObtenerReservas(true);
     }
 }
Exemple #20
0
 public bool Crear(SiteBC site)
 {
     return(tran.Site_Crear(site));
 }
Exemple #21
0
    protected void gv_listaTrailer_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        TrailerBC trailer = new TrailerBC();

        if (e.CommandName == "BLOQUEAR")
        {
            TransportistaBC tran = new TransportistaBC();
            utils.CargaDrop(ddTipoBloqueo, "ID", "NOMBRE", tran.ObtenerMotivoBloqueo("1"));

            hf_idTrailer.Value = e.CommandArgument.ToString();
            trailer            = trailer.obtenerXID(int.Parse(hf_idTrailer.Value));

            lblRazonEliminacion.Text = "Bloquear Trailer";
            //msjEliminacion.Text = "Motivo de Bloqueo";
            ddl_buscarSite.SelectedValue = trailer.SITE_ID.ToString();
            dv_motivo.Visible            = true;
            dv_zona.Visible         = false;
            dv_playa.Visible        = false;
            dv_lugar.Visible        = false;
            btn_desbloquear.Visible = false;
            btn_bloquear.Visible    = true;
            btn_mover.Visible       = false;
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalBloqueo();", true);
        }
        if (e.CommandName == "DESBLOQUEAR")
        {
            hf_idTrailer.Value = e.CommandArgument.ToString();
            trailer            = trailer.obtenerXID(int.Parse(hf_idTrailer.Value));

            SiteBC site = new SiteBC();
            utils.CargaDrop(ddl_buscarSite, "ID", "NOMBRE", site.ObtenerTodos());
            lblRazonEliminacion.Text = "Desbloquear Trailer";
            //msjEliminacion.Text = "Motivo de Bloqueo";
            ddl_buscarSite.SelectedValue = trailer.SITE_ID.ToString();
            ddl_buscarSite_onChange(null, null);
            btn_buscarTrailer.Visible = true;
            dv_motivo.Visible         = false;
            dv_zona.Visible           = true;
            dv_playa.Visible          = true;
            dv_lugar.Visible          = true;
            btn_bloquear.Visible      = false;
            btn_desbloquear.Visible   = true;
            btn_mover.Visible         = false;
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalBloqueo();", true);
        }
        if (e.CommandName == "MOVER")
        {
            hf_idTrailer.Value = e.CommandArgument.ToString();
            trailer            = trailer.obtenerXID(int.Parse(hf_idTrailer.Value));

            SiteBC site = new SiteBC();
            utils.CargaDrop(ddl_buscarSite, "ID", "NOMBRE", site.ObtenerTodos());
            lblRazonEliminacion.Text = "Desbloquear Trailer";
            //msjEliminacion.Text = "Motivo de Bloqueo";
            btn_bloquear.Attributes.Remove("onclick");
            btn_bloquear.Attributes.Add("onclick", "BloqueaTrailer();");
            ddl_buscarSite.SelectedValue = trailer.SITE_ID.ToString();
            ddl_buscarSite_onChange(null, null);
            btn_buscarTrailer.Visible = true;
            dv_motivo.Visible         = false;
            dv_zona.Visible           = true;
            dv_playa.Visible          = true;
            dv_lugar.Visible          = true;
            btn_bloquear.Visible      = false;
            btn_desbloquear.Visible   = false;
            btn_mover.Visible         = true;
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalBloqueo();", true);
        }
        if (e.CommandName == "CONTINUAR")
        {
            hf_idTrailer.Value = e.CommandArgument.ToString();
            trailer            = trailer.obtenerXID(int.Parse(hf_idTrailer.Value));

            string    resultado;
            UsuarioBC usuario = new UsuarioBC();
            usuario = (UsuarioBC)Session["Usuario"];

            trailer.continuar(int.Parse(hf_idTrailer.Value), usuario.ID, out resultado);
            if (string.IsNullOrEmpty(resultado))
            {
                ObtenerTrailer(true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "showAlert('Solicitud realizada correctamente');", true);
                // ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalCerrar('modalBloqueo');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('" + resultado + "');", true);
            }
        }

        if (e.CommandName == "DESBLOQUEAR_nomov")
        {
            hf_idTrailer.Value = e.CommandArgument.ToString();
            trailer            = trailer.obtenerXID(int.Parse(hf_idTrailer.Value));


            desbloquear1_Click();
        }
    }
Exemple #22
0
    protected void gv_listar_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        TrailerBC trailer = new TrailerBC();

        if (e.CommandName == "BLOQUEAR")
        {
            TransportistaBC tran = new TransportistaBC();
            this.utils.CargaDrop(this.ddTipoBloqueo, "ID", "NOMBRE", tran.ObtenerMotivoBloqueo("1"));

            this.hf_idTrailer.Value = e.CommandArgument.ToString();
            trailer = trailer.obtenerXID(int.Parse(this.hf_idTrailer.Value));

            this.lblRazonEliminacion.Text = "Bloquear Trailer";
            //msjEliminacion.Text = "Motivo de Bloqueo";
            this.ddl_buscarSite.SelectedValue = trailer.SITE_ID.ToString();
            this.dv_motivo.Visible            = true;
            this.dv_zona.Visible         = false;
            this.dv_playa.Visible        = false;
            this.dv_lugar.Visible        = false;
            this.btn_desbloquear.Visible = false;
            this.btn_bloquear.Visible    = true;
            this.btn_mover.Visible       = false;

            this.ddl_bloqPlaya.Items.Clear();
            this.ddl_bloqLugar.Items.Clear();

            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalBloqueo();", true);
        }
        if (e.CommandName == "DESBLOQUEAR")
        {
            this.hf_idTrailer.Value = e.CommandArgument.ToString();
            trailer = trailer.obtenerXID(int.Parse(this.hf_idTrailer.Value));

            SiteBC site = new SiteBC();
            this.utils.CargaDrop(this.ddl_buscarSite, "ID", "NOMBRE", site.ObtenerTodos());
            this.lblRazonEliminacion.Text = "Desbloquear Trailer";
            //msjEliminacion.Text = "Motivo de Bloqueo";
            this.ddl_buscarSite.SelectedValue = trailer.SITE_ID.ToString();
            this.ddl_buscarSite_onChange(null, null);
            this.dv_motivo.Visible       = false;
            this.dv_zona.Visible         = true;
            this.dv_playa.Visible        = true;
            this.dv_lugar.Visible        = true;
            this.btn_bloquear.Visible    = false;
            this.btn_desbloquear.Visible = true;
            this.btn_mover.Visible       = false;

            this.ddl_bloqPlaya.Items.Clear();
            this.ddl_bloqLugar.Items.Clear();
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalBloqueo();", true);
        }
        if (e.CommandName == "MOVER")
        {
            this.hf_idTrailer.Value = e.CommandArgument.ToString();
            trailer = trailer.obtenerXID(int.Parse(this.hf_idTrailer.Value));

            lblRazonEliminacion.Text     = "Mover Trailer";
            ddl_buscarSite.SelectedValue = trailer.SITE_ID.ToString();
            ddl_buscarSite_onChange(null, null);
            dv_motivo.Visible       = false;
            dv_zona.Visible         = true;
            dv_playa.Visible        = true;
            dv_lugar.Visible        = true;
            btn_bloquear.Visible    = false;
            btn_desbloquear.Visible = false;
            btn_mover.Visible       = true;
            ddl_bloqPlaya.Items.Clear();
            ddl_bloqLugar.Items.Clear();
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "asdf", "modalBloqueo();", true);
        }
        if (e.CommandName == "CONTINUAR")
        {
            this.hf_idTrailer.Value = e.CommandArgument.ToString();
            trailer = trailer.obtenerXID(int.Parse(this.hf_idTrailer.Value));

            string    resultado;
            UsuarioBC usuario = new UsuarioBC();
            usuario = (UsuarioBC)this.Session["Usuario"];

            trailer.continuar(int.Parse(this.hf_idTrailer.Value), usuario.ID, out resultado);
            if (string.IsNullOrEmpty(resultado))
            {
                this.ObtenerTrailer(true);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Todo OK!');", true);
                // ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalCerrar('modalBloqueo');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", string.Format("alert('{0}');", resultado), true);
            }
        }
    }
Exemple #23
0
 public bool Modificar(SiteBC site)
 {
     return(tran.Site_Modificar(site));
 }