Exemplo n.º 1
0
        public DF6_1_DXZS_InfoCollection QueryDF6_1_DXZS(int index)
        {
            DF6_1_DXZS_InfoCollection Collection = new DF6_1_DXZS_InfoCollection();
            var list = this.QueryGameChart <DF6_1_DXZS_Info>(string.Format("QueryDF6_1_DXZS_{0}", index), () =>
            {
                var infoList   = new List <DF6_1_DXZS_Info>();
                var entityList = new DF6_1_DXZSManager().QueryDF6_1_DXZS(index);

                ObjectConvert.ConvertEntityListToInfoList <List <DF6_1_DXZS>, DF6_1_DXZS, List <DF6_1_DXZS_Info>, DF6_1_DXZS_Info>(entityList, ref infoList,
                                                                                                                                   () => { return(new DF6_1_DXZS_Info()); },
                                                                                                                                   (entity, info) =>
                {
                    //处理info里面有,页entity里面没有的属性
                    //info.WinNumber = entity.WinNumber;
                });
                return(infoList);
            });

            Collection.AddRange(list);
            return(Collection);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 大小走势
        /// </summary>
        private void AddDF6_1_DXZS(string issuseNumber, string winNumber)
        {
            var manager = new DF6_1_DXZSManager();
            var issuse  = manager.QueryDF6_1_DXZSIssuseNumber(issuseNumber);

            if (issuse > 0)
            {
                return;
            }

            var    winRed        = winNumber.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            string DX_Proportion = string.Empty;
            int    d             = 0;
            int    x             = 0;

            foreach (var item in winRed)
            {
                if (Convert.ToInt32(item) > 4)
                {
                    d++;
                }
                else
                {
                    x++;
                }
            }
            DX_Proportion = string.Format("{0}:{1}", d, x);
            var last = manager.QueryLastDF6_1_DXZS();
            var dic  = new Dictionary <string, object>();

            dic.Add("IssuseNumber", issuseNumber);
            dic.Add("WinNumber", winNumber);
            dic.Add("CreateTime", DateTime.Now);
            dic.Add("DX_Proportion", DX_Proportion);
            var entity = this.CreateNewEntity <DF6_1_DXZS>(dic, (p) =>
            {
                //取上一期的数据+1
                var lastValue = (last == null ? 1 : int.Parse(p.GetValue(last, null).ToString()) + 1);
                //判断有没有开出此号
                if (p.Name.StartsWith("O_DX_"))
                {
                    var order = p.Name.Replace("O_DX_Proportion", string.Empty);
                    lastValue = DX_Proportion.Replace(":", "") == order ? 0 : lastValue;
                }
                if (p.Name == "DX_D")
                {
                    lastValue = Convert.ToInt32(winRed[0]) > 4 ? 0 : lastValue;
                }
                if (p.Name == "DX_X")
                {
                    lastValue = Convert.ToInt32(winRed[0]) > 4 ? lastValue : 0;
                }
                if (p.Name == "DX1_D")
                {
                    lastValue = Convert.ToInt32(winRed[1]) > 4 ? 0 : lastValue;
                }
                if (p.Name == "DX1_X")
                {
                    lastValue = Convert.ToInt32(winRed[1]) > 4 ? lastValue : 0;
                }
                if (p.Name == "DX2_D")
                {
                    lastValue = Convert.ToInt32(winRed[2]) > 4 ? 0 : lastValue;
                }
                if (p.Name == "DX2_X")
                {
                    lastValue = Convert.ToInt32(winRed[2]) > 4 ? lastValue : 0;
                }
                if (p.Name == "DX3_D")
                {
                    lastValue = Convert.ToInt32(winRed[3]) > 4 ? 0 : lastValue;
                }
                if (p.Name == "DX3_X")
                {
                    lastValue = Convert.ToInt32(winRed[3]) > 4 ? lastValue : 0;
                }
                if (p.Name == "DX4_D")
                {
                    lastValue = Convert.ToInt32(winRed[4]) > 4 ? 0 : lastValue;
                }
                if (p.Name == "DX4_X")
                {
                    lastValue = Convert.ToInt32(winRed[4]) > 4 ? lastValue : 0;
                }
                if (p.Name == "DX5_D")
                {
                    lastValue = Convert.ToInt32(winRed[5]) > 4 ? 0 : lastValue;
                }
                if (p.Name == "DX5_X")
                {
                    lastValue = Convert.ToInt32(winRed[5]) > 4 ? lastValue : 0;
                }
                return(lastValue);
            });

            manager.AddDF6_1_DXZS(entity);
        }