- private void generateWildCard()
- {
- gameCode = "5109";
- string mainPart = "";
- 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(',') };
- 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(',') };
- 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"] };
- 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"] };
- 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"] };
- 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"] };
- int draws = Convert.ToInt32(Request.Form["draws"]);
- /*
- 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(',')};
- 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(',')};
- 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"]};
- 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"] };
- 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"]};
- 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"]};
- int draws = Convert.ToInt32(Request.QueryString["draws"]);
- */
- //Index 0 - multidraw
- if (draws > 1)
- {
- switch (draws)
- {
- case 2:
- draws = 0;
- break;
- case 3:
- draws = 1;
- break;
- case 4:
- draws = 2;
- break;
- case 5:
- draws = 3;
- break;
- case 6:
- draws = 4;
- break;
- case 8:
- draws = 5;
- break;
- case 10:
- draws = 6;
- break;
- }
- mainPart += "00010" + draws;
- }
- //Index 1 thru Index 5 - Play A 1 Number Cards thru Play E 1 Number Cards
- string play1numbers = "";
- for (int x = 0; x < 5; x++)
- {
- if (plays1[x][0] != "na" && plays1[x][0] != "qp")
- {
- if (plays1[x][0] != "" && plays1[x][1] != "" && plays1[x][2] != "" && plays1[x][3] != "" && plays1[x][4] != "")
- {
- string play = "";
- for (int i = 0; i < 5; i++)
- {
- play += fixDigit(plays1[x][i]);
- }
- if (play.Length == 10)
- {
- play1numbers += "0" + (x + 1) + "05" + play;
- }
- }
- }
- }
- //Index 6 thru Index 10 - Play A 1 Face Cards thru Play E 1 Face Cards
- string play1face = "";
- for (int x = 0; x < 5; x++)
- {
- if (extras_1[x] != "na" && extras_1[x] != "" && extras2_1[x] != "na" && extras2_1[x] != "")
- {
- string facecard = "";
- switch (extras_1[x])
- {
- case "jack":
- facecard += "00";
- break;
- case "queen":
- facecard += "01";
- break;
- case "king":
- facecard += "02";
- break;
- case "ace":
- facecard += "03";
- break;
- }
- switch (extras2_1[x])
- {
- case "diamond":
- facecard += "04";
- break;
- case "club":
- facecard += "05";
- break;
- case "heart":
- facecard += "06";
- break;
- case "spade":
- facecard += "07";
- break;
- }
- if (facecard.Length == 4)
- {
- if (x < 4)
- {
- play1face += "0" + (x + 6) + "02" + facecard;
- }
- else
- {
- play1face += (x + 6) + "02" + facecard;
- }
- }
- }
- }
- //Index 11 thru Index 15 - Play A 2 Number Cards thru Play E 2 Number Cards
- string play2numbers = "";
- for (int x = 0; x < 5; x++)
- {
- if (plays2[x][0] != "na" && plays2[x][0] != "qp")
- {
- if (plays2[x][0] != "" && plays2[x][1] != "" && plays2[x][2] != "" && plays2[x][3] != "" && plays2[x][4] != "")
- {
- string play = "";
- for (int i = 0; i < 5; i++)
- {
- play += fixDigit(plays2[x][i]);
- }
- if (play.Length == 10)
- {
- play2numbers += (x + 11) + "05" + play;
- }
- }
- }
- }
- //Index 16 thru Index 20 - Play A 2 Face Cards thru Play E 2 Face Cards
- string play2face = "";
- for (int x = 0; x < 5; x++)
- {
- if (extras_2[x] != "na" && extras_2[x] != "" && extras2_2[x] != "na" && extras2_2[x] != "")
- {
- string facecard = "";
- switch (extras_2[x])
- {
- case "jack":
- facecard += "00";
- break;
- case "queen":
- facecard += "01";
- break;
- case "king":
- facecard += "02";
- break;
- case "ace":
- facecard += "03";
- break;
- }
- switch (extras2_2[x])
- {
- case "diamond":
- facecard += "04";
- break;
- case "club":
- facecard += "05";
- break;
- case "heart":
- facecard += "06";
- break;
- case "spade":
- facecard += "07";
- break;
- }
- if (facecard.Length == 4)
- {
- play2face += (x + 16) + "02" + facecard;
- }
- }
- }
- //Index 21 thru Index 25 - Play A 1 Extra QuickPick thru Play E 1 Extra QuickPick
- string qp1 = "";
- for (int x = 0; x < 5; x++)
- {
- if (plays1[x][0] == "qp")
- {
- qp1 += (x + 21) + "0100";
- }
- }
- //Index 26 thru Index 30 - Play A 2 Extra QuickPick thru Play E 2 Extra QuickPick
- string qp2 = "";
- for (int x = 0; x < 5; x++)
- {
- if (plays2[x][0] == "qp")
- {
- qp2 += (x + 26) + "0100";
- }
- }
- mainPart += play1numbers + play1face + play2numbers + play2face + qp1 + qp2;
- createBarcode(magicNumber + gameCode + barcodeCRC(mainPart) + mainPart);
- }