Guest User

Untitled

a guest
Feb 8th, 2018
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. class OALoginDialogClass
  2. {
  3.  
  4.  
  5. Dialog dialog;
  6. DialogField dFUsername;
  7. DialogField dFPassword;
  8. OALoginTable1 oalogintable;
  9. UserName usern;
  10. Password passw;
  11.  
  12.  
  13.  
  14. public static void main(Args args)
  15. {
  16. OALoginDialogClass oald = new OALoginDialogClass();
  17. oald.run();
  18. }
  19.  
  20. void run()
  21. {
  22. this.setupDialog();
  23. Dialog.run();
  24. Dialog.wait();
  25. if(Dialog.closedOk())
  26. {
  27. this.getfromDialog();
  28. }
  29. this.check();
  30.  
  31.  
  32. }
  33.  
  34. public void new()
  35. {
  36. dialog= new Dialog();
  37. }
  38.  
  39. public void setupDialog()
  40. {
  41. dFUsername=dialog.addField(extendedTypeStr(UserName),"Username");
  42. dFPassword=dialog.addField(extendedTypeStr(Password),"Password");
  43. }
  44.  
  45. public void getfromDialog()
  46. {
  47.  
  48. usern = dFUsername.value();
  49. passw = dFPassword.value();
  50. }
  51.  
  52. public void check()
  53. {
  54. select oalogintable
  55. where oalogintable.UserNameCopy1 == usern;
  56. if(oalogintable)
  57. {
  58. info("Already Exist");
  59. }
  60.  
  61. else
  62. {
  63. this.show();
  64. }
  65.  
  66. }
  67.  
  68. public void show()
  69. {
  70.  
  71.  
  72. oalogintable.UserNameCopy1 = this.usern;
  73. oalogintable.PasswordCopy1 = this.passw;
  74. oalogintable.insert();
  75. info("Record inserted");
  76. }
  77.  
  78. }
Add Comment
Please, Sign In to add comment