12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Web;
- using CP.Cache;
- using CP.Common;
- using CP.Model;
- namespace CP.Business
- {
- public class Tchlj61
- {
-
-
-
- static WMCache cache = WMCache.GetCacheService();
-
-
-
-
- public static List<Tchlj61Info> GetTchlj61List()
- {
- string key = string.Format(CacheKeys.TCHLJ61_DATALIST);
- List<Tchlj61Info> list = cache.GetObject<List<Tchlj61Info>>(key) as List<Tchlj61Info>;
- if (list == null)
- {
- list = Tchlj61Data.GetTchlj61List();
- cache.AddObject(key, list, (int)CacheTime.Data);
- }
- return list;
- }
-
-
-
-
- public static Tchlj61Info GetEndTchlj61Info(ref List<Tchlj61Info> list)
- {
- Tchlj61Info info = new Tchlj61Info();
- if (list != null && list.Count > 0)
- return list[list.Count - 1];
- return info;
- }
-
-
-
-
-
-
-
-
-
-
- public static List<Tchlj61Info> GetTchlj61List(ref List<Tchlj61Info> list,int pagesize, int year, int sqi, int eqi, int week = 0, int ds = 0)
- {
- List<Tchlj61Info> rlist = new List<Tchlj61Info>();
- 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<Tchlj61Info> temp = new List<Tchlj61Info>();
- 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<Tchlj61Info> temp = new List<Tchlj61Info>();
- 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 = GetTchlj61Info(ref list,sqi).rank;
- int erank = GetTchlj61Info(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 && ds == 0)
- return list;
- return rlist;
- }
-
-
-
-
-
- public static List<Tchlj61Info> GetMissTchlj61List(ref List<Tchlj61Info> list, int eqi)
- {
- List<Tchlj61Info> rlist = new List<Tchlj61Info>();
- if (eqi > 0)
- {
- int size = list.Count;
- int erank = GetTchlj61Info(ref list,eqi).rank;
- if (erank > 0)
- {
- for (int i = 0; i < erank && i < size; i++)
- {
- rlist.Add(list[i]);
- }
- }
- else
- {
- for (int i = 0; i < size; i++)
- {
- rlist.Add(list[i]);
- }
- }
- }
- else
- {
- rlist = list;
- }
- return rlist;
- }
-
-
-
-
-
- public static Tchlj61Info GetTchlj61Info(ref List<Tchlj61Info> list, int qi)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = 0; i < size; i++)
- {
- if (list[i].qi == qi)
- {
- info = list[i];
- break;
- }
- }
- return info;
- }
-
-
-
-
-
- public static Tchlj61Info GetLastQiTchlj61Info(ref List<Tchlj61Info> list, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (list[i].rank == rank - 1)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
- public static Tchlj61Info GetNextQiTchlj61Info(ref List<Tchlj61Info> list, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 1; i < list.Count; i++)
- {
- if (list[i].rank == rank + 1)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
- #region 条件查询上一次出来时的数据
-
-
-
-
-
-
-
- public static Tchlj61Info GetLastTchlj61Info(ref List<Tchlj61Info> list, int val, int rank, int type)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (type == 0 && list[i].n1 == val)
- {
- info = list[i];
- return info;
- }
- if (type == 1 && list[i].n2 == val)
- {
- info = list[i];
- return info;
- }
- if (type == 2 && list[i].n3 == val)
- {
- info = list[i];
- return info;
- }
- if (type == 3 && list[i].n4 == val)
- {
- info = list[i];
- return info;
- }
- if (type == 4 && list[i].n5 == val)
- {
- info = list[i];
- return info;
- }
- if (type == 5 && list[i].n6 == val)
- {
- info = list[i];
- return info;
- }
- if (type == 6 && list[i].n7 == val)
- {
- info = list[i];
- return info;
- }
- List<int> kjh = new List<int>() { list[i].n1, list[i].n2, list[i].n3, list[i].n4, list[i].n5, list[i].n6, list[i].n7 };
-
- if (type == 7 && kjh.Contains(val))
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
-
-
- public static Tchlj61Info GetLastHzJoTchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
-
- if (val == 0 && list[i].hz % 2 == 0)
- {
- info = list[i];
- return info;
- }
-
- if (val == 1 && list[i].hz % 2 != 0)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastHzDxTchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetQxcHzDx(list[i].hz) == val)
- return list[i];
- }
- return info;
- }
-
-
-
-
-
-
-
- public static Tchlj61Info GetlastTchlj61HzInfo(ref List<Tchlj61Info> list, int shz, int ehz, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (list[i].hz >= shz && list[i].hz <= ehz)
- {
- return list[i];
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastHwTchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetHw(list[i].hz) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastHwDxTchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- int hw = ZstUtils.GetHw(list[i].hz);
- if (ZstUtils.GetDx(hw) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastHwJoTchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- int hw = ZstUtils.GetHw(list[i].hz);
- if (ZstUtils.GetJo(hw) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastHwZhTchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- int hw = ZstUtils.GetHw(list[i].hz);
- if (ZstUtils.GetZh(hw) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastHzZhTchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetZh(list[i].hz) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastHw012Tchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- int hw = ZstUtils.GetHw(list[i].hz);
- if (ZstUtils.Get012(hw) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastHz012Tchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.Get012(list[i].hz) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastKdTchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (list[i].kd == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastKdDxTchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetDx(list[i].kd) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastKdJoTchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetJo(list[i].kd) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastKdZhTchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.GetZh(list[i].kd) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastKd012Tchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (ZstUtils.Get012(list[i].kd) == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastKdZfTchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (i > 0)
- {
- if (Math.Abs(list[i].kd - list[i - 1].kd) == val)
- {
- info = list[i];
- return info;
- }
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastHzTchlj61Info(ref List<Tchlj61Info> list, int val, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (val < 21 && list[i].hz < 21)
- {
- info = list[i];
- return info;
- }
- if (val > 38 && list[i].hz > 38)
- {
- info = list[i];
- return info;
- }
- if (list[i].hz == val)
- {
- info = list[i];
- return info;
- }
- }
- return info;
- }
-
-
-
-
- public static Tchlj61Info GetLastNChTchlj61Info(ref List<Tchlj61Info> list, int rank, int type)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (type == 0)
- {
- if (i > 0)
- {
- if ((list[i].n1 - list[i - 1].n1) == 0)
- return list[i];
- }
- }
- if (type == 1)
- {
- if (i > 0)
- {
- if ((list[i].n2 - list[i - 1].n2) == 0)
- return list[i];
- }
- }
- if (type == 2)
- {
- if (i > 0)
- {
- if ((list[i].n3 - list[i - 1].n3) == 0)
- return list[i];
- }
- }
- if (type == 3)
- {
- if (i > 0)
- {
- if ((list[i].n4 - list[i - 1].n4) == 0)
- return list[i];
- }
- }
- if (type == 4)
- {
- if (i > 0)
- {
- if ((list[i].n5 - list[i - 1].n5) == 0)
- return list[i];
- }
- }
- if (type == 5)
- {
- if (i > 0)
- {
- if ((list[i].n6 - list[i - 1].n6) == 0)
- return list[i];
- }
- }
- if (type == 6)
- {
- if (i > 0)
- {
- if ((list[i].n7 - list[i - 1].n7) == 0)
- return list[i];
- }
- }
- }
- return info;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetLastNNotChTchlj61Info(ref List<Tchlj61Info> list, int rank, int type)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (type == 0)
- {
- if (i > 0)
- {
- if ((list[i].n1 - list[i - 1].n1) != 0)
- return list[i];
- }
- }
- if (type == 1)
- {
- if (i > 0)
- {
- if ((list[i].n2 - list[i - 1].n2) != 0)
- return list[i];
- }
- }
- if (type == 2)
- {
- if (i > 0)
- {
- if ((list[i].n3 - list[i - 1].n3) != 0)
- return list[i];
- }
- }
- if (type == 3)
- {
- if (i > 0)
- {
- if ((list[i].n4 - list[i - 1].n4) != 0)
- return list[i];
- }
- }
- if (type == 4)
- {
- if (i > 0)
- {
- if ((list[i].n5 - list[i - 1].n5) != 0)
- return list[i];
- }
- }
- if (type == 5)
- {
- if (i > 0)
- {
- if ((list[i].n6 - list[i - 1].n6) != 0)
- return list[i];
- }
- }
- if (type == 6)
- {
- if (i > 0)
- {
- if ((list[i].n7 - list[i - 1].n7) != 0)
- return list[i];
- }
- }
- }
- return info;
- }
- #region 上一次某个号码的大小情况
-
-
-
-
-
-
-
- public static Tchlj61Info GetLastNdxInfo(ref List<Tchlj61Info> list, int dx, int rank, int site)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (site == 0)
- {
- if (ZstUtils.GetDx(list[i].n1) == dx)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 1)
- {
- if (ZstUtils.GetDx(list[i].n2) == dx)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 2)
- {
- if (ZstUtils.GetDx(list[i].n3) == dx)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 3)
- {
- if (ZstUtils.GetDx(list[i].n4) == dx)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 5)
- {
- if (ZstUtils.GetDx(list[i].n6) == dx)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 6)
- {
- if (ZstUtils.GetDx(list[i].n7) == dx)
- {
- info = list[i];
- return info;
- }
- }
- }
- return info;
- }
- #endregion
- #region 奇偶形态的上一次数据
-
-
-
-
-
-
-
- public static Tchlj61Info GetLastNjoInfo(ref List<Tchlj61Info> list, int jo, int rank, int site)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (site == 0)
- {
- if (ZstUtils.GetJo(list[i].n1) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 1)
- {
- if (ZstUtils.GetJo(list[i].n2) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 2)
- {
- if (ZstUtils.GetJo(list[i].n3) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 3)
- {
- if (ZstUtils.GetJo(list[i].n4) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 4)
- {
- if (ZstUtils.GetJo(list[i].n5) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 5)
- {
- if (ZstUtils.GetJo(list[i].n6) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 6)
- {
- if (ZstUtils.GetJo(list[i].n7) == jo)
- {
- info = list[i];
- return info;
- }
- }
- }
- return info;
- }
- #endregion
- #region 质号形态的上一次数据
-
-
-
-
-
-
-
- public static Tchlj61Info GetLastNzhInfo(ref List<Tchlj61Info> list, int jo, int rank, int site)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (site == 0)
- {
- if (ZstUtils.GetZh(list[i].n1) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 1)
- {
- if (ZstUtils.GetZh(list[i].n2) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 2)
- {
- if (ZstUtils.GetZh(list[i].n3) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 3)
- {
- if (ZstUtils.GetZh(list[i].n4) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 4)
- {
- if (ZstUtils.GetZh(list[i].n5) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 5)
- {
- if (ZstUtils.GetZh(list[i].n6) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 6)
- {
- if (ZstUtils.GetZh(list[i].n7) == jo)
- {
- info = list[i];
- return info;
- }
- }
- }
- return info;
- }
- #endregion
- #region 012路形态的上一次数据
-
-
-
-
-
-
-
- public static Tchlj61Info GetLastN012Info(ref List<Tchlj61Info> list, int jo, int rank, int site)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (site == 0)
- {
- if (ZstUtils.Get012(list[i].n1) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 1)
- {
- if (ZstUtils.Get012(list[i].n2) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 2)
- {
- if (ZstUtils.Get012(list[i].n3) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 3)
- {
- if (ZstUtils.Get012(list[i].n4) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 4)
- {
- if (ZstUtils.Get012(list[i].n5) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 5)
- {
- if (ZstUtils.Get012(list[i].n6) == jo)
- {
- info = list[i];
- return info;
- }
- }
- if (site == 6)
- {
- if (ZstUtils.Get012(list[i].n7) == jo)
- {
- info = list[i];
- return info;
- }
- }
- }
- return info;
- }
- #endregion
- #region 上一次某个号码振幅的数据
-
-
-
-
-
-
-
- public static Tchlj61Info GetLastNZfInfo(ref List<Tchlj61Info> list, int zf, int rank, int type)
- {
- Tchlj61Info info = new Tchlj61Info();
- int size = list.Count;
- for (int i = rank - 2; i >= 0; i--)
- {
- if (i > 0)
- {
- if (type == 0)
- {
- if (Math.Abs(list[i].n1 - list[i - 1].n1) == zf)
- {
- info = list[i];
- return info;
- }
- }
- if (type == 1)
- {
- if (Math.Abs(list[i].n2 - list[i - 1].n2) == zf)
- {
- info = list[i];
- return info;
- }
- }
- if (type == 2)
- {
- if (Math.Abs(list[i].n3 - list[i - 1].n3) == zf)
- {
- info = list[i];
- return info;
- }
- }
- if (type == 3)
- {
- if (Math.Abs(list[i].n4 - list[i - 1].n4) == zf)
- {
- info = list[i];
- return info;
- }
- }
- if (type == 4)
- {
- if (Math.Abs(list[i].n5 - list[i - 1].n5) == zf)
- {
- info = list[i];
- return info;
- }
- }
- if (type == 5)
- {
- if (Math.Abs(list[i].n6 - list[i - 1].n6) == zf)
- {
- info = list[i];
- return info;
- }
- }
- if (type == 6)
- {
- if (Math.Abs(list[i].n7 - list[i - 1].n7) == zf)
- {
- info = list[i];
- return info;
- }
- }
- }
- }
- return info;
- }
- #endregion
- #endregion
- #region 冷热号
-
-
-
-
-
-
-
-
- public static bool GetTchlj61HmLrInfo(ref List<Tchlj61Info> list, int val, int type, int size, int rank)
- {
- Tchlj61Info info = new Tchlj61Info();
- info = GetLastTchlj61Info(ref list,val, rank, type);
- if ((rank - info.rank) <= size)
- return true;
- return false;
- }
-
-
-
-
-
-
- public static Tchlj61Info GetTchlj61LastHmHrInfo(ref List<Tchlj61Info> list, int type, int size, int rank, bool iscool)
- {
- Tchlj61Info info = new Tchlj61Info();
- if (list != null && list.Count > 0)
- {
- for (int i = rank - 2; i >= 0; i--)
- {
- if (iscool)
- {
- if (type == 0)
- {
- if (!GetTchlj61HmLrInfo(ref list,list[i].n1, type, size, list[i].rank))
- return list[i];
- }
- if (type == 1)
- {
- if (!GetTchlj61HmLrInfo(ref list,list[i].n2, type, size, list[i].rank))
- return list[i];
- }
- if (type == 2)
- {
- if (!GetTchlj61HmLrInfo(ref list,list[i].n3, type, size, list[i].rank))
- return list[i];
- }
- if (type == 3)
- {
- if (!GetTchlj61HmLrInfo(ref list,list[i].n4, type, size, list[i].rank))
- return list[i];
- }
- if (type == 4)
- {
- if (!GetTchlj61HmLrInfo(ref list,list[i].n5, type, size, list[i].rank))
- return list[i];
- }
- if (type == 5)
- {
- if (!GetTchlj61HmLrInfo(ref list,list[i].n6, type, size, list[i].rank))
- return list[i];
- }
- if (type == 6)
- {
- if (!GetTchlj61HmLrInfo(ref list,list[i].n7, type, size, list[i].rank))
- return list[i];
- }
- }
- if (!iscool)
- {
- if (type == 0)
- {
- if (GetTchlj61HmLrInfo(ref list,list[i].n1, type, size, list[i].rank))
- return list[i];
- }
- if (type == 1)
- {
- if (GetTchlj61HmLrInfo(ref list,list[i].n2, type, size, list[i].rank))
- return list[i];
- }
- if (type == 2)
- {
- if (GetTchlj61HmLrInfo(ref list,list[i].n3, type, size, list[i].rank))
- return list[i];
- }
- if (type == 3)
- {
- if (GetTchlj61HmLrInfo(ref list,list[i].n4, type, size, list[i].rank))
- return list[i];
- }
- if (type == 4)
- {
- if (GetTchlj61HmLrInfo(ref list,list[i].n5, type, size, list[i].rank))
- return list[i];
- }
- if (type == 5)
- {
- if (GetTchlj61HmLrInfo(ref list,list[i].n6, type, size, list[i].rank))
- return list[i];
- }
- if (type == 6)
- {
- if (GetTchlj61HmLrInfo(ref list,list[i].n7, type, size, list[i].rank))
- return list[i];
- }
- }
- }
- }
- return info;
- }
- #endregion
- #region 最近n期形态=x的数据列表
-
-
-
-
- public static List<Tchlj61Info> GetFcQlcListByHw(ref List<Tchlj61Info> list, int val)
- {
- List<Tchlj61Info> rlist = new List<Tchlj61Info>();
- if (list != null && list.Count > 0)
- {
- int size = list.Count;
- for (int i = 0; i < size; i++)
- {
- if (ZstUtils.GetHw(list[i].hz) == val)
- rlist.Add(list[i]);
- }
- }
- return rlist;
- }
-
-
-
-
-
- public static List<Tchlj61Info> GetFcQlcListByKd(ref List<Tchlj61Info> list, int val)
- {
- List<Tchlj61Info> rlist = new List<Tchlj61Info>();
- if (list != null && list.Count > 0)
- {
- int size = list.Count;
- for (int i = 0; i < size; i++)
- {
- if (list[i].kd == val)
- rlist.Add(list[i]);
- }
- }
- return rlist;
- }
-
-
-
-
-
- public static List<Tchlj61Info> GetFcQlcListByRed(ref List<Tchlj61Info> list, int red)
- {
- List<Tchlj61Info> rlist = new List<Tchlj61Info>();
- if (list != null && list.Count > 0)
- {
- int size = list.Count;
- for (int i = 0; i < size; i++)
- {
- List<int> kjh = new List<int>() { list[i].n1, list[i].n2, list[i].n3, list[i].n4, list[i].n5, list[i].n6, list[i].n7 };
- if (kjh.Contains(red))
- rlist.Add(list[i]);
- }
- }
- return rlist;
- }
- #endregion
- #region 开奖公告相关方法
-
-
-
-
- public static List<Tchlj61LongInfo> GetTchlj61ListTop30()
- {
- string key = string.Format(CacheKeys.TCHLJ61_KJH_DATA);
- List<Tchlj61LongInfo> list = cache.GetObject<List<Tchlj61LongInfo>>(key) as List<Tchlj61LongInfo>;
- if (list == null)
- {
- list = Tchlj61Data.GetTchlj61Top30();
- cache.AddObject(key, list, (int)CacheTime.Kjh);
- }
- return list;
- }
-
-
-
-
- public static Tchlj61LongInfo GetTchlj61InfoTop1(ref List<Tchlj61LongInfo> list)
- {
- Tchlj61LongInfo info = new Tchlj61LongInfo();
- if (list.Count > 0)
- {
- info = list[0];
- }
- return info;
- }
-
-
-
-
-
- public static Tchlj61LongInfo GetTchlj61InfoByqi(int qi)
- {
- return Tchlj61Data.GetTchlj61InfoByQi(qi);
- }
-
-
-
-
-
- public static List<int> GetTchlj61QiListByYear(int year)
- {
- string key = string.Format(CacheKeys.TCHLJ61_KJH_DATA + "/qilistbyyear/{0}", year);
- List<int> list = cache.GetObject<List<int>>(key) as List<int>;
- if (list == null)
- {
- list = Tchlj61Data.GetTchlj61QiListByYear(year);
- cache.AddObject(key, list, (int)CacheTime.System);
- }
- return list;
- }
- #endregion
- }
- }
|