public static string Bulid(HttpContext context) { bool value = false; string message = "Fail!"; XElement result = new XElement("Result"); try { using (ActiveBussiness db = new ActiveBussiness()) { ActiveInfo[] infos = db.GetAllActives(); foreach (ActiveInfo info in infos) { result.Add(FlashUtils.CreateActiveInfo(info)); } value = true; message = "Success!"; } } catch (Exception ex) { log.Error("Load Active is fail!", ex); } result.Add(new XAttribute("value", value)); result.Add(new XAttribute("message", message)); return(csFunction.CreateCompressXml(context, result, "ActiveList", true)); }
public int HandlePacket(GameClient client, GSPacketIn packet) { int activeID = packet.ReadInt(); string awardID = packet.ReadString(); string msg = "ActivePullDownHandler.Fail"; using (ActiveBussiness db = new ActiveBussiness()) { int result = db.PullDown(activeID, awardID, client.Player.PlayerCharacter.ID, ref msg); if (result == 0) { client.Out.SendMailResponse(client.Player.PlayerCharacter.ID, eMailRespose.Receiver); } if (msg != "ActiveBussiness.Msg0") { client.Out.SendMessage(eMessageType.ERROR, LanguageMgr.GetTranslation(msg)); } else { client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation(msg)); } } return(0); }