コード例 #1
0
        protected void permisosno_ItemEditing(object sender, ListViewEditEventArgs e)
        {
            try
            {
                permisosno.EditIndex = e.NewEditIndex;
                Label menu = (Label)permisosno.Items[e.NewEditIndex].FindControl("idMENUlist");

                obj_permisos = new Permisos(
                    dropdownRoles.SelectedValue,
                    menu.Text
                    );

                if (obj_permisos.InsertarPermiso(obj_permisos))
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", " swal('REGISTRO ALMACENADO', '', 'success');", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", " swal('ERROR AL ALMACENAR', '', 'error');", true);
                }
                string currentPage = this.Page.Request.AppRelativeCurrentExecutionFilePath;
                Response.Redirect(currentPage);
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", " swal('OCURRIO UNA EXCEPTION', '', 'error');", true);
            }
        }