protected void Page_Load(object sender, EventArgs e) { usuarioDao = daoFactory.GetUsuarioDao(); if (!IsPostBack) { txtOficina.Items.Clear(); txtOficina.Items.Add(NuevoListItem(Constantes.TEXTO_SELECCION, Constantes.TEXTO_BLANCO)); foreach (DbDominio.Oficina of in listaDeOficina()) { txtOficina.Items.Add(NuevoListItem(of.Nombre, of.CveOficina.ToString())); } txtPerfil.Items.Clear(); txtPerfil.Items.Add(NuevoListItem(Constantes.TEXTO_SELECCION, Constantes.TEXTO_BLANCO)); foreach (DbDominio.Perfil per in listaDePerfil()) { txtPerfil.Items.Add(NuevoListItem(per.Nombre, per.Id.ToString())); } if (Session[Constantes.WEB_VARIABLE_SESSION_ID] == null) { Title = "Alta de Registro"; txtId.Value = null; txtNombre.Text = null; txtUsername.Text = null; txtPasswd.Text = null; txtEmail.Text = null; } else { try { Asistencia.DbDominio.Usuario obj = usuarioDao.GetById(Int32.Parse(Session[Constantes.WEB_VARIABLE_SESSION_ID].ToString())); Title = "Edición de Registro"; txtId.Value = obj.CveUsuario.ToString(); txtNombre.Text = obj.Nombre; txtUsername.Text = obj.Username; txtUsername.ReadOnly = true; txtEmail.Text = obj.CorreoElectronico; lbPasswd.Text = "Cambiar Contraseña:"; if (obj.Oficina_cve_oficina != null) { txtOficina.SelectedValue = obj.Oficina_cve_oficina.CveOficina.ToString(); } if (obj.Perfil_id_perfil != null) { txtPerfil.SelectedValue = obj.Perfil_id_perfil.Id.ToString(); } } catch (Exception ex) { log.Error(String.Format("Error al intentar Obtener los datos Del Usuario a Editar. Mensaje: [{0}] ", ex.Message)); ManejarExcepcion(ex); } } } }
protected void Page_Load(object sender, EventArgs e) { log.Info(String.Format("El usuario: [{0}] ha visitado la pagina de Listado de Usuarios", UsuarioActual.Nombre)); usuarioDao = daoFactory.GetUsuarioDao(); if (!IsPostBack) { MostrarJavascriptTabla(); CargarListado(); } }