コード例 #1
0
        public IActionResult acceptjoin(int logId, int groupId, int status)
        {
            var u = this.UserInfo;

            if (u == null)
            {
                return(WriteFail("参数无效"));
            }


            DataSet ds;
            int     ret = DataProcedureHelper.WEB_PyGroupAcceptJoin(
                _userid: (int)u.UserId,
                _friendid: groupId,
                _joinid: logId,
                _status: status,
                outDataSet: out ds);


            if (ret == 1)
            {
                return(WriteSuccess());
            }

            return(WriteFail("操作失败"));
        }
コード例 #2
0
        public IActionResult create(string name)
        {
            var u = this.UserInfo;

            if (u == null)
            {
                return(WriteFail("参数无效"));
            }

            DataSet ds;
            int     ret = DataProcedureHelper.WEB_PyGroupCreate(
                _userid: (int)u.UserId,
                _name: name,
                outDataSet: out ds
                );

            if (ret != 1)
            {
                return(WriteFail("创建亲友圈失败"));
            }
            else
            {
                return(WriteSuccess("OK"));
            }
        }
コード例 #3
0
        public IActionResult setadmin(int userid, int groupId, int isadmin)
        {
            var u = this.UserInfo;

            if (u == null)
            {
                return(WriteFail("参数错误"));
            }

            isadmin = isadmin == 1 ? 1 : 0;

            DataSet ds;
            int     ret = DataProcedureHelper.WEB_PyGroupSetAdmin(
                _userid: (int)u.UserId,
                _friendid: groupId,
                _aid: userid,
                _isadmin: isadmin,
                outDataSet: out ds);

            if (ret == 1)
            {
                return(WriteSuccess());
            }

            return(WriteFail("操作失败"));
        }
コード例 #4
0
        public IActionResult addrule(int groupId, int gameId, string ruleStr, string ruleDesc)
        {
            var u = this.UserInfo;

            if (u == null)
            {
                return(WriteFail("参数错误"));
            }


            DataSet ds;
            int     ret = DataProcedureHelper.WEB_PyGroupAddRule(
                _userid: (int)u.UserId,
                _friendid: groupId,
                _gameid: gameId,
                _ruledesc: ruleDesc,
                _rulestr: ruleStr,
                outDataSet: out ds);



            if (ret == 1)
            {
                return(WriteSuccess());
            }

            return(WriteFail("操作失败"));
        }
コード例 #5
0
        public IActionResult getuserlist(int groupId, int startId, int count)
        {
            var u = this.UserInfo;

            if (u == null)
            {
                return(WriteFail("参数错误"));
            }
            if (startId == 0)
            {
                startId = int.MaxValue;
            }
            DataSet ds;
            int     ret = DataProcedureHelper.WEB_PyGroupUserList(
                _userid: (int)u.UserId,
                _friendid: groupId,
                _size: count,
                _startid: startId,
                outDataSet: out ds);

            if (ret != 1)
            {
                return(WriteFail("加载成员列表失败"));
            }

            var _items = ds.Tables[0].Rows.Cast <DataRow>().Select(dr =>
            {
                return(new
                {
                    id = dr.GetData("id").ConvertToInt32(),
                    Header = dr.GetData("Header").ToString(),
                    IsAdmin = dr.GetData("IsAdmin").ConvertToInt32(),
                    UserId = dr.GetData("UserId").ConvertToUInt32(),
                    Name = dr.GetData("Name").ToString(),
                });
            }).ToArray();
            int nextId = -1;

            if (_items.Length > 0)
            {
                nextId = _items.Min(p => p.id);
            }


            return(Json(new
            {
                status = "success",
                data = _items,
                nextId = nextId
            }));
        }
コード例 #6
0
ファイル: RecordController.cs プロジェクト: linml/QLANMJ
        public IActionResult getSubReplayList(string mId)
        {
            DataSet ds = null;


            int ret = DataProcedureHelper.WEB_GetUserReplayListDD(mId, (int)this.UserInfo.UserId, out ds);

            if (ret != 1)
            {
                return(WriteFail("加载战绩详情列表数据失败!"));
            }


            var tb1 = ds.Tables[0];
            var tb2 = ds.Tables[1];


            var userNum = tb2.Rows.Cast <DataRow>().Select(dr =>
            {
                return(new
                {
                    recordid = dr.GetData("recordid").ConvertToInt32(),
                    item = new
                    {
                        userid = dr.GetData("userid").ConvertToInt32(),
                        moneynum = dr.GetData("moneynum").ConvertToInt32(),
                    }
                });
            });
            var subReplayList = tb1.Rows.Cast <DataRow>().Select(dr =>
            {
                int recordId = dr.GetData("recordid").ConvertToInt32();
                return(new
                {
                    recordId = recordId,
                    recPath = dr.GetData("recPath").ToString(),
                    data = userNum.Where(p => p.recordid == recordId).Select(p => p.item).ToArray()
                });
            }).ToArray();


            return(Json(new
            {
                status = "success",
                msg = "OK",
                data = subReplayList
            }));
        }
コード例 #7
0
        public IActionResult getlist()
        {
            var u = this.UserInfo;

            if (u == null)
            {
                return(WriteFail("参数错误"));
            }


            DataSet ds;
            int     ret = DataProcedureHelper.WEB_PyGroupList(
                _userid: (int)u.UserId,
                outDataSet: out ds);


            if (ret != 1)
            {
                return(WriteFail("加载失败!"));
            }
            else
            {
                var _list = ds.Tables[0].Rows.Cast <DataRow>().Select(dr =>
                {
                    return(new
                    {
                        Header = dr.GetData("Header").ToString(),
                        UserId = dr.GetData("UserId").ConvertToInt32(),
                        Id = dr.GetData("Id").ConvertToInt32(),
                        Name = dr.GetData("Name").ToString(),
                        UserCount = dr.GetData("UserCount").ConvertToInt32(),
                        MaxUserCount = dr.GetData("MaxUserCount").ConvertToInt32(),
                        notice = dr.GetData("notice").ToString(),
                    });
                });

                return(Json(new
                {
                    status = "success",
                    data = _list.ToArray()
                }));
            }
        }
コード例 #8
0
        public IActionResult getrulelist(int groupId)
        {
            var u = this.UserInfo;

            if (u == null)
            {
                return(WriteFail("参数错误"));
            }


            DataSet ds;
            int     ret = DataProcedureHelper.WEB_PyGroupRuleList(groupId, out ds);


            if (ret != 1)
            {
                return(WriteFail("加载失败!"));
            }

            var _list = ds.Tables[0].Rows.Cast <DataRow>().Select(dr =>
            {
                return(new pygroupRuleItem()
                {
                    GameId = dr.GetData("GameId").ConvertToInt32(),
                    Id = dr.GetData("Id").ConvertToInt32(),
                    GameName = dr.GetData("GameName").ToString(),
                    ModuleName = dr.GetData("modulename").ToString(),
                    RuleStr = dr.GetData("RuleStr").ToString(),
                    RuleDesc = dr.GetData("RuleDesc").ToString(),
                });
            });



            return(Json(new
            {
                status = "success",
                data = _list.ToArray()
            }));
        }
コード例 #9
0
        public IActionResult deleterule(int groupId, int ruleId)
        {
            var u = this.UserInfo;

            if (u == null)
            {
                return(WriteFail("参数错误"));
            }


            DataSet ds;
            int     ret = DataProcedureHelper.WEB_PyGroupDeleteRule(
                _userid: (int)u.UserId,
                _friendid: groupId,
                _ruleid: ruleId,
                outDataSet: out ds);

            if (ret == 1)
            {
                return(WriteSuccess());
            }

            return(WriteFail("操作失败"));
        }
コード例 #10
0
        public IActionResult userexit(int exitId, int groupId)
        {
            var u = this.UserInfo;

            if (u == null)
            {
                return(WriteFail("参数无效"));
            }

            DataSet ds;
            int     ret = DataProcedureHelper.WEB_PyGroupUserExit(
                _userid: (int)u.UserId,
                _friendid: groupId,
                _exitid: exitId,
                outDataSet: out ds);


            if (ret == 1)
            {
                return(WriteSuccess());
            }

            return(WriteFail("操作失败"));
        }
コード例 #11
0
ファイル: RecordController.cs プロジェクト: linml/QLANMJ
        public IActionResult getRecordList(int startId, int count)
        {
            var u = this.UserInfo;

            if (u == null)
            {
                return(WriteFail("参数错误"));
            }

            DataSet ds;
            int     ret = DataProcedureHelper.WEB_GetUserReplayList(
                _userId: (int)u.UserId,
                _count: count,
                _startId: startId,
                outDataSet: out ds);

            if (ret != 1)
            {
                return(WriteFail("加载战绩回放列表失败"));
            }

            Hashtable recordMap = new Hashtable();

            foreach (System.Data.DataRow dr in ds.Tables[1].Rows)
            {
                uint recordId = dr["recordId"].ConvertToUInt32();
                var  item     = new recordRoomDetailInfoItem()
                {
                    recordId = dr["recordId"].ConvertToUInt32(),
                    userId   = dr["userId"].ConvertToInt32(),
                    addTime  = dr["addTime"].ConvertToDateTime().GetTimestamp(),
                    moneyNum = dr["moneyNum"].ConvertToInt32(),
                    nickName = dr["nickName"].ToString()
                };
                if (recordMap.Contains(recordId))
                {
                    List <recordRoomDetailInfoItem> list = (List <recordRoomDetailInfoItem>)recordMap[recordId];
                    list.Add(item);
                }
                else
                {
                    List <recordRoomDetailInfoItem> list = new List <recordRoomDetailInfoItem>();
                    list.Add(item);
                    recordMap.Add(recordId, list);
                }
            }

            var _items = ds.Tables[0].Rows.Cast <DataRow>().Select(dr =>
            {
                var o         = new recordRoomInfoItem();
                o.recordId    = dr.GetData("recordId").ConvertToUInt32();
                o.roomId      = dr.GetData("roomId").ConvertToInt32();
                o.gameId      = dr.GetData("gameId").ConvertToInt32();
                o.mid         = dr.GetData("mid").ToString();
                o.sid         = dr.GetData("sid").ToString();
                o.ownerId     = dr.GetData("ownerId").ConvertToInt32();
                o.picFile     = dr.GetData("picfile").ToString();
                o.ruleStr     = dr.GetData("ruleStr").ToString();
                o.ruleDesc    = dr.GetData("ruleDesc").ToString();
                o.addTime     = dr.GetData("addTime").ConvertToDateTime().GetTimestamp();
                o.recPath     = dr.GetData("recpath").ToString();
                o.roundDetail = (List <recordRoomDetailInfoItem>)recordMap[o.recordId];
                return(o);
            });

            return(Json(new
            {
                status = "success",
                data = _items.ToArray()
            }));
        }
コード例 #12
0
ファイル: RecordController.cs プロジェクト: linml/QLANMJ
        public IActionResult getTotalRecordLIst(int startId, int count)
        {
            if (startId == 0)
            {
                startId = int.MaxValue;
            }

            DataSet ds  = null;
            int     ret = DataProcedureHelper.WEB_GetUserReplayListMM((int)this.UserInfo.UserId, startId, count, out ds);

            if (ret != 1)
            {
                return(WriteFail("加载战绩回放列表失败"));
            }

            var tb1 = ds.Tables[0];
            var tb2 = ds.Tables[1];


            var userTotalNum = tb2.Rows.Cast <DataRow>().Select(dr =>
            {
                return(new
                {
                    mid = dr.GetData("mid").ToString(),
                    userItem = new
                    {
                        userid = dr.GetData("userid").ConvertToInt32(),
                        nickname = dr.GetData("nickname").ToString(),
                        moneynum = dr.GetData("moneynum").ConvertToInt32(),
                    }
                });
            });

            var recGroupList = tb1.Rows.Cast <DataRow>().Select(dr =>
            {
                int recordId = dr.GetData("recordid").ConvertToInt32();
                string mId   = dr.GetData("mid").ToString();

                return(new
                {
                    recordId = recordId,
                    mId = dr.GetData("mid").ToString(),
                    roomId = dr.GetData("roomid").ConvertToInt32(),
                    gameId = dr.GetData("gameid").ConvertToInt32(),
                    ownerId = dr.GetData("ownerid").ConvertToInt32(),
                    groupId = dr.GetData("groupid").ConvertToInt32(),
                    tableId = dr.GetData("tableid").ConvertToInt32(),
                    gameNum = dr.GetData("gameNum").ConvertToInt32(),
                    //rulestr = dr.GetData("rulestr").ConvertToInt32(),
                    //ruledesc = dr.GetData("ruledesc").ConvertToInt32(),
                    addtime = dr.GetData("addtime").ConvertToDateTime().GetTimestamp() * 1000,
                    userData = userTotalNum.Where(p => p.mid == mId).Select(p => p.userItem).ToArray()
                });
            }).ToArray();

            int minStartId = -1;

            if (recGroupList.Length >= 1)
            {
                minStartId = recGroupList.Min(p => p.recordId);
            }


            return(Json(new
            {
                status = "success",
                msg = "OK",
                data = recGroupList,
                nextStartId = minStartId
            }));
        }