Exemple #1
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;
            }
        }
    }
Exemple #2
0
    protected void btn_confirmar_Click(object sender, EventArgs e)
    {
        SolicitudLocalesBC s = new SolicitudLocalesBC();

        s.SOLI_ID    = int.Parse(hf_idSolicitud.Value);
        s.LOCA_ID    = int.Parse(hf_idLocal.Value);
        s.SOAN_ORDEN = int.Parse(hf_orden.Value);
        s.LUGA_ID    = int.Parse(hf_idLugar.Value);
        if (s.Eliminar())
        {
            SolicitudBC sol = new SolicitudBC();
            Ordenar(sol.ObtenerAndenesXSolicitudId(s.SOLI_ID), true);
            gv_solLocales.DataSource = ViewState["datosA"];
            gv_solLocales.DataBind();
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "msj", "alert('Registro eliminado!');", true);
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalConfirmar');", true);
        }
    }