public void bindtoken1(string service, string centercode) { BusinessLayer.Display.tokendisplay bt = new BusinessLayer.Display.tokendisplay(); try { DataTable dt = new DataTable(); //use for LL DataTable dtd = new DataTable(); //use for DL string STR = ""; string STR1 = ""; string STR2 = ""; string STR3 = ""; //string service = "NEW LL"; //string centercode = "BLS06"; //string datenow = DateTime.Now.ToString("dd/MM/yyyy"); dt = bt.GetDisplayTokenBLL(service, centercode); if (dt.Rows.Count > 0) { int num = Convert.ToInt32(dt.Rows[0]["TokenNo_INT"].ToString()); if (num % 2 == 0) { STR += "<div class=\"tile-header dvd dvd-btm\"><div class=\"text-center\"><h1 class=\"custom-font\"><strong class=\"st-class\">" + dt.Rows[0]["CounterName_VCR"].ToString() + "</strong></h1></div></div> <div class=\"tile-body h\"><div class=\"text-center\"><strong class=\"st-class1\">" + service + "</strong><br/> <strong class=\"st-class1\">Token Number</strong><br /><strong class=\"st-class12\">" + dt.Rows[0]["TokenNo_INT"].ToString() + "</strong></div></div>"; token.Visible = true; token2.Visible = false; token.Text = STR; } else { STR2 += "<div class=\"tile-header dvd dvd-btm\"><div class=\"text-center\"><h1 class=\"custom-font\"><strong class=\"st-class\">" + dt.Rows[0]["CounterName_VCR"].ToString() + "</strong></h1></div></div> <div class=\"tile-body h\"><div class=\"text-center\"><strong class=\"st-class1\">" + service + "</strong><br/> <strong class=\"st-class1\">Token Number</strong><br /><strong class=\"st-class12\">" + dt.Rows[0]["TokenNo_INT"].ToString() + "</strong></div></div>"; token2.Visible = true; token.Visible = false; token2.Text = STR2; } } else { //token.Text = "NA"; //token2.Text = "NA"; } //for LL.............................................. //dt = dl.getdataTable("select TOP 1 e.Token,t.CounterNumber from tbl_entrance e inner join tbl_token t on (e.Applicationno=t.Application_Number) where e.date='" + datenow + "' and e.Status='out' and e.Service='LL' order by t.Token_Id desc"); //if (dt.Rows.Count > 0) //{ // int num = Convert.ToInt32(dt.Rows[0]["Token"].ToString()); // if (num % 2 == 0) // { // STR += "<div class=\"tile-header dvd dvd-btm\"><div class=\"text-center\"><h1 class=\"custom-font\"><strong class=\"st-class\">" + dt.Rows[0]["CounterNumber"].ToString() + "</strong></h1></div></div> <div class=\"tile-body h\"><div class=\"text-center\"><strong class=\"st-class1\">Learners License(LL)</strong><br/> <strong class=\"st-class1\">Token Number</strong><br /><strong class=\"st-class12\">" + dt.Rows[0]["Token"].ToString() + "</strong></div></div>"; // token.Visible = true; // token2.Visible = false; // token.Text = STR; // } // else // { // STR2 += "<div class=\"tile-header dvd dvd-btm\"><div class=\"text-center\"><h1 class=\"custom-font\"><strong class=\"st-class\">" + dt.Rows[0]["CounterNumber"].ToString() + "</strong></h1></div></div> <div class=\"tile-body h\"><div class=\"text-center\"><strong class=\"st-class1\">Learners License(LL)</strong><br/> <strong class=\"st-class1\">Token Number</strong><br /><strong class=\"st-class12\">" + dt.Rows[0]["Token"].ToString() + "</strong></div></div>"; // token2.Visible = true; // token.Visible = false; // token2.Text = STR2; // } //} //else //{ // //token.Text = "NA"; // //token2.Text = "NA"; //} ////for DL.................................................................... //dtd = dl.getdataTable("select TOP 1 e.Token,t.CounterNumber from tbl_entrance e inner join tbl_token t on (e.Applicationno=t.Application_Number) where e.date='" + datenow + "' and e.Status='out' and e.Service='DL' order by t.Token_Id desc"); //if (dtd.Rows.Count > 0) //{ // int num1 = Convert.ToInt32(dtd.Rows[0]["Token"].ToString()); // if (num1 % 2 == 0) // { // STR1 += "<div class=\"tile-header dvd dvd-btm\"><div class=\"text-center\"><h1 class=\"custom-font\"><strong class=\"st-class\">" + dtd.Rows[0]["CounterNumber"].ToString() + "</strong></h1></div></div> <div class=\"tile-body h\"><div class=\"text-center\"><strong class=\"st-class1\">Driving License(DL)</strong><br /> <strong class=\"st-class1\">Token Number</strong><br /><strong class=\"st-class12\">" + dtd.Rows[0]["Token"].ToString() + "</strong></div></div>"; // token1.Visible = true; // token3.Visible = false; // token1.Text = STR1; // } // else // { // STR3 += "<div class=\"tile-header dvd dvd-btm\"><div class=\"text-center\"><h1 class=\"custom-font\"><strong class=\"st-class\">" + dtd.Rows[0]["CounterNumber"].ToString() + "</strong></h1></div></div> <div class=\"tile-body h\"><div class=\"text-center\"><strong class=\"st-class1\">Driving License(DL)</strong><br /> <strong class=\"st-class1\">Token Number</strong><br /><strong class=\"st-class12\">" + dtd.Rows[0]["Token"].ToString() + "</strong></div></div>"; // token3.Visible = true; // token1.Visible = false; // token3.Text = STR3; // } //} //else //{ // //token1.Text = "NA"; // //token3.Text = "NA"; //} } catch { } }
public void bindtoken(string service, string centercode) { BusinessLayer.Display.tokendisplay bt = new BusinessLayer.Display.tokendisplay(); try { int actualcount = 0; string str = ""; int j = 0; string chk1stul = ""; string chk2stul = ""; string next = ""; string current = ""; string Upcoming = ""; DataTable dt = new DataTable(); //string service = "NEW LL"; //string centercode = "BBS02"; int tokencount = 0; dt = bt.SGetDisplayTokenBLL(service, centercode); if (dt.Rows.Count > 0) { tokencount = dt.Rows.Count; if (tokencount == 1) { current = dt.Rows[0]["TokenNo_INT"].ToString(); next = "NA"; Upcoming = "NA"; } else if (tokencount == 2) { current = dt.Rows[0]["TokenNo_INT"].ToString(); next = dt.Rows[1]["TokenNo_INT"].ToString(); Upcoming = "NA"; } else if (tokencount == 3) { current = dt.Rows[0]["TokenNo_INT"].ToString(); next = dt.Rows[1]["TokenNo_INT"].ToString(); Upcoming = dt.Rows[2]["TokenNo_INT"].ToString(); } str += "<ul class=\"token-cont-row\">"; str += "<li class=\"flex-item\">" + "<div class=\"card\"><div class=\"body\"><div class=\"tok-box\"><div class=\"tok-head\">" + "<div class=\"tok-info\"><div class=\"tl2\"><h3>" + service + "</h3></div><div class=\"tl1\"><span> 1 </span>COUNTER</div>" + "</div></div><div class=\"tok-body\"><div class=\"tok-row\"><div class=\"all_div text-center\"><div class=\"cur_div\"><label>CURRENT</label>" + "<p>" + current + "</p></div><div class=\"nxt_div\"><label>NEXT</label><p>" + next + "</p></div><div class=\"nxt_div\"><label>UPCOMING</label><p>" + Upcoming + "</p>" + "</div></div></div></div></div></div></div></li>"; token.Text = str; } System.Text.StringBuilder sb = new System.Text.StringBuilder(); if (actualcount != 3 && actualcount != 6 && actualcount != 9) { if (actualcount == 1 || actualcount == 4 || actualcount == 7) { sb.Append("".PadRight(64, ' ').Replace(" ", " ")); str += "<ul class=\"token-cont-row\">" + "<li class=\"flex-item\">" + sb.ToString() + "</li>" + "</ul>"; token.Text = str + sb.ToString(); } else { sb.Append("".PadRight(71, ' ').Replace(" ", " ")); str += "<ul class=\"token-cont-row\">" + "<li class=\"flex-item\">" + sb.ToString() + "</li>" + "</ul>"; token.Text = str + sb.ToString(); } } } catch { } }