本文整理汇总了C#中Bussiness.PlayerBussiness.GetMailByUserID方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness.GetMailByUserID方法的具体用法?C# PlayerBussiness.GetMailByUserID怎么用?C# PlayerBussiness.GetMailByUserID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bussiness.PlayerBussiness
的用法示例。
在下文中一共展示了PlayerBussiness.GetMailByUserID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessRequest
public void ProcessRequest(HttpContext context)
{
bool value = false;
string message = "Fail!";
XElement result = new XElement("Result");
try
{
int id = int.Parse(context.Request.QueryString["selfid"]);
if (id != 0)
{
using (PlayerBussiness db = new PlayerBussiness())
{
MailInfo[] infos = db.GetMailByUserID(id);
foreach (MailInfo info in infos)
{
//TimeSpan days = DateTime.Now.Subtract(info.SendTime);
XElement node = new XElement("Item", new XAttribute("ID", info.ID),
new XAttribute("Title", info.Title),
new XAttribute("Content", info.Content),
new XAttribute("Sender", info.Sender),
new XAttribute("SendTime", info.SendTime.ToString("yyyy-MM-dd HH:mm:ss")),
//new XAttribute("Days", info.ValidDate/24 - days.Days ),
new XAttribute("Gold", info.Gold),
new XAttribute("Money", info.Money),
new XAttribute("Annex1ID", info.Annex1 == null ? "" : info.Annex1),
new XAttribute("Annex2ID", info.Annex2 == null ? "" : info.Annex2),
new XAttribute("Annex3ID", info.Annex3 == null ? "" : info.Annex3),
new XAttribute("Annex4ID", info.Annex4 == null ? "" : info.Annex4),
new XAttribute("Annex5ID", info.Annex5 == null ? "" : info.Annex5),
new XAttribute("Type", info.Type),
new XAttribute("ValidDate", info.ValidDate),
new XAttribute("IsRead", info.IsRead));
AddAnnex(node, info.Annex1);
AddAnnex(node, info.Annex2);
AddAnnex(node, info.Annex3);
AddAnnex(node, info.Annex4);
AddAnnex(node, info.Annex5);
//using (PlayerBussiness pb = new PlayerBussiness())
//{
// if (!string.IsNullOrEmpty(info.Annex1))
// {
// ItemInfo pr = pb.GetUserItemSingle(int.Parse(info.Annex1));
// if (pr != null)
// {
// node.Add(Road.Flash.FlashUtils.CreateGoodsInfo(pr));
// }
// }
// if (!string.IsNullOrEmpty(info.Annex2))
// {
// ItemInfo pr = pb.GetUserItemSingle(int.Parse(info.Annex2));
// if (pr != null)
// {
// node.Add(Road.Flash.FlashUtils.CreateGoodsInfo(pr));
// }
// }
// if (!string.IsNullOrEmpty(info.Annex3))
// {
// ItemInfo pr = pb.GetUserItemSingle(int.Parse(info.Annex3));
// if (pr != null)
// {
// node.Add(Road.Flash.FlashUtils.CreateGoodsInfo(pr));
// }
// }
// if (!string.IsNullOrEmpty(info.Annex4))
// {
// ItemInfo pr = pb.GetUserItemSingle(int.Parse(info.Annex4));
// if (pr != null)
// {
// node.Add(Road.Flash.FlashUtils.CreateGoodsInfo(pr));
// }
// }
// if (!string.IsNullOrEmpty(info.Annex5))
// {
// ItemInfo pr = pb.GetUserItemSingle(int.Parse(info.Annex5));
// if (pr != null)
// {
// node.Add(Road.Flash.FlashUtils.CreateGoodsInfo(pr));
// }
// }
//}
result.Add(node);
}
//MailInfo[] sInfos = db.GetMailBySenderID(id);
//foreach (MailInfo info in sInfos)
//{
// result.Add(Road.Flash.FlashUtils.CreateMailInfo(info,"SendMail"));
//}
}
value = true;
message = "Success!";
}
//.........这里部分代码省略.........