当前位置: 首页>>代码示例>>C#>>正文


C# PlayerBussiness.GetFriendsAll方法代码示例

本文整理汇总了C#中Bussiness.PlayerBussiness.GetFriendsAll方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness.GetFriendsAll方法的具体用法?C# PlayerBussiness.GetFriendsAll怎么用?C# PlayerBussiness.GetFriendsAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bussiness.PlayerBussiness的用法示例。


在下文中一共展示了PlayerBussiness.GetFriendsAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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["id"]);
                using (PlayerBussiness db = new PlayerBussiness())
                {
                    FriendInfo[] infos = db.GetFriendsAll(id);

                    foreach (FriendInfo g in infos)
                    {
                        XElement node = new XElement("Item", new XAttribute("ID", g.FriendID),
                            //new XAttribute("ID",g.ID),
                            new XAttribute("NickName", g.NickName),
                            new XAttribute("LoginName", g.UserName),
                            new XAttribute("Style", g.Style),
                            new XAttribute("Sex", g.Sex == 1 ? true : false),
                            new XAttribute("Colors", g.Colors),
                            new XAttribute("Grade", g.Grade),
                            new XAttribute("Hide", g.Hide),
                            new XAttribute("ConsortiaName", g.ConsortiaName),
                            new XAttribute("TotalCount", g.Total),
                            new XAttribute("EscapeCount", g.Escape),
                            new XAttribute("WinCount", g.Win),
                            new XAttribute("Offer", g.Offer),
                            new XAttribute("Relation", g.Relation),
                            new XAttribute("Repute", g.Repute),
                            new XAttribute("State", g.State == 1 ? 1 : 0),
                            new XAttribute("Nimbus",g.Nimbus),
                            new XAttribute("DutyName", g.DutyName));
                        result.Add(node);
                    }
                }

                value = true;
                message = "Success!";
            }
            catch (Exception ex)
            {
                log.Error("IMListLoad", ex);
            }

            result.Add(new XAttribute("value", value));
            result.Add(new XAttribute("message", message));

            context.Response.ContentType = "text/plain";
            context.Response.Write(result.ToString(false));
            //context.Response.BinaryWrite(StaticFunction.Compress(result.ToString(false)));
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:53,代码来源:IMListLoad.ashx.cs

示例2: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            bool value = false;
            string message = "Fail!";
            XElement result = new XElement("Result");

            try
            {
                string username = context.Request["uname"];
                int id = Convert.ToInt32(context.Request["id"]);
                int selfid = Convert.ToInt32(context.Request["selfid"]);
                string key = context.Request["key"];
                using (PlayerBussiness db = new PlayerBussiness())
                {
                    FriendInfo[] infos = db.GetFriendsAll(selfid);
            //<customList ID="0" Name="Bạn bè" />
              		//<customList ID="1" Name="D.sách đen" />
              		//<customList ID="10" Name="" />
              		//<customList ID="11" Name="" />
              		//<customList ID="12" Name="" />
              		//<customList ID="13" Name="" />
              		//<customList ID="14" Name="" />
              		//<customList ID="15" Name="" />
              		//<customList ID="16" Name="" />
             		//<customList ID="17" Name="" />
              		//<customList ID="18" Name="" />
              		//<customList ID="19" Name="" />
                    XElement node0 = new XElement("customList",
                        new XAttribute("ID", 0),
                        new XAttribute("Name", "Bạn bè"));
                    result.Add(node0);
                    node0 = new XElement("customList",
                        new XAttribute("ID", 1),
                        new XAttribute("Name", "D.sách đen"));
                    result.Add(node0);
                    node0 = new XElement("customList",
                       new XAttribute("ID", 10),
                       new XAttribute("Name", ""));
                    result.Add(node0);
                    node0 = new XElement("customList",
                       new XAttribute("ID", 11),
                       new XAttribute("Name", ""));
                    result.Add(node0);
                    node0 = new XElement("customList",
                       new XAttribute("ID", 12),
                       new XAttribute("Name", ""));
                    result.Add(node0);
                    node0 = new XElement("customList",
                       new XAttribute("ID", 13),
                       new XAttribute("Name", ""));
                    result.Add(node0);
                    node0 = new XElement("customList",
                       new XAttribute("ID", 14),
                       new XAttribute("Name", ""));
                    result.Add(node0);
                    node0 = new XElement("customList",
                       new XAttribute("ID", 15),
                       new XAttribute("Name", ""));
                    result.Add(node0);
                    node0 = new XElement("customList",
                       new XAttribute("ID", 16),
                       new XAttribute("Name", ""));
                    result.Add(node0);
                    node0 = new XElement("customList",
                       new XAttribute("ID", 17),
                       new XAttribute("Name", ""));
                    result.Add(node0);
                    node0 = new XElement("customList",
                       new XAttribute("ID", 18),
                       new XAttribute("Name", ""));
                    result.Add(node0);
                    node0 = new XElement("customList",
                       new XAttribute("ID", 19),
                       new XAttribute("Name", ""));
                    result.Add(node0);
                    foreach (FriendInfo g in infos)
                    {
                        XElement node = new XElement("Item",
                        new XAttribute("ID", g.FriendID),
                            new XAttribute("NickName", g.NickName),
                            new XAttribute("LoginName", g.UserName),
                            new XAttribute("Style", g.Style),
                            new XAttribute("Sex", g.Sex == 1 ? true : false),
                            new XAttribute("Colors", g.Colors),
                            new XAttribute("Grade", g.Grade),
                            new XAttribute("Hide", g.Hide),
                            new XAttribute("ConsortiaName", g.ConsortiaName),
                            new XAttribute("TotalCount", g.Total),
                            new XAttribute("EscapeCount", g.Escape),
                            new XAttribute("WinCount", g.Win),
                            new XAttribute("Offer", g.Offer),
                            new XAttribute("Relation", g.Relation),
                            new XAttribute("Repute", g.Repute),
                            new XAttribute("State", g.State == 1 ? 1 : 0),
                            new XAttribute("Nimbus",g.Nimbus),
                            new XAttribute("DutyName", g.DutyName),
                            new XAttribute("AchievementPoint",0),
                            new XAttribute("Rank","Chiến sĩ siêu cấp"),
                            new XAttribute("FightPower",13528),
                            new XAttribute("ApprenticeshipState",0),
//.........这里部分代码省略.........
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:101,代码来源:IMListLoad.ashx.cs

示例3: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            bool value = false;
            string message = "Fail!";
            XElement result = new XElement("Result");
            //id=4&key=8b4b74954e42c4c350764b0f8f513899&recentContacts=0&rnd=0%2E9269368425011635&selfid=4

            try
            {
                int recentContacts = Convert.ToInt32(context.Request["recentContacts"]);
                int id = Convert.ToInt32(context.Request["id"]);
                int selfid = Convert.ToInt32(context.Request["selfid"]);
                string key = context.Request["key"];
                using (PlayerBussiness db = new PlayerBussiness())
                {
                    FriendInfo[] infos = db.GetFriendsAll(selfid);

                    foreach (FriendInfo g in infos)
                    {
                        XElement node = new XElement("Item",
                        new XAttribute("ID", g.FriendID),
                            new XAttribute("NickName", g.NickName),
                            new XAttribute("LoginName", g.UserName),
                            new XAttribute("Style", g.Style),
                            new XAttribute("Sex", g.Sex == 1 ? true : false),
                            new XAttribute("Colors", g.Colors),
                            new XAttribute("Grade", g.Grade),
                            new XAttribute("Hide", g.Hide),
                            new XAttribute("ConsortiaName", g.ConsortiaName),
                            new XAttribute("TotalCount", g.Total),
                            new XAttribute("EscapeCount", g.Escape),
                            new XAttribute("WinCount", g.Win),
                            new XAttribute("Offer", g.Offer),
                            new XAttribute("Relation", g.Relation),
                            new XAttribute("Repute", g.Repute),
                            new XAttribute("State", g.State == 1 ? 1 : 0),
                            new XAttribute("Nimbus", g.Nimbus),
                            new XAttribute("DutyName", g.DutyName),
                            new XAttribute("AchievementPoint", 0),
                            new XAttribute("Rank", "Chiến sĩ siêu cấp"),
                            new XAttribute("FightPower", 13528),
                            new XAttribute("ApprenticeshipState", 0),
                            new XAttribute("BBSFriends", false),
                            new XAttribute("Birthday", DateTime.Now),
                            new XAttribute("UserName", g.UserName),
                            new XAttribute("IsMarried", false));
                        result.Add(node);
                    }
                }

                value = true;
                message = "Success!";
            }
            catch (Exception ex)
            {
                log.Error("IMRecentContactsList", ex);
            }
            result.Add(new XAttribute("value", value));
            result.Add(new XAttribute("message", message));

            context.Response.ContentType = "text/plain";
            context.Response.Write(result.ToString(false));
        }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:63,代码来源:IMRecentContactsList.ashx.cs


注:本文中的Bussiness.PlayerBussiness.GetFriendsAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。