Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 16th, 2012  |  syntax: None  |  size: 9.05 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. private void generateWildCard()
  2.     {
  3.        
  4.         gameCode = "5109";
  5.        
  6.         string mainPart = "";
  7.  
  8.        
  9.         string[][] plays1 = new string[][] { Request.Form["play_a_1"].Split(','), Request.Form["play_b_1"].Split(','), Request.Form["play_c_1"].Split(','), Request.Form["play_d_1"].Split(','), Request.Form["play_e_1"].Split(',') };
  10.         string[][] plays2 = new string[][] { Request.Form["play_a_2"].Split(','), Request.Form["play_b_2"].Split(','), Request.Form["play_c_2"].Split(','), Request.Form["play_d_2"].Split(','), Request.Form["play_e_2"].Split(',') };
  11.         string[] extras_1 = new string[] { Request.Form["extra_a_1"], Request.Form["extra_b_1"], Request.Form["extra_c_1"], Request.Form["extra_d_1"], Request.Form["extra_e_1"] };
  12.         string[] extras_2 = new string[] { Request.Form["extra_a_2"], Request.Form["extra_b_2"], Request.Form["extra_c_2"], Request.Form["extra_d_2"], Request.Form["extra_e_2"] };
  13.         string[] extras2_1 = new string[] { Request.Form["extra2_a_1"], Request.Form["extra2_b_1"], Request.Form["extra2_c_1"], Request.Form["extra2_d_1"], Request.Form["extra2_e_1"] };
  14.         string[] extras2_2 = new string[] { Request.Form["extra2_a_2"], Request.Form["extra2_b_2"], Request.Form["extra2_c_2"], Request.Form["extra2_d_2"], Request.Form["extra2_e_2"] };
  15.         int draws = Convert.ToInt32(Request.Form["draws"]);
  16.        
  17.         /*
  18.         string[][] plays1 = new string[][]{Request.QueryString["play_a_1"].Split(','), Request.QueryString["play_b_1"].Split(','), Request.QueryString["play_c_1"].Split(','), Request.QueryString["play_d_1"].Split(','), Request.QueryString["play_e_1"].Split(',')};
  19.         string[][] plays2 = new string[][]{Request.QueryString["play_a_2"].Split(','), Request.QueryString["play_b_2"].Split(','), Request.QueryString["play_c_2"].Split(','), Request.QueryString["play_d_2"].Split(','), Request.QueryString["play_e_2"].Split(',')};
  20.         string[] extras_1 = new string[]{Request.QueryString["extra_a_1"], Request.QueryString["extra_b_1"], Request.QueryString["extra_c_1"], Request.QueryString["extra_d_1"], Request.QueryString["extra_e_1"]};
  21.         string[] extras_2 = new string[]{Request.QueryString["extra_a_2"], Request.QueryString["extra_b_2"], Request.QueryString["extra_c_2"], Request.QueryString["extra_d_2"], Request.QueryString["extra_e_2"] };
  22.         string[] extras2_1 = new string[]{Request.QueryString["extra2_a_1"], Request.QueryString["extra2_b_1"], Request.QueryString["extra2_c_1"], Request.QueryString["extra2_d_1"], Request.QueryString["extra2_e_1"]};
  23.         string[] extras2_2 = new string[]{Request.QueryString["extra2_a_2"], Request.QueryString["extra2_b_2"], Request.QueryString["extra2_c_2"], Request.QueryString["extra2_d_2"], Request.QueryString["extra2_e_2"]};
  24.         int draws = Convert.ToInt32(Request.QueryString["draws"]);
  25.         */
  26.  
  27.         //Index 0 - multidraw
  28.         if (draws > 1)
  29.         {
  30.             switch (draws)
  31.             {
  32.                 case 2:
  33.                     draws = 0;
  34.                     break;
  35.                 case 3:
  36.                     draws = 1;
  37.                     break;
  38.                 case 4:
  39.                     draws = 2;
  40.                     break;
  41.                 case 5:
  42.                     draws = 3;
  43.                     break;
  44.                 case 6:
  45.                     draws = 4;
  46.                     break;
  47.                 case 8:
  48.                     draws = 5;
  49.                     break;
  50.                 case 10:
  51.                     draws = 6;
  52.                     break;
  53.             }
  54.             mainPart += "00010" + draws;
  55.         }
  56.        
  57.         //Index 1 thru Index 5 - Play A 1 Number Cards thru Play E 1 Number Cards
  58.         string play1numbers = "";
  59.         for (int x = 0; x < 5; x++)
  60.         {
  61.             if (plays1[x][0] != "na" && plays1[x][0] != "qp")
  62.             {
  63.                 if (plays1[x][0] != "" && plays1[x][1] != "" && plays1[x][2] != "" && plays1[x][3] != "" && plays1[x][4] != "")
  64.                 {
  65.                     string play = "";
  66.                     for (int i = 0; i < 5; i++)
  67.                     {
  68.                         play += fixDigit(plays1[x][i]);
  69.                     }
  70.                     if (play.Length == 10)
  71.                     {
  72.                         play1numbers += "0" + (x + 1) + "05" + play;
  73.                     }
  74.                 }
  75.             }
  76.         }
  77.         //Index 6 thru Index 10 - Play A 1 Face Cards thru Play E 1 Face Cards
  78.         string play1face = "";
  79.         for (int x = 0; x < 5; x++)
  80.         {
  81.             if (extras_1[x] != "na" && extras_1[x] != "" && extras2_1[x] != "na" && extras2_1[x] != "")
  82.             {
  83.                 string facecard = "";
  84.                 switch (extras_1[x])
  85.                 {
  86.                     case "jack":
  87.                         facecard += "00";
  88.                         break;
  89.                     case "queen":
  90.                         facecard += "01";
  91.                         break;
  92.                     case "king":
  93.                         facecard += "02";
  94.                         break;
  95.                     case "ace":
  96.                         facecard += "03";
  97.                         break;
  98.                 }
  99.                 switch (extras2_1[x])
  100.                 {
  101.                     case "diamond":
  102.                         facecard += "04";
  103.                         break;
  104.                     case "club":
  105.                         facecard += "05";
  106.                         break;
  107.                     case "heart":
  108.                         facecard += "06";
  109.                         break;
  110.                     case "spade":
  111.                         facecard += "07";
  112.                         break;
  113.                 }
  114.                 if (facecard.Length == 4)
  115.                 {
  116.                     if (x < 4)
  117.                     {
  118.                         play1face += "0" + (x + 6) + "02" + facecard;
  119.                     }
  120.                     else
  121.                     {
  122.                         play1face += (x + 6) + "02" + facecard;
  123.                     }
  124.                 }
  125.             }
  126.         }
  127.  
  128.         //Index 11 thru Index 15 - Play A 2 Number Cards thru Play E 2 Number Cards
  129.         string play2numbers = "";
  130.         for (int x = 0; x < 5; x++)
  131.         {
  132.             if (plays2[x][0] != "na" && plays2[x][0] != "qp")
  133.             {
  134.                 if (plays2[x][0] != "" && plays2[x][1] != "" && plays2[x][2] != "" && plays2[x][3] != "" && plays2[x][4] != "")
  135.                 {
  136.                     string play = "";
  137.                     for (int i = 0; i < 5; i++)
  138.                     {
  139.                         play += fixDigit(plays2[x][i]);
  140.                     }
  141.                     if (play.Length == 10)
  142.                     {
  143.                         play2numbers += (x + 11) + "05" + play;
  144.                     }
  145.                 }
  146.             }
  147.         }
  148.  
  149.         //Index 16 thru Index 20 - Play A 2 Face Cards thru Play E 2 Face Cards
  150.         string play2face = "";
  151.         for (int x = 0; x < 5; x++)
  152.         {
  153.             if (extras_2[x] != "na" && extras_2[x] != "" && extras2_2[x] != "na" && extras2_2[x] != "")
  154.             {
  155.                 string facecard = "";
  156.                 switch (extras_2[x])
  157.                 {
  158.                     case "jack":
  159.                         facecard += "00";
  160.                         break;
  161.                     case "queen":
  162.                         facecard += "01";
  163.                         break;
  164.                     case "king":
  165.                         facecard += "02";
  166.                         break;
  167.                     case "ace":
  168.                         facecard += "03";
  169.                         break;
  170.                 }
  171.                 switch (extras2_2[x])
  172.                 {
  173.                     case "diamond":
  174.                         facecard += "04";
  175.                         break;
  176.                     case "club":
  177.                         facecard += "05";
  178.                         break;
  179.                     case "heart":
  180.                         facecard += "06";
  181.                         break;
  182.                     case "spade":
  183.                         facecard += "07";
  184.                         break;
  185.                 }
  186.                 if (facecard.Length == 4)
  187.                 {
  188.                     play2face += (x + 16) + "02" + facecard;
  189.                 }
  190.             }
  191.         }
  192.  
  193.         //Index 21 thru Index 25 - Play A 1 Extra QuickPick thru Play E 1 Extra QuickPick
  194.         string qp1 = "";
  195.         for (int x = 0; x < 5; x++)
  196.         {
  197.             if (plays1[x][0] == "qp")
  198.             {
  199.                 qp1 += (x + 21) + "0100";
  200.             }
  201.         }
  202.  
  203.         //Index 26 thru Index 30 - Play A 2 Extra QuickPick thru Play E 2 Extra QuickPick
  204.         string qp2 = "";
  205.         for (int x = 0; x < 5; x++)
  206.         {
  207.             if (plays2[x][0] == "qp")
  208.             {
  209.                 qp2 += (x + 26) + "0100";
  210.             }
  211.         }
  212.  
  213.         mainPart += play1numbers + play1face + play2numbers + play2face + qp1 + qp2;
  214.         createBarcode(magicNumber + gameCode + barcodeCRC(mainPart) + mainPart);
  215.     }