本文整理汇总了C#中Service.sugereAmigos方法的典型用法代码示例。如果您正苦于以下问题:C# Service.sugereAmigos方法的具体用法?C# Service.sugereAmigos怎么用?C# Service.sugereAmigos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service
的用法示例。
在下文中一共展示了Service.sugereAmigos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: sugestoes
protected void sugestoes()
{
Service a = new Service();
MembershipUser currentLoggedInUser = Membership.GetUser();
Guid userGuid = (Guid)Membership.GetUser().ProviderUserKey;
String userID = userGuid.ToString();
Rede.Perfil prof = Rede.Perfil.LoadByUserId(userID);
int profileID = 0;
if (prof == null)
{
prof = new Rede.Perfil(userID, currentLoggedInUser.UserName);
prof.Save();
}
profileID = Rede.Perfil.LoadProfileIDByUserId(userID);
if (profileID == 0)
{
}
else
{
//a.sugereAmigos(profileID);
String res = a.sugereAmigos(profileID);
sugere_amigos(res);
Dictionary<string, List<string>> dictionary = dicUserTag(res);
foreach (var entry in dictionary)
{
//Console.WriteLine(entry.Key);
TableRow tr = new TableRow();
TableCell tcNome = new TableCell();
TableCell tcNick = new TableCell();
TableCell tcTags = new TableCell();
String nome = Rede.Perfil.LoadNameByProfileId(Convert.ToInt32(entry.Key));
String nick = Rede.Perfil.LoadNickByProfileId(Convert.ToInt32(entry.Key));
//tc1.Text = entry.Key;
tcNome.Text = nome;
tcNick.Text = nick;
CheckBox check = new CheckBox();
check.ID = entry.Key;
//Button b = new Button();
//b.OnClientClick = "convidar";
//b.ID = "convidar"+entry.Key;
//b.Text = "Convidar";
//b.Click += b_Click;
String tags = "";
foreach (var tag in entry.Value)
{
if (tags.Equals(""))
tags = tag;
else
tags += ", " + tag;
}
tcTags.Text = tags;
tr.Cells.Add(tcNome);
tr.Cells.Add(tcNick);
tr.Cells.Add(tcTags);
TableCell tcBtn = new TableCell();
tcBtn.Controls.Add(check);
tr.Cells.Add(tcBtn);
Table1.Rows.Add(tr);
}
}
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
MembershipUser currentLoggedInUser = Membership.GetUser();
string id = Convert.ToString(currentLoggedInUser.ProviderUserKey);
Rede.Perfil ProfileIDA = Rede.Perfil.LoadByUserId(id);
SqlDataSource2.SelectCommand="SELECT [Avatar], [Nome], [Estado] from [ViewFriends] WHERE ([ProfileIDA]=" + ProfileIDA.ID+" AND [Estado]='pendente')";
SqlDataSource3.SelectCommand = "SELECT [Avatar], [Nome] from [ViewFriends] WHERE ([ProfileIDA]=" + ProfileIDA.ID + " AND [Estado]='feito')";
GridView2.DataBind();
GridView3.DataBind();
if (!Page.IsPostBack)
{
Session.Add("lista", listtag);
}
else
listtag = (List<string>)Session.Contents["lista"];
Service a = new Service();
Guid userGuid = (Guid)Membership.GetUser().ProviderUserKey;
String userID = userGuid.ToString();
int profileID = Rede.Perfil.LoadProfileIDByUserId(userID);
//a.sugereAmigos(profileID);
String res = a.sugereAmigos(profileID);
sugere_amigos(res);
Dictionary<string, List<string>> dictionary = dicUserTag(res);
foreach (var entry in dictionary)
{
//Console.WriteLine(entry.Key);
TableRow tr = new TableRow();
TableCell tcNome = new TableCell();
TableCell tcNick = new TableCell();
TableCell tcTags = new TableCell();
String nome = Rede.Perfil.LoadNameByProfileId(Convert.ToInt32(entry.Key));
String nick = Rede.Perfil.LoadNickByProfileId(Convert.ToInt32(entry.Key));
//tc1.Text = entry.Key;
tcNome.Text = nome;
tcNick.Text = nick;
CheckBox check = new CheckBox();
check.ID = entry.Key;
//Button b = new Button();
//b.OnClientClick = "convidar";
//b.ID = "convidar"+entry.Key;
//b.Text = "Convidar";
//b.Click += b_Click;
String tags = "";
foreach (var tag in entry.Value)
{
if (tags.Equals(""))
tags = tag;
else
tags += ", " + tag;
}
tcTags.Text = tags;
tr.Cells.Add(tcNome);
tr.Cells.Add(tcNick);
tr.Cells.Add(tcTags);
TableCell tcBtn=new TableCell();
tcBtn.Controls.Add(check);
tr.Cells.Add(tcBtn);
Table1.Rows.Add(tr);
}
}