public void get_value_for_property()
        {
            var dt = new { id = "23" };
            Expression <Func <Test, bool> > data = t => t.Data == dt.id;

            Assert.Equal("23", ObjectExtend.CastAs <MemberExpression>(data.Body.CastAs <BinaryExpression>().Right).GetValue());
        }
        public void get_value_for_field()
        {
            var id = "23";
            Expression <Func <Test, bool> > data = t => t.Data == id;

            Assert.Equal("23", ObjectExtend.CastAs <MemberExpression>(data.Body.CastAs <BinaryExpression>().Right).GetValue());
        }
        public void FactMethodName()
        {
            Expression <Func <Test, bool> > data = t => new[] { 1, 2 }.Contains(t.Id);
            var meth = ObjectExtend.CastAs <MethodCallExpression>(data.Body);

            Assert.Equal("Contains", meth.Method.Name);

            var param = ObjectExtend.CastAs <MemberExpression>(meth.Arguments[1]);

            Assert.True(param.BelongsToParameter());
            var sb = new StringBuilder();

            sb.Append(param.Member.Name).Append(" in (");

            var list = ObjectExtend.CastAs <IEnumerable>(meth.Arguments[0].GetValue());
            var en = list.GetEnumerator();

            while (en.MoveNext())
            {
                sb.Append(en.Current).Append(",");
            }
            sb.RemoveLast();
            sb.Append(")");
            Write(sb.ToString());
        }
Esempio n. 4
0
        /// <summary>
        /// 检索目标数量
        /// </summary>
        /// <param name="taskInfo"></param>
        /// <param name="plotNpcId"></param>
        /// <param name="currMonsterList"></param>
        /// <returns></returns>
        private static List <string> FindTargetMonsterNum(StoryTaskInfo taskInfo, int plotNpcId, string[] currMonsterList)
        {
            string[]      targetMonsterList    = taskInfo.TargetMonsterID.ToNotNullString().Split(',');
            string[]      targetMonsterNumList = ObjectExtend.ToNotNullString(taskInfo.TargetMonsterNum).Split(',');
            List <string> targetNumList        = new List <string>();
            int           index = 0;

            foreach (string monster in targetMonsterList)
            {
                int num = currMonsterList.Length > index?ObjectExtend.ToInt(currMonsterList[index]) : 0;

                int maxNum = targetMonsterNumList.Length > index?ObjectExtend.ToInt(targetMonsterNumList[index]) : 0;

                if (num < maxNum)
                {
                    var plotEmbattleList = new ConfigCacheSet <PlotEmbattleInfo>().FindAll(m => m.PlotNpcID == plotNpcId);
                    foreach (PlotEmbattleInfo plotEmbattle in plotEmbattleList)
                    {
                        if (plotEmbattle.MonsterID == ObjectExtend.ToInt(monster))
                        {
                            num += 1;
                        }
                    }
                    targetNumList.Add(num.ToString());
                }
                else
                {
                    targetNumList.Add(maxNum.ToString());
                }
                index++;
            }
            return(targetNumList);
        }
        public void parameter_is_argument_of_method_call()
        {
            var l = new[] { "a", "b" };
            Expression <Func <Test, bool> > data = t => l.Contains(t.Data);

            Assert.True(ObjectExtend.CastAs <MethodCallExpression>(data.Body).HasParameterArgument());
        }
Esempio n. 6
0
 public override void BuildPacket()
 {
     this.PushIntoStack(heritageList.Count);
     foreach (var item in heritageList)
     {
         UserGeneral userGeneral = new GameDataCacheSet <UserGeneral>().FindKey(ContextUser.UserID, item.GeneralID);
         GeneralInfo general     = new ConfigCacheSet <GeneralInfo>().FindKey(item.GeneralID);
         DataStruct  dsItem      = new DataStruct();
         dsItem.PushIntoStack((short)item.Type);
         dsItem.PushIntoStack(userGeneral == null ? 0 : userGeneral.GeneralID);
         dsItem.PushIntoStack(userGeneral == null ? string.Empty : ObjectExtend.ToNotNullString(userGeneral.GeneralName));
         dsItem.PushIntoStack(general == null ? string.Empty : ObjectExtend.ToNotNullString(general.BattleHeadID));
         dsItem.PushIntoStack(item.GeneralLv);
         dsItem.PushIntoStack(item.PowerNum);
         dsItem.PushIntoStack(item.SoulNum);
         dsItem.PushIntoStack(item.IntellectNum);
         dsItem.PushIntoStack(userGeneral == null ? (short)0 : (short)userGeneral.GeneralQuality);
         this.PushIntoStack(dsItem);
     }
     this.PushIntoStack(opsInfoList.Count);
     foreach (var item in opsInfoList)
     {
         DataStruct dsItem = new DataStruct();
         dsItem.PushIntoStack(item.Type);
         dsItem.PushIntoStack(item.VipLv);
         dsItem.PushIntoStack(item.UseGold);
         dsItem.PushIntoStack(item.ItemID);
         dsItem.PushIntoStack(item.ItemNum);
         this.PushIntoStack(dsItem);
     }
     this.PushIntoStack(heritageName.ToNotNullString());
     this.PushIntoStack(heritageLv);
     this.PushIntoStack(disGeneralName.ToNotNullString());
 }
Esempio n. 7
0
        private FileDescription CopyFile(FileDescription model)
        {
            var entity = new FileDescription();

            ObjectExtend.CopyTo(model, entity);
            entity.ID             = Guid.NewGuid();
            entity.FileCreateTime = DateTime.Now;
            return(entity);
        }
Esempio n. 8
0
        public bool GetTrayInfoByTrayID(Barcode_Model Barcode_Model, ref Tray_Model trayInfo)
        {
            bool IsResult = false;

            DataSet ds;

            string sql = null, errMsg = string.Empty;

            sql = string.Format(@"select TRAYID,TrayNO,qty,materialno,materialdesc,materialstd,serialno,rowno from T_TRAY JOIN T_OUTBARCODE ON T_TRAY.ID=T_OUTBARCODE.TRAYID where T_TRAY.ID={0}", Barcode_Model.TrayID);
            OperationSql.GetDataset(sql, out ds, out errMsg);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                trayInfo             = TOOL.DataTableToList.DataRowToModel <Tray_Model>(ds.Tables[0].Rows[0]);
                trayInfo.listDetails = new List <TrayDetails_Model>();
                TrayDetails_Model model;
                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    TrayDetails_Model tdm = trayInfo.listDetails.Find(delegate(TrayDetails_Model v)
                    {
                        return(v.cinvcode.ToUpper().Equals(item["materialno"].ToString().ToUpper()) &&
                               (string.IsNullOrEmpty(item["rowno"].ToDBString()) || v.ROWNO.Equals(item["rowno"].ToDBString())));
                    });
                    if (tdm == null)
                    {
                        model          = new TrayDetails_Model();
                        model.Qty      = ObjectExtend.ToDouble(item["qty"]);
                        model.cinvcode = item["materialno"].ToString();
                        model.cinvname = item["materialdesc"].ToString();
                        model.cinvstd  = item["materialstd"].ToString();

                        model.ROWNO       = item["rowno"].ToDBString();
                        model.listBarcode = new List <string>()
                        {
                            item["serialno"].ToString()
                        };
                        trayInfo.listDetails.Add(model);
                    }
                    else
                    {
                        tdm.listBarcode.Add(item["serialno"].ToString());
                        tdm.Qty += ObjectExtend.ToDouble(item["qty"]);
                    }
                }

                IsResult = true;
            }

            return(IsResult);
        }
Esempio n. 9
0
        public override bool TakeAction()
        {
            List <UserTakePrize> userPrizeList = new ShareCacheStruct <UserTakePrize>().FindAll(m => !m.IsTasked && m.UserID == ObjectExtend.ToInt(Uid));

            if (userPrizeList.Count > 0)
            {
                var userPrize = userPrizeList[0];
                if (userPrize.ItemPackage.Length > 0)
                {
                    if (UserItemHelper.CheckItemOut(ContextUser, ItemStatus.BeiBao, PutItemNum(userPrize)))
                    {
                        ErrorCode = LanguageManager.GetLang().ErrorCode;
                        ErrorInfo = LanguageManager.GetLang().St1107_GridNumFull;
                        return(false);
                    }
                }
                if (userPrize.SparePackage.Length > 0)
                {
                    int currNum = ContextUser.SparePartList.FindAll(m => string.IsNullOrEmpty(m.UserItemID)).Count;
                    currNum = MathUtils.Addition(currNum, PutCrystalSpareNum(userPrize.SparePackage.Split(','), 1));
                    //原因:零件等于开启格子时提示背包已满
                    if (currNum > ContextUser.UserExtend.SparePartGridNum)
                    {
                        ErrorCode = LanguageManager.GetLang().ErrorCode;
                        ErrorInfo = LanguageManager.GetLang().St1213_GridNumFull;
                        return(false);
                    }
                }

                if (userPrize.CrystalPackage.Length > 0)
                {
                    var package = UserCrystalPackage.Get(ContextUser.UserID);
                    UserCrystalInfo[] crystalArrayErr =
                        package.CrystalPackage.FindAll(m => m.IsSale == 2 && m.GeneralID.Equals(0)).ToArray();
                    int crystalNum = MathUtils.Addition(crystalArrayErr.Length, PutCrystalSpareNum(userPrize.CrystalPackage.Split(','), 2));
                    //原因:命运水晶等于开启格子时提示背包已满
                    if (crystalNum > ContextUser.CrystalNum)
                    {
                        ErrorCode = LanguageManager.GetLang().ErrorCode;
                        ErrorInfo = LanguageManager.GetLang().St1307_FateBackpackFull;
                        return(false);
                    }
                }

                if (!string.IsNullOrEmpty(userPrize.EnchantPackage) && userPrize.EnchantPackage.Length > 0)
                {
                    var package = UserEnchant.Get(ContextUser.UserID);
                    if (package != null)
                    {
                        var enchantList = package.EnchantPackage.FindAll(m => string.IsNullOrEmpty(m.UserItemID));
                        int enchantNum  = MathUtils.Addition(enchantList.Count, PutCrystalSpareNum(userPrize.EnchantPackage.Split(','), 2));
                        if (ContextUser.UserExtend != null && enchantNum > ContextUser.UserExtend.EnchantGridNum)
                        {
                            ErrorCode = LanguageManager.GetLang().ErrorCode;
                            ErrorInfo = LanguageManager.GetLang().St1259_EnchantGridNumFull;
                            return(false);
                        }
                    }
                }

                if (doProcessPrize(userPrize))
                {
                    ErrorInfo = userPrize.MailContent;
                }
                else
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 10
0
        public bool GetTrayInfoByTrayID2(Barcode_Model Barcode_Model, ref Tray_Model trayInfo)
        {
            bool IsResult = false;

            DataSet ds;

            string sql = null, errMsg = string.Empty;

            sql = string.Format(@"select voucherno,TRAYID,TrayNO,qty,materialno,materialdesc,materialstd,serialno,rowno from T_TRAY JOIN T_OUTBARCODE ON T_TRAY.ID=T_OUTBARCODE.TRAYID where T_TRAY.ID={0}", Barcode_Model.TrayID);
            OperationSql.GetDataset(sql, out ds, out errMsg);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                ds.Tables[0].Columns.Add("socode", typeof(System.String));
                ds.Tables[0].Columns.Add("sorowno", typeof(System.String));
                //SqlDataReader sqlreader = null;
                //using (SqlConnection conOne = new SqlConnection(OperationSql.U8ConnStr))
                //{
                //    conOne.Open();
                //    SqlCommand command = new SqlCommand();
                //    command.Connection = conOne;
                //    foreach (DataRow item in ds.Tables[0].Rows)
                //    {
                //        sql = string.Format("select ISNULL(ordercode,'') socode,ISNULL(orderseq,'') sorowno from v_st_mom_orderdetail where mocode = '{0}' and MoSeq='{1}'", item["voucherno"].ToDBString(), item["rowno"].ToDBString());
                //        command.CommandText = sql;
                //        sqlreader = command.ExecuteReader();
                //        if (sqlreader.Read())
                //        {
                //            item["socode"] = sqlreader["socode"].ToDBString();
                //            item["sorowno"] = sqlreader["sorowno"].ToDBString();
                //        }
                //        if (sqlreader != null && !sqlreader.IsClosed)
                //            sqlreader.Close();
                //    }
                //}
                trayInfo             = TOOL.DataTableToList.DataRowToModel <Tray_Model>(ds.Tables[0].Rows[0]);
                trayInfo.listDetails = new List <TrayDetails_Model>();
                TrayDetails_Model model;
                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    TrayDetails_Model tdm = trayInfo.listDetails.Find(delegate(TrayDetails_Model v)
                    {
                        return(v.cinvcode.ToUpper().Equals(item["materialno"].ToString().ToUpper()) &&
                               (string.IsNullOrEmpty(item["sorowno"].ToDBString()) || item["sorowno"].ToDBString().Equals("0") || v.SOROWNO.Equals(item["sorowno"].ToDBString())));
                    });
                    if (tdm == null)
                    {
                        model          = new TrayDetails_Model();
                        model.Qty      = ObjectExtend.ToDouble(item["qty"]);
                        model.cinvcode = item["materialno"].ToString();
                        model.cinvname = item["materialdesc"].ToString();
                        model.cinvstd  = item["materialstd"].ToString();

                        model.SOROWNO     = item["sorowno"].ToDBString();
                        model.listBarcode = new List <string>()
                        {
                            item["serialno"].ToString()
                        };
                        trayInfo.listDetails.Add(model);
                    }
                    else
                    {
                        tdm.listBarcode.Add(item["serialno"].ToString());
                        tdm.Qty += ObjectExtend.ToDouble(item["qty"]);
                    }
                }

                IsResult = true;
            }

            return(IsResult);
        }
Esempio n. 11
0
        public bool GetTrayInfoByTrayIDForOutStock(Barcode_Model Barcode_Model, ref Tray_Model trayInfo)
        {
            bool           IsResult   = false;
            string         connString = OperationSql.ERPConnStr;
            DataSet        ds         = new DataSet();
            string         errMsg     = "";
            SqlCommand     view       = new SqlCommand();
            SqlCommand     cmd        = new SqlCommand();
            SqlConnection  conn       = new SqlConnection();
            SqlDataAdapter adp        = new SqlDataAdapter();

            conn.ConnectionString = connString;
            try
            {
                conn.Open();
            }
            catch (Exception ex)
            {
                errMsg = ex.Message;
                return(false);
            }
            cmd.Connection = conn;

            string sqlHead = string.Format(@"select ISNULL(orderseq,'') sorowno,TRAYID,TrayNO,bar.qty,materialno,serialno
FROM  ITSV.Barcode.DBO.T_TRAY tray join ITSV.Barcode.DBO.T_OUTBARCODE bar  ON tray.ID=bar.TRAYID
left JOIN v_st_mom_orderdetail m ON m.MoSeq=bar.rowno and bar.voucherno=m.MoCode where 1=1 and tray.ID={0}", Barcode_Model.TrayID);
            string WMSdbserver = "", WMSdbuser = "", WMSdbpwd = "";
            string tmp  = OperationSql.connectionString;
            string tmp1 = "";

            tmp1        = tmp.Substring(tmp.IndexOf("Data Source="));
            WMSdbserver = tmp1.Substring(12, tmp1.IndexOf(";") - 12);
            tmp1        = tmp.Substring(tmp.IndexOf("UID="));
            WMSdbuser   = tmp1.Substring(4, tmp1.IndexOf(";") - 4);
            tmp1        = tmp.Substring(tmp.IndexOf("Pwd="));
            WMSdbpwd    = tmp1.Substring(4, tmp1.Length - 4);

            string CreatelinkServer = "";

            CreatelinkServer = (@"if exists(select 1 from master.dbo.sysservers where srvname='ITSV')
begin
    EXEC sp_dropserver 'ITSV','droplogins' 
end   
exec sp_addlinkedserver   'ITSV', '', 'SQLOLEDB ', '" + WMSdbserver + @"'; 
exec sp_addlinkedsrvlogin 'ITSV', 'false ',null, '" + WMSdbuser + "', '" + WMSdbpwd + @"' ;");

            DataTable dt1 = new DataTable("head");

            ds.Tables.Add(dt1);

            try
            {
                cmd.CommandText = CreatelinkServer;
                cmd.ExecuteNonQuery();
                cmd.CommandText   = sqlHead;
                adp.SelectCommand = cmd;
                adp.Fill(ds.Tables["head"]);

                if (ds.Tables["head"].Rows.Count < 1)
                {
                    errMsg = "生产订单不存在或状态不正确!";
                    return(false);
                }
                if (ds != null && ds.Tables.Count > 0 && ds.Tables["head"].Rows.Count > 0)
                {
                    trayInfo             = TOOL.DataTableToList.DataRowToModel <Tray_Model>(ds.Tables[0].Rows[0]);
                    trayInfo.listDetails = new List <TrayDetails_Model>();
                    TrayDetails_Model model;
                    foreach (DataRow item in ds.Tables["head"].Rows)
                    {
                        TrayDetails_Model tdm = trayInfo.listDetails.Find(delegate(TrayDetails_Model v)
                        {
                            return(v.cinvcode.ToUpper().Equals(item["materialno"].ToString().ToUpper()) &&
                                   (string.IsNullOrEmpty(item["sorowno"].ToDBString()) || item["sorowno"].ToDBString().Equals("0") || v.SOROWNO.Equals(item["sorowno"].ToDBString())));
                        });
                        if (tdm == null)
                        {
                            model             = new TrayDetails_Model();
                            model.Qty         = ObjectExtend.ToDouble(item["qty"]);
                            model.cinvcode    = item["materialno"].ToString();
                            model.SOROWNO     = item["sorowno"].ToDBString();
                            model.listBarcode = new List <string>()
                            {
                                item["serialno"].ToString()
                            };
                            trayInfo.listDetails.Add(model);
                        }
                        else
                        {
                            tdm.listBarcode.Add(item["serialno"].ToString());
                            tdm.Qty += ObjectExtend.ToDouble(item["qty"]);
                        }
                        IsResult = true;
                    }
                }
                return(IsResult);
            }
            catch (Exception ex)
            {
                errMsg = ex.Message;
                return(false);
            }
            finally
            {
                conn.Close();
            }
        }
        public void member_belongs_to_paramater_of_type()
        {
            Expression <Func <Test, bool> > data = t => t.Data == "23";

            Assert.True(ObjectExtend.CastAs <MemberExpression>(data.Body.CastAs <BinaryExpression>().Left).BelongsToParameter(typeof(Test)));
        }
        public void member_is_parameter()
        {
            Expression <Func <int, bool> > data = t => t == 23;

            Assert.True(ObjectExtend.CastAs <BinaryExpression>(data.Body).Left.IsParameter(typeof(int)));
        }
Esempio n. 14
0
        public override void BuildPacket()
        {
            PushIntoStack(ContextUser.CityID);
            PushIntoStack(ContextUser.PointX);
            PushIntoStack(ContextUser.PointY);
            PushIntoStack(generalID);
            PushIntoStack(guildID.ToNotNullString());
            PushIntoStack(ObjectExtend.ToNotNullString(ContextUser.NickName));
            PushIntoStack(genlv);
            PushIntoStack(careerID);
            PushIntoStack(sex);
            PushIntoStack(headID.ToNotNullString());
            PushIntoStack(ContextUser.GoldNum);
            PushIntoStack(ContextUser.GameCoin);
            PushIntoStack(lifeNum);
            PushIntoStack(lifeMaxNum);
            PushIntoStack((ContextUser.EnergyNum).ToShort());
            PushIntoStack(maxEnergyNum);
            PushIntoStack(userGeneralInfo == null ? 0 : userGeneralInfo.CurrExperience);
            PushIntoStack(escalateInfo == null ? 0 : escalateInfo.UpExperience);
            PushIntoStack((short)ContextUser.VipLv);
            PushIntoStack((short)ContextUser.CountryID);

            //加状态
            PushIntoStack(_itemLiveNum);
            PushIntoStack(_itemLiveMaxNum);
            PushIntoStack(_blessingList.Count);
            foreach (var blessing in _blessingList)
            {
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(blessing.BlessingType);
                dsItem.PushIntoStack(blessing.BlessingNum);
                dsItem.PushIntoStack(blessing.PropDate);
                dsItem.PushIntoStack(string.Empty);
                dsItem.PushIntoStack(blessing.PropDesc.ToNotNullString());
                PushIntoStack(dsItem);
            }
            PushIntoStack((short)ContextUser.UserLocation);
            PushIntoStack(ContextUser.ExpNum);
            PushIntoStack((short)ContextUser.UserStatus);
            PushIntoStack(ContextUser.SweepPool == null ? 0 : ContextUser.SweepPool.PlotID);
            PushIntoStack(ContextUser.IsUseupItem ? (short)1 : (short)0);
            PushIntoStack(pictureID.ToNotNullString());
            PushIntoStack(pictureTime);
            PushIntoStack(demandGold);
            PushIntoStack(ContextUser.SurplusEnergy);
            PushIntoStack(isHelper);
            PushIntoStack(plotstatucID);
            PushIntoStack(mercenarySeq);
            PushIntoStack(cardUserID.ToNotNullString());
            PushIntoStack(0);
            this.PushIntoStack(battleNum);
            this.PushIntoStack(totalBattle);
            this.PushIntoStack(rstore);
            this.PushIntoStack(totalRstore);
            PushIntoStack(_honourNum);
            PushIntoStack(_nextHonourNum);
            PushIntoStack(ContextUser.CombatNum);
            PushIntoStack(_talPriority);
            PushIntoStack(ContextUser.IsLv ? 1.ToShort() : 0.ToShort());
            this.PushIntoStack(functionList.Count);
            foreach (UserFunction item in functionList)
            {
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(item.FunEnum.ToShort());
                PushIntoStack(dsItem);
            }

            if (ContextUser.OpenFun != null && ContextUser.OpenFun.Count > 0)
            {
                var OpenFun = ContextUser.OpenFun;
                this.PushIntoStack(OpenFun.Count);
                foreach (UserFunction item in OpenFun)
                {
                    DataStruct dsItem = new DataStruct();
                    dsItem.PushIntoStack(item.FunEnum.ToShort());
                    PushIntoStack(dsItem);
                }
                ContextUser.OpenFun.Clear();
            }
            else
            {
                PushIntoStack(0);
            }

            PushIntoStack(ContextUser.WizardNum);
            // PushIntoStack(unReadCount);
            // 未读的信件数目
            PushIntoStack(unReadCount);
        }
        public void expression_with_initializer()
        {
            Expression <Func <Test, bool> > data = t => DateTime.UtcNow > new DateTime(2, 2, 2);

            Assert.Equal(new DateTime(2, 2, 2), ObjectExtend.CastAs <BinaryExpression>(data.Body).Right.GetValue());
        }
        public void get_value_for_property_returned_by_method()
        {
            Expression <Func <Test, bool> > data = t => t.Data == this.TestId().Data;

            Assert.Equal("29", ObjectExtend.CastAs <BinaryExpression>(data.Body).Right.GetValue());
        }
        public void get_value_for_property_returning_from_method_call()
        {
            Expression <Func <Test, bool> > data = t => t.Data == this.TestId().Bla().ToString();

            Assert.Equal("0", ObjectExtend.CastAs <MethodCallExpression>(data.Body.CastAs <BinaryExpression>().Right).GetValue());
        }
        public void get_value_for_method_call_with_argument()
        {
            Expression <Func <Test, bool> > data = t => t.Data == this.Id(2);

            Assert.Equal("2", ObjectExtend.CastAs <MethodCallExpression>(data.Body.CastAs <BinaryExpression>().Right).GetValue());
        }
        public void complex_member_belongs_to_paramater()
        {
            Expression <Func <Test, bool> > data = t => t.Child.Child.Child.Data == "23";

            Assert.True(ObjectExtend.CastAs <MemberExpression>(data.Body.CastAs <BinaryExpression>().Left).BelongsToParameter());
        }
Esempio n. 20
0
        public override void BuildPacket()
        {
            PushIntoStack(ObjectExtend.ToNotNullString(ContextUser.NickName));
            PushIntoStack(sportsName.ToNotNullString());
            PushIntoStack(ContextUser.ObtainNum);
            PushIntoStack(rankID);
            PushIntoStack(victoryNum);
            PushIntoStack(sportsReward == null ? 0 : sportsReward.RewardGoin);
            PushIntoStack(sportsReward == null ? 0 : sportsReward.RewardObtian);
            PushIntoStack(receiveDate);
            PushIntoStack(sportNum);
            PushIntoStack(codeTime);
            PushIntoStack(_userRankArray.Count);
            var userGeneralCacheSet = new PersonalCacheStruct <UserGeneral>();

            foreach (UserRank user in _userRankArray)
            {
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(user.UserID.ToNotNullString());
                dsItem.PushIntoStack(user.NickName.ToNotNullString());
                dsItem.PushIntoStack(user.HeadID.ToNotNullString());
                dsItem.PushIntoStack(user.RankId);
                dsItem.PushIntoStack(user.UserLv);

                var embattleList = EmbattleHelper.CurrEmbattle(user.UserID, true);
                dsItem.PushIntoStack(embattleList.Count);
                foreach (var item in embattleList)
                {
                    var        userGenearl = userGeneralCacheSet.FindKey(item.UserID, item.GeneralID);
                    DataStruct dsItem1     = new DataStruct();
                    dsItem1.PushIntoStack(item.GeneralID);
                    dsItem1.PushIntoStack(userGenearl == null ? string.Empty : userGenearl.GeneralName.ToNotNullString());
                    dsItem1.PushIntoStack(userGenearl == null ? string.Empty : userGenearl.HeadID.ToNotNullString());
                    dsItem1.PushIntoStack(userGenearl == null ? 0 : userGenearl.GeneralQuality.ToInt());
                    dsItem1.PushIntoStack(userGenearl == null ? 0 : userGenearl.GeneralLv.ToInt());
                    dsItem.PushIntoStack(dsItem1);
                }

                SportsRewardInfo sportsInfo = new ShareCacheStruct <SportsRewardInfo>().FindKey(user.RankId);
                var embatList = EmbattleHelper.CurrEmbattle(user.UserID, false);
                dsItem.PushIntoStack(embatList.Count);
                dsItem.PushIntoStack(embattleList.Count);
                dsItem.PushIntoStack(sportsInfo == null ? 0 : sportsInfo.RewardObtian);
                PushIntoStack(dsItem);
            }

            int index = 0;

            PushIntoStack(_userCombatArray.Count);
            foreach (var usercombat in _userCombatArray)
            {
                short  iswin      = usercombat.IsWin ? (short)1 : (short)2;
                string userName   = string.Empty;
                string toUserName = string.Empty;
                if (usercombat.IsSelf)
                {
                    userName   = LanguageManager.GetLang().St5101_JingJiChangMingCheng;
                    toUserName = usercombat.ToUserName;
                }
                else
                {
                    userName   = usercombat.ToUserName;
                    toUserName = LanguageManager.GetLang().St5101_JingJiChangMingCheng;
                }
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(MathUtils.ToNotNullString(usercombat.CombatDate.ToString("t")));
                dsItem.PushIntoStack(userName.ToNotNullString());
                dsItem.PushIntoStack(toUserName.ToNotNullString());
                dsItem.PushIntoStack(iswin);
                dsItem.PushIntoStack(usercombat.RankStatus.ToInt());
                dsItem.PushIntoStack(usercombat.TopID);
                dsItem.PushIntoStack(index.ToNotNullString());
                PushIntoStack(dsItem);

                index++;
            }


            string spoName = string.Empty;

            PushIntoStack(userRankArray.Count);
            foreach (UserRank rank in userRankArray)
            {
                spoName = UserHelper.SportTitleName(rank.ObtainNum);
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(rank.RankId);
                dsItem.PushIntoStack(rank.UserID.ToNotNullString());
                dsItem.PushIntoStack(rank.NickName.ToNotNullString());
                dsItem.PushIntoStack(rank.UserLv);
                dsItem.PushIntoStack(rank.TotalCombatNum > 0 ? rank.TotalCombatNum : UserHelper.GetTotalCombatNum(rank.UserID));
                dsItem.PushIntoStack(spoName);
                dsItem.PushIntoStack(rank.VictoryNum);

                var embattleList = EmbattleHelper.CurrEmbattle(rank.UserID, true);
                dsItem.PushIntoStack(embattleList.Count);
                foreach (var item in embattleList)
                {
                    var        userGenearl = userGeneralCacheSet.FindKey(item.UserID, item.GeneralID);
                    DataStruct dsItem1     = new DataStruct();
                    dsItem1.PushIntoStack(item.GeneralID);
                    dsItem1.PushIntoStack(userGenearl == null ? string.Empty : userGenearl.GeneralName.ToNotNullString());
                    dsItem1.PushIntoStack(userGenearl == null ? string.Empty : userGenearl.HeadID.ToNotNullString());
                    dsItem1.PushIntoStack(userGenearl == null ? 0 : userGenearl.GeneralQuality.ToInt());
                    dsItem1.PushIntoStack(userGenearl == null ? 0 : userGenearl.GeneralLv.ToInt());
                    dsItem.PushIntoStack(dsItem1);
                }

                SportsRewardInfo sportsInfo = new ShareCacheStruct <SportsRewardInfo>().FindKey(rank.RankId);
                var embatList = EmbattleHelper.CurrEmbattle(rank.UserID, false);
                dsItem.PushIntoStack(embatList.Count);
                dsItem.PushIntoStack(embattleList.Count);
                dsItem.PushIntoStack(sportsInfo == null ? 0 : sportsInfo.RewardObtian);
                PushIntoStack(dsItem);
            }

            PushIntoStack(sportsIntegral);
        }