Exemplo n.º 1
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int                   index           = Convert.ToInt32(e.CommandArgument);
            StringBuilder         sMensajelbl     = new StringBuilder(string.Empty);
            List <CatGeneralesBE> lstCatGenerales = (List <CatGeneralesBE>)ViewState["lstCatGenerales"];
            CatGeneralesBE        item            = new CatGeneralesBE();

            string sIdCatalogo = grdCatGenerales.DataKeys[index].Value.ToString();

            item = lstCatGenerales[int.Parse(sIdCatalogo) - 1];

            if (e.CommandName.Equals("AdmonCatalogo"))
            {
                GridViewRow gvrow = grdCatGenerales.Rows[index];

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script type='text/javascript'>");
                sb.Append("$('#mdlAdmon').modal('show');");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "mdlAdmonScript", sb.ToString(), false);

                sMensajelbl.Append(" ADMINISTRAR CATALOGO ");
                sMensajelbl.Append(item.psNOMBRECATALOGO);

                lblAdministrar.Text = sMensajelbl.ToString();
                CatalogosWUC.SetGrid(sIdCatalogo, true);
                CatalogosWUC.RegisterGridpaging();
            }
            else if (e.CommandName.Equals("editRecord"))
            {
                GridViewRow gvrow = grdCatGenerales.Rows[index];
                sIdCatalogo          = grdCatGenerales.DataKeys[index].Value.ToString();
                ViewState["sEditar"] = "1";


                //GridViewRow gvrow = GridView1.Rows[index];
                //lblIDAplicacion.Text = HttpUtility.HtmlDecode(gvrow.Cells[0].Text).ToString();
                //txtDescripcion.Text = HttpUtility.HtmlDecode(gvrow.Cells[1].Text);
                //txtPassword.Text = HttpUtility.HtmlDecode(gvrow.Cells[2].Text);

                //lblResult.Visible = false;
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script type='text/javascript'>");
                sb.Append("$('#mdlCatalogo').modal('show');");
                sb.Append(@"</script>");

                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "mdlCatalogoScript", sb.ToString(), false);
                CatGeneralesWUC.SetDdlCatalogos(2);
                GetCatGenerales(sIdCatalogo);

                sMensajelbl.Append(" EDITAR CATALOGO ");
                sMensajelbl.Append(item.psNOMBRECATALOGO);

                lblTituloModal.Text = sMensajelbl.ToString();
            }
        }
Exemplo n.º 2
0
        protected void Add_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(ViewState["sEditar"].ToString()))
            {
                AddCatGenerales();
            }
            else
            {
                SetCatGenerales();
            }

            CatGeneralesWUC.ClearGatGenerales();
            CatGeneralesWUC.SetDdlCatalogos(1);

            ViewState["sEditar"] = string.Empty;
        }
Exemplo n.º 3
0
        protected void btnShowAdd_Click(object sender, EventArgs e)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            sb.Append(@"<script type='text/javascript'>");
            sb.Append("$('");
            sb.Append("#mdlCatalogo");
            sb.Append("').modal('show');");
            sb.Append(@"</script>");
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AddShowModalScript", sb.ToString(), false);

            CatGeneralesWUC.SetDdlCatalogos(1);

            lblTituloModal.Text = "Agregar Catálogo";

            //System.Text.StringBuilder sb = new System.Text.StringBuilder();
            //sb.Append(@"<script type='text/javascript'>");
            //sb.Append("$('#mdlCatalogo').modal('show');");
            //sb.Append(@"</script>");
            //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AddShowModalScript", sb.ToString(), false);
        }