本文整理汇总了C#中Bussiness.PlayerBussiness.GetPlayerPage方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness.GetPlayerPage方法的具体用法?C# PlayerBussiness.GetPlayerPage怎么用?C# PlayerBussiness.GetPlayerPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bussiness.PlayerBussiness
的用法示例。
在下文中一共展示了PlayerBussiness.GetPlayerPage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildCelebUsers
public static string BuildCelebUsers(string file, int order, string fileNotCompress)
{
bool value = false;
string message = "Fail!";
XElement result = new XElement("Result");
try
{
int page = 1;
int size = 50;
//int order = 5;
int userID = -1;
int total = 0;
bool resultValue = false;
using (PlayerBussiness db = new PlayerBussiness())
{
PlayerInfo[] infos = db.GetPlayerPage(page, size, ref total, order, userID, ref resultValue);
if (resultValue)
{
foreach (PlayerInfo info in infos)
{
result.Add(FlashUtils.CreateCelebInfo(info));
}
value = true;
message = "Success!";
}
}
}
catch (Exception ex)
{
log.Error(file + " is fail!", ex);
}
result.Add(new XAttribute("value", value));
result.Add(new XAttribute("message", message));
result.Add(new XAttribute("date", System.DateTime.Today.ToString("yyyy-MM-dd")));
//csFunction.CreateCompressXml(result, "CelebForUsers", false);
if (!string.IsNullOrEmpty(fileNotCompress))
{
csFunction.CreateCompressXml(result, fileNotCompress, false);
}
return csFunction.CreateCompressXml(result, file, true);
}
示例2: ProcessRequest
public void ProcessRequest(HttpContext context)
{
bool value = false;
string message = "Fail!";
XElement result = new XElement("Result");
int total = 0;
try
{
int page = 1;//int.Parse(context.Request["page"]);
int size = 10;//int.Parse(context.Request["size"]);
int order = int.Parse(context.Request["order"]);
int userID = -1;// int.Parse(context.Request["state"]);
bool resultValue = false;
using (PlayerBussiness db = new PlayerBussiness())
{
PlayerInfo[] infos = db.GetPlayerPage(page, size, ref total, order, userID, ref resultValue);
if (resultValue)
{
foreach (PlayerInfo info in infos)
{
XElement node = new XElement("Item", new XAttribute("ID", info.ID),
new XAttribute("NickName", info.NickName == null ? "" : info.NickName),
new XAttribute("Grade", info.Grade),
new XAttribute("Colors", info.Colors == null ? "" : info.Colors),
new XAttribute("Skin", info.Skin == null ? "" : info.Skin),
new XAttribute("Sex", info.Sex),
new XAttribute("Style", info.Style == null ? "" : info.Style),
new XAttribute("ConsortiaName", info.ConsortiaName == null ? "" : info.ConsortiaName),
new XAttribute("Hide", info.Hide),
new XAttribute("Offer", info.Offer),
new XAttribute("ReputeOffer", info.ReputeOffer),
new XAttribute("ConsortiaHonor", info.ConsortiaHonor),
new XAttribute("ConsortiaLevel", info.ConsortiaLevel),
new XAttribute("ConsortiaRepute", info.ConsortiaRepute),
new XAttribute("WinCount", info.Win),
new XAttribute("TotalCount", info.Total),
new XAttribute("EscapeCount", info.Escape),
new XAttribute("Repute", info.Repute),
new XAttribute("GP", info.GP));
result.Add(node);
}
value = true;
message = "Success!";
}
}
}
catch (Exception ex)
{
log.Error("LoadUsersSort", ex);
}
result.Add(new XAttribute("total", total));
result.Add(new XAttribute("value", value));
result.Add(new XAttribute("message", message));
context.Response.ContentType = "text/plain";
context.Response.Write(result.ToString(false));
}