Advertisement
shamiul93

Untitled

Jan 15th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1.  
  2. String billId, simNo, callBill, smsBill, netBill, totalBill, issuedBy;
  3.  
  4. public void showBill() {
  5.  
  6. double posX = 300, posY = 200;
  7. BackSceneOnly();
  8. try {
  9. String sql = "SELECT * FROM POSTPAID_BILL \n"
  10. + "WHERE SIM_NO = ? AND ISSUED_BY IS NOT NULL AND IS_PAID = 'NO'";
  11.  
  12. Connection con = new DataBase("TELECOM", "hr").getConnection();
  13.  
  14. PreparedStatement pst = con.prepareStatement(sql);
  15.  
  16. pst.setString(1, phoneno);
  17.  
  18. ResultSet rs = pst.executeQuery();
  19.  
  20. System.out.println("muri kha");
  21.  
  22. if (rs.next()) {
  23. billId = rs.getString(1);
  24. simNo = rs.getString(2);
  25. callBill = rs.getString(3);
  26. smsBill = rs.getString(4);
  27. netBill = rs.getString(5);
  28. totalBill = rs.getString(6);
  29. issuedBy = rs.getString(7);
  30.  
  31. Text bid = new Text("Bill ID : " + billId);
  32. bid.setX(posX);
  33. bid.setY(posY + 100);
  34. bid.setFill(Color.rgb(0, 0, 0));
  35.  
  36. Text simno = new Text("User SIM No : " + simNo);
  37. simno.setX(posX);
  38. simno.setY(posY + 150);
  39. simno.setFill(Color.rgb(0, 0, 0));
  40.  
  41. Text cb = new Text("Bill For Call : " + callBill);
  42. cb.setX(posX);
  43. cb.setY(posY + 200);
  44. cb.setFill(Color.rgb(0, 0, 0));
  45.  
  46. Text sb = new Text("Bill For SMS : " + smsBill);
  47. sb.setX(posX);
  48. sb.setY(posY + 250);
  49. sb.setFill(Color.rgb(0, 0, 0));
  50.  
  51. Text nb = new Text("Bill For Net : " + netBill);
  52. nb.setX(posX);
  53. nb.setY(posY + 300);
  54. nb.setFill(Color.rgb(0, 0, 0));
  55.  
  56. Text totbill = new Text("Total Bill : " + totalBill);
  57. totbill.setX(posX);
  58. totbill.setY(posY + 350);
  59. totbill.setFill(Color.rgb(0, 0, 0));
  60.  
  61. Text ib = new Text("Issued By : " + issuedBy );
  62. ib.setX(posX);
  63. ib.setY(posY + 400);
  64. ib.setFill(Color.rgb(0, 0, 0));
  65.  
  66. root.getChildren().add(ib);
  67. root.getChildren().add(totbill);
  68. root.getChildren().add(nb);
  69. root.getChildren().add(sb);
  70. root.getChildren().add(cb);
  71. root.getChildren().add(simno);
  72. root.getChildren().add(bid);
  73.  
  74. StageShow();
  75.  
  76. SuccessMsg("", "You have a due of " + totalBill + " Taka");
  77. } else {
  78. SuccessMsg("Congratulations!", "You don't have any due right now");
  79. }
  80.  
  81.  
  82.  
  83. pst.close();
  84. con.close();
  85. SuccessMsg("Success", "Your Balance Was retrieved");
  86. } catch (Exception e) {
  87.  
  88. System.out.println(balance);
  89. InvalidLogInMsg("failed", "Can't check Balance");
  90. }
  91.  
  92. goToProfileButton(300 + 200, 600);
  93.  
  94. StageShow();
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement