1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147 |
- using System;
- using System.Collections.Generic;
- using CP.Cache;
- using CP.Common;
- using CP.Model;
- namespace CP.Business
- {
- /// <summary>
- /// 河南22选5 即中原风采22选5
- /// </summary>
- public class Fchn22x5
- {
- /// <summary>
- /// 缓存
- /// </summary>
- static WMCache cache = WMCache.GetCacheService();
- #region 所有河南22选5数据
- /// <summary>
- /// 所有河南22选5数据 即中原风采22选5
- /// </summary>
- /// <returns></returns>
- public static List<Fchn22x5Info> GetFchn22x5List()
- {
- string key = string.Format(CacheKeys.FCHN22X5_DATALIST);
- List<Fchn22x5Info> list = cache.GetObject<List<Fchn22x5Info>>(key) as List<Fchn22x5Info>;
- if (list == null)
- {
- list = Fchn22x5Data.GetFchn22x5List();
- cache.AddObject(key, list, (int)CacheTime.Data);
- }
- return list;
- }
- /// <summary>
- /// 数据筛选
- /// </summary>
- /// <param name="pagesize">最近n条</param>
- /// <param name="year">某年</param>
- /// <param name="sqi">开始期</param>
- /// <param name="eqi">结束期</param>
- /// <param name="week">星期n(最近120期)</param>
- /// <param name="ds">单双期.1=单;2=双(最近120期)</param>
- /// <returns></returns>
- public static List<Fchn22x5Info> GetFchn22x5List(ref List<Fchn22x5Info> list, int pagesize, int year, int sqi, int eqi, int week = 0, int ds = 0)
- {
- List<Fchn22x5Info> rlist = new List<Fchn22x5Info>();
- if (list == null || list.Count == 0)
- return rlist;
- int size = list.Count;
- if (pagesize > 0)
- {
- for (int i = (size - pagesize); i < size; i++)
- {
- rlist.Add(list[i]);
- }
- return rlist;
- }
- if (year > 0)
- {
- rlist.Clear();
- for (int i = 0; i < size; i++)
- {
- if (TypeConverter.StrToInt(list[i].qi.ToString().Substring(0, 4), 0) == year)
- rlist.Add(list[i]);
- }
- return rlist;
- }
- if (week > 0)
- {
- rlist.Clear();
- List<Fchn22x5Info> temp = new List<Fchn22x5Info>();
- for (int i = 0; i < size; i++)
- {
- if (list[i].week == week)
- temp.Add(list[i]);
- }
- for (int i = (temp.Count - 120); i < temp.Count; i++)
- {
- rlist.Add(temp[i]);
- }
- return rlist;
- }
- if (ds > 0)
- {
- rlist.Clear();
- List<Fchn22x5Info> temp = new List<Fchn22x5Info>();
- for (int i = 0; i < size; i++)
- {
- if (ds == 1)
- {
- if (list[i].qi % 2 != 0)
- temp.Add(list[i]);
- }
- else if (ds == 2)
- {
- if (list[i].qi % 2 == 0)
- temp.Add(list[i]);
- }
- }
- for (int i = (temp.Count - 120); i < temp.Count; i++)
- {
- rlist.Add(temp[i]);
- }
- return rlist;
- }
- if (sqi > 0 && eqi > 0)
- {
- rlist.Clear();
- int srank = GetFchn22x5Info(ref list,sqi).rank;
- int erank = GetFchn22x5Info(ref list,eqi).rank;
- if (erank != 0 && srank != 0 && erank > srank)
- {
- for (int i = srank - 1; i < erank && i < size; i++)
- {
- rlist.Add(list[i]);
- }
- }
- return rlist;
- }
- ///无参数条件时,返回所有数据
- if (pagesize == 0 && year == 0 && sqi == 0 && eqi == 0 && week == 0)
- return list;
- return rlist;
- }
- /// <summary>
- /// 根据期数获取期一期的数据...
- /// </summary>
- /// <param name="qi"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetFchn22x5Info(ref List<Fchn22x5Info> list, int qi)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- int size = list.Count;
- for (int i = 0; i < size; i++)
- {
- if (list[i].qi == qi)
- {
- info = list[i];
- break;
- }
- }
- return info;
- }
- #endregion
- #region 某个排名的上一次数据
- /// <summary>
- /// 某个排列的上一排名数据
- /// </summary>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastFchn22x5Info(ref List<Fchn22x5Info> list, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (list[i].rank == rank - 1)
- {
- info = list[i];
- return info;
- }
- }
- }
- return info;
- }
- #endregion
- #region 某个排名的下一次数据
- /// <summary>
- /// 某个排列的上一排名数据
- /// </summary>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetNextFchn22x5Info(ref List<Fchn22x5Info> list, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 1; i < list.Count; i++)
- {
- if (list[i].rank == rank + 1)
- {
- info = list[i];
- return info;
- }
- }
- }
- return info;
- }
- #endregion
- #region 某个数据/形态上一次出现的数据
- /// <summary>
- /// 河南22选5某号码上一次出现时的数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastNumFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- List<int> kjh = new List<int> { list[i].n1, list[i].n2, list[i].n3, list[i].n4, list[i].n5 };
- if (kjh.Contains(val))
- {
- info = list[i];
- return info;
- }
- }
- }
- return info;
- }
- /// <summary>
- /// AC值大小的上一次数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastAcDxFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetDxBymiddle(list[i].ac, 4) == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// AC值奇偶的上一次数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastAcJoFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetJo(list[i].ac) == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// AC值质合
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastAcZhFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetZh(list[i].ac) == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// AC值012路的上一次数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastAc012Fchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.Get012(list[i].ac) == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// AC值=val的上一次情况
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastAcFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (list[i].ac == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 上一次AC值振幅的情况
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastAczfFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (i > 0)
- {
- if (Math.Abs(list[i].ac - list[i - 1].ac) == val)
- {
- info = list[i];
- return info;
- }
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 跨度=val的上一次情况
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastKdFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (list[i].kd == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 跨度大小的上一次数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastKdDxFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetDxBymiddle(list[i].kd, 13) == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 跨度奇偶的上一次数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastKdJoFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetJo(list[i].kd) == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 跨度质合
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastKdZhFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetZh(list[i].kd) == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 跨度012路的上一次数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastKd012Fchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.Get012(list[i].ac) == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 22x5每位号的奇偶情况的上一次数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="site"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastNumJoFchn22x5Info(ref List<Fchn22x5Info> list, int val, int site, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (site == 1)
- {
- if (ZstUtils.GetJo(list[i].n1) == val)
- {
- return list[i];
- }
- }
- if (site == 2)
- {
- if (ZstUtils.GetJo(list[i].n2) == val)
- {
- return list[i];
- }
- }
- if (site == 3)
- {
- if (ZstUtils.GetJo(list[i].n3) == val)
- {
- return list[i];
- }
- }
- if (site == 4)
- {
- if (ZstUtils.GetJo(list[i].n4) == val)
- {
- return list[i];
- }
- }
- if (site == 5)
- {
- if (ZstUtils.GetJo(list[i].n5) == val)
- {
- return list[i];
- }
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 上一次奇偶比=val的数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastJobFchn22x5Info(ref List<Fchn22x5Info> list, string val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- List<int> kjh = new List<int> { list[i].n1, list[i].n2, list[i].n3, list[i].n4, list[i].n5 };
- if (ZstUtils.GetJob(kjh).Equals(val))
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 一次奇偶数=val的数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastJogsFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank, int type)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- List<int> kjh = new List<int> { list[i].n1, list[i].n2, list[i].n3, list[i].n4, list[i].n5 };
- string dxb = ZstUtils.GetJob(kjh);
- string[] dxs = dxb.Split(':');
- int d = 0;
- int x = 0;
- if (dxs != null && dxs.Length > 0)
- {
- d = TypeConverter.ObjectToInt(dxs[0], 0);
- x = TypeConverter.ObjectToInt(dxs[1], 0);
- }
- if (type == 1)
- {
- if (d == val)
- return list[i];
- }
- if (type == 2)
- {
- if (x == val)
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 一次大个数=val的数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastDxgsFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank, int type)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- List<int> kjh = new List<int> { list[i].n1, list[i].n2, list[i].n3, list[i].n4, list[i].n5 };
- string dxb = ZstUtils.Get22x5Dxb(kjh);
- string[] dxs = dxb.Split(':');
- int d = 0;
- int x = 0;
- if (dxs != null && dxs.Length > 0)
- {
- d = TypeConverter.ObjectToInt(dxs[0], 0);
- x = TypeConverter.ObjectToInt(dxs[1], 0);
- }
- if (type == 1)
- {
- if (d == val)
- return list[i];
- }
- if (type == 2)
- {
- if (x == val)
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 河南22x5每一位上一次012路情况的数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="site"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastNum012Fchn22x5Info(ref List<Fchn22x5Info> list, int val, int site, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (site == 1)
- {
- if (ZstUtils.Get012(list[i].n1) == val)
- {
- return list[i];
- }
- }
- if (site == 2)
- {
- if (ZstUtils.Get012(list[i].n2) == val)
- {
- return list[i];
- }
- }
- if (site == 3)
- {
- if (ZstUtils.Get012(list[i].n3) == val)
- {
- return list[i];
- }
- }
- if (site == 4)
- {
- if (ZstUtils.Get012(list[i].n4) == val)
- {
- return list[i];
- }
- }
- if (site == 5)
- {
- if (ZstUtils.Get012(list[i].n5) == val)
- {
- return list[i];
- }
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 012个数
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLast012gsFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank, int type)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- List<int> kjh = new List<int> { list[i].n1, list[i].n2, list[i].n3, list[i].n4, list[i].n5 };
- int c1 = ZstUtils.Get012Count(0, kjh);
- int c2 = ZstUtils.Get012Count(1, kjh);
- int c3 = ZstUtils.Get012Count(2, kjh);
- if (type == 0)
- {
- if (c1 == val)
- return list[i];
- }
- if (type == 1)
- {
- if (c2 == val)
- return list[i];
- }
- if (type == 2)
- {
- if (c3 == val)
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 河南22选5和值范围上一次的情况
- /// </summary>
- /// <param name="shz"></param>
- /// <param name="ehz"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastHzFchn22x5Info(ref List<Fchn22x5Info> list, int shz, int ehz, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (list[i].hz >= shz && list[i].hz <= ehz)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 和值上一次奇偶的情况
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastHzJoFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetJo(list[i].hz) == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 上一次和尾的数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastHwFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetHw(list[i].hz) == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 上一次和尾大小的数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastHwDxFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetDx(ZstUtils.GetHw(list[i].hz)) == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 上一次和尾奇偶的情况
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastHwJoFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetJo(ZstUtils.GetHw(list[i].hz)) == val)
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 河南22x5每位号的大小情况的上一次数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="site"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastNumDxFchn22x5Info(ref List<Fchn22x5Info> list, int val, int site, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (site == 1)
- {
- if (ZstUtils.GetDxBymiddle(list[i].n1, 12) == val)
- {
- return list[i];
- }
- }
- if (site == 2)
- {
- if (ZstUtils.GetDxBymiddle(list[i].n2, 12) == val)
- {
- return list[i];
- }
- }
- if (site == 3)
- {
- if (ZstUtils.GetDxBymiddle(list[i].n3, 12) == val)
- {
- return list[i];
- }
- }
- if (site == 4)
- {
- if (ZstUtils.GetDxBymiddle(list[i].n4, 12) == val)
- {
- return list[i];
- }
- }
- if (site == 5)
- {
- if (ZstUtils.GetDxBymiddle(list[i].n5, 12) == val)
- {
- return list[i];
- }
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 上一次大小比=val的数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastDxbFchn22x5Info(ref List<Fchn22x5Info> list, string val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- List<int> kjh = new List<int> { list[i].n1, list[i].n2, list[i].n3, list[i].n4, list[i].n5 };
- if (ZstUtils.Get22x5Dxb(kjh).Equals(val))
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 22x5每位号质合的情况
- /// </summary>
- /// <param name="val"></param>
- /// <param name="site"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastNumZhFchn22x5Info(ref List<Fchn22x5Info> list, int val, int site, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (site == 1)
- {
- if (ZstUtils.GetZh(list[i].n1) == val)
- {
- return list[i];
- }
- }
- if (site == 2)
- {
- if (ZstUtils.GetZh(list[i].n2) == val)
- {
- return list[i];
- }
- }
- if (site == 3)
- {
- if (ZstUtils.GetZh(list[i].n3) == val)
- {
- return list[i];
- }
- }
- if (site == 4)
- {
- if (ZstUtils.GetZh(list[i].n4) == val)
- {
- return list[i];
- }
- }
- if (site == 5)
- {
- if (ZstUtils.GetZh(list[i].n5) == val)
- {
- return list[i];
- }
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 上一次质合比=val的数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastZhbFchn22x5Info(ref List<Fchn22x5Info> list, string val, int rank)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- List<int> kjh = new List<int> { list[i].n1, list[i].n2, list[i].n3, list[i].n4, list[i].n5 };
- if (ZstUtils.GetZhb(kjh).Equals(val))
- {
- return list[i];
- }
- }
- }
- return info;
- }
- /// <summary>
- /// 上一次质合数=val的数据
- /// </summary>
- /// <param name="val"></param>
- /// <param name="rank"></param>
- /// <returns></returns>
- public static Fchn22x5Info GetLastZhgsFchn22x5Info(ref List<Fchn22x5Info> list, int val, int rank, int type)
- {
- Fchn22x5Info info = new Fchn22x5Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- List<int> kjh = new List<int> { list[i].n1, list[i].n2, list[i].n3, list[i].n4, list[i].n5 };
- string dxb = ZstUtils.GetZhb(kjh);
- string[] dxs = dxb.Split(':');
- int d = 0;
- int x = 0;
- if (dxs != null && dxs.Length > 0)
- {
- d = TypeConverter.ObjectToInt(dxs[0], 0);
- x = TypeConverter.ObjectToInt(dxs[1], 0);
- }
- if (type == 1)
- {
- if (d == val)
- return list[i];
- }
- if (type == 2)
- {
- if (x == val)
- return list[i];
- }
- }
- }
- return info;
- }
- #endregion
- #region 开奖公告相关方法
- /// <summary>
- /// 最近30期开奖数据,完整开奖信息,有缓存
- /// </summary>
- /// <returns></returns>
- public static List<Fchn22x5LongInfo> GetFchn22x5ListTop30()
- {
- string key = string.Format(CacheKeys.FCHN22X5_KJH_DATA);
- List<Fchn22x5LongInfo> list = cache.GetObject<List<Fchn22x5LongInfo>>(key) as List<Fchn22x5LongInfo>;
- if (list == null)
- {
- list = Fchn22x5Data.GetFchn22x5Top30();
- cache.AddObject(key, list, (int)CacheTime.Kjh);
- }
- return list;
- }
- /// <summary>
- /// 获取最新一期开奖信息,完整开奖信息,有缓存
- /// </summary>
- /// <returns></returns>
- public static Fchn22x5LongInfo GetFchn22x5InfoTop1(ref List<Fchn22x5LongInfo> list)
- {
- Fchn22x5LongInfo info = new Fchn22x5LongInfo();
- if (list.Count > 0)
- {
- info = list[0];
- }
- return info;
- }
- /// <summary>
- /// 根据期数返回某期完整开奖信息,无缓存
- /// </summary>
- /// <param name="qi"></param>
- /// <returns></returns>
- public static Fchn22x5LongInfo GetFchn22x5InfoByqi(int qi)
- {
- return Fchn22x5Data.GetFchn22x5InfoByQi(qi);
- }
- /// <summary>
- /// 返回某年对应的期数列表,有缓存
- /// </summary>
- /// <param name="year"></param>
- /// <returns></returns>
- public static List<int> GetFchn22x5QiListByYear(int year)
- {
- string key = string.Format(CacheKeys.FCHN22X5_KJH_DATA + "/qilistbyyear/{0}", year);
- List<int> list = cache.GetObject<List<int>>(key) as List<int>;
- if (list == null)
- {
- list = Fchn22x5Data.GetFchn22x5QiListByYear(year);
- cache.AddObject(key, list, (int)CacheTime.System);
- }
- return list;
- }
- #endregion
- ////end
- }
- }
|