private TicketAcceso BuscarTicket(string lUrlKey) { Funcion oFuncion = new Funcion(); bool bolExists = false; oFuncion.Cargar(lUrlKey); foreach (Rol itemRol in oDatosUsuario.Roles.Values) { if (oFuncion.Roles.Contains(itemRol.Id)) { bolExists = true; break; } } TicketAcceso tkSalida = null; if (bolExists) { tkSalida = new TicketAcceso(oFuncion.Id, oFuncion.Nombre, intVencimientoTicket); } return(tkSalida); }
private void CargarFuncion(int lIdFuncion) { Funcion funcion = new Funcion(); funcion.Cargar(lIdFuncion); txtNombre.Text = funcion.Nombre; txtUrl.Text = funcion.UrlKey; }
private void btnAddFuncion_Click(object sender, EventArgs e) { if (lstFunciones.SelectedItem != null && rol.Funciones[Convert.ToInt32(lstFunciones.SelectedValue)] == null) { Funcion funcion = new Funcion(); funcion.Cargar(Convert.ToInt32(lstFunciones.SelectedValue)); rol.Funciones.Add(funcion.Id, funcion); Session["Rol"] = rol; CargarRol(); CargarFunciones(); } }
protected void btnAceptar_Click(object sender, System.EventArgs e) { Funcion funcion = new Funcion(); if (intIdFuncion != -1) { funcion.Cargar(intIdFuncion); funcion.Nombre = txtNombre.Text; funcion.UrlKey = txtUrl.Text; funcion.Modificar(); } else { funcion.Nombre = txtNombre.Text; funcion.UrlKey = txtUrl.Text; funcion.Crear(); } Response.Redirect("ListaFunciones.aspx"); }