The lottery results are 5-digit numbers:
Million, thousand, Hundred, Ten, a
Five-star purchase must be at least each bit to choose a number of combinations, if each digit pair on the calculation of winning; then we must first define the duplex format, as follows:
Thousands of Baishi
Lottery results: 1,2,3,4,5
To combine the data:
Betdetail's Betcontent attribute is the betting content,
Betcontent= "1,2,3,4,5";
1 /// <summary>2 ///get all combinations based on the betting content3 /// </summary>4 /// <returns></returns>5 Privatelist<string>getallbets (BasicModel.LotteryBasic.BetDetail Item)6 {7 if(NULL= = Item | |string. IsNullOrEmpty (item. betcontent))8 return NULL;9 ElseTen { One varBets = Item. Betcontent.split (','); A if(Bets. Count ()! =5) - { - return NULL; the } - Else - { - varList =Newlist<string>(); + varWAN = bets[0]. Select (M =Convert.ToInt32 (m.tostring ())). ToList (); - varQian = bets[1]. Select (M =Convert.ToInt32 (m.tostring ())). ToList (); + varBai = bets[2]. Select (M =Convert.ToInt32 (m.tostring ())). ToList (); A varShi = bets[3]. Select (M =Convert.ToInt32 (m.tostring ())). ToList (); at varGE = bets[4]. Select (M =Convert.ToInt32 (m.tostring ())). ToList (); -List = ( fromWinchWan - fromQinchQian - fromBinchBai - fromSinchShi - fromGinchGE in Select string. Format ("{0}{1}{2}{3}{4}", W, Q, B, S, g)). ToList (); - returnlist; to } + } -}View Code
Perform getallbets to get the result of the combination, and then compare the results, and if you are successful with each position of the lottery results, then the jackpot is long:
1 varList =getallbets (item);2 varresult = list. Find (M = = m = = Openresult.replace (",",""));3 if(Result! =NULL)4 {5Item. IsMatch =true;6 decimalStepamt =0;7Item. Winmoney = Totalwinmoney (item, Getbaseamt (item,refStepamt), Stepamt,1);8}View Code
If you do not understand, please direct messages to me or add group: 5,426,204,091 discussions
Draw calculation---Five-star direct selection Duplex