private void RellenaAmistades() { if ((User.Identity.IsAuthenticated) && (this.idindicator.HasValue)) { int?UserId = CalculaUserId(); if (UserId.HasValue) { ListView lstFriends = (ListView)LoginViewIndicador.FindControl("lstFriends"); if (lstFriends != null) { try { using (Clases.cASPNET_FRIENDSHIP objAmigos = new Clases.cASPNET_FRIENDSHIP()) { objAmigos.fromuserid = UserId.Value; lstFriends.DataSource = objAmigos.CommonUsers(10, 1, this.idindicator.Value, string.Empty, string.Empty); lstFriends.DataBind(); } } catch (Exception excp) { ExceptionUtility.LogException(excp, "Error en la función << RellenaAmistades() >>"); } } } else { Response.Redirect("~/errors/notfound.aspx"); } } else { Response.Redirect("~/errors/notfound.aspx"); } }
private void RellenaFriends() { if (this.iduser.HasValue) { try { using (Clases.cASPNET_FRIENDSHIP objUsuarios = new Clases.cASPNET_FRIENDSHIP()) { objUsuarios.fromuserid = this.iduser; objUsuarios.aceptado = true; lstFriends.DataSource = objUsuarios.ObtenerDatos(string.Empty, 15, 1, string.Empty); lstFriends.DataBind(); } } catch (Exception excp) { ExceptionUtility.LogException(excp, "Error en la función << RellenaFriends() >>"); } finally { numTabFriends.Text = lstFriends.Items.Count.ToString(); if (lstFriends.Items.Count == 0) { PanelMasFriends.Visible = true; lbMasFriends.Text = "No friends present"; } else if (lstFriends.Items.Count <= 6) { PanelMasFriends.Visible = false; } else { PanelMasFriends.Visible = true; lbMasFriends.Text = Convert.ToString(lstFriends.Items.Count - 6) + " more"; } } } else { Response.Redirect("~/errors/notfound.aspx"); } }
private void RellenaAmistades() { if (User.Identity.IsAuthenticated) { MembershipUser usr = Membership.GetUser(); if (usr != null) { try { using (Clases.cASPNET_FRIENDSHIP objAmigos = new Clases.cASPNET_FRIENDSHIP()) { objAmigos.aceptado = true; objAmigos.fromuserid = Convert.ToInt32(usr.ProviderUserKey); lstFriends.DataSource = objAmigos.CommonUsers(10, 1, -1, string.Empty, string.Empty); lstFriends.DataBind(); } } catch (Exception excp) { ExceptionUtility.LogException(excp, "Error en la función << RellenaAmistades() >>"); } } } }
private void RellenaUltimosAmigos() { if (this.iduser.HasValue) { try { using (Clases.cASPNET_FRIENDSHIP objAmigos = new Clases.cASPNET_FRIENDSHIP()) { objAmigos.fromuserid = this.iduser; objAmigos.aceptado = true; lstLastSixFriends.DataSource = objAmigos.ObtenerDatos(6, 1, " FECHA DESC "); lstLastSixFriends.DataBind(); } } catch (Exception excp) { ExceptionUtility.LogException(excp, "Error en la función << RellenaUltimosAmigos() >>"); } } else { Response.Redirect("~/errors/notfound.aspx"); } }