Guest User

Bankomat C#.

a guest
Sep 12th, 2014
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.76 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. //
  6. //
  7. //
  8. //
  9. //
  10. // Detta är inloggningsmetoden.
  11. //
  12. //
  13. //
  14. //
  15. //
  16.  
  17.  
  18.  
  19. using System;
  20. using System.Collections.Generic;
  21. using System.ComponentModel;
  22. using System.Data;
  23. using System.Drawing;
  24. using System.Linq;
  25. using System.Text;
  26. using System.Threading.Tasks;
  27. using System.Windows.Forms;
  28.  
  29. namespace WindowsFormsApplication14
  30. {
  31.     public partial class Bankomat : Form
  32.     {
  33.         public Bankomat()
  34.         {
  35.             InitializeComponent();
  36.             txtKod.PasswordChar = '*';
  37.            
  38.         }
  39.  
  40.         private void btn_Click(object sender, EventArgs e)
  41.         {
  42.             Button btn = (Button)sender;
  43.             txtKod.Text = txtKod.Text + btn.Text;
  44.         }
  45.  
  46.         private void txtKod_TextChanged(object sender, EventArgs e)
  47.         {
  48.  
  49.         }
  50.  
  51.         private void btn_Clear(object sender, EventArgs e)
  52.         {
  53.             txtKod.Clear();
  54.         }
  55.  
  56.         private void btn_ok(object sender, EventArgs e)
  57.         {
  58.             if (txtKod.Text == "1234")
  59.             {
  60.                 MessageBox.Show("Du har loggat in.");
  61.                 Uttag Uttag = new Uttag();
  62.                 this.Hide();
  63.                 Uttag.Show();
  64.                
  65.             }
  66.         }
  67.     }
  68. }
  69.  
  70.  
  71. //
  72. //
  73. //
  74. //
  75. //
  76. //Detta är motoden för att ta ut pengar, den fungerar inte än.
  77. //
  78. //
  79. //
  80. //
  81. //
  82.  
  83. using System;
  84. using System.Collections.Generic;
  85. using System.ComponentModel;
  86. using System.Data;
  87. using System.Drawing;
  88. using System.Linq;
  89. using System.Text;
  90. using System.Threading.Tasks;
  91. using System.Windows.Forms;
  92.  
  93. namespace WindowsFormsApplication14
  94. {
  95.     public partial class Uttag : Form
  96.     {
  97.         public Uttag()
  98.         {
  99.             InitializeComponent();
  100.            
  101.         }
  102.        
  103.         private void Uttag_Load(object sender, EventArgs e)
  104.         {
  105.  
  106.         }
  107.  
  108.         private void btn_uttag_premade(object sender, EventArgs e)
  109.         {
  110.             PENGAR_UTTAG.Clear();
  111.             Button btn_Two = (Button)sender;
  112.             PENGAR_UTTAG.Text = PENGAR_UTTAG.Text + btn_Two.Text;
  113.            
  114.            
  115.         }
  116.  
  117.         private void PENGAR_TextChanged(object sender, EventArgs e)
  118.         {
  119.            
  120.             int pengar = 1000;
  121.             String pengarValue = Convert.ToString(pengar);
  122.             PENGAR.Text = (pengarValue);
  123.         }
  124.  
  125.         private void PENGAR_UTTAG_TextChanged(object sender, EventArgs e)
  126.         {
  127.  
  128.         }
  129.  
  130.         private void btn_ok2(object sender, EventArgs e)
  131.         {
  132.             Button b = (Button)sender;
  133.             PENGAR.Text = PENGAR.Text + b.Text;
  134.         }
  135.  
  136.         private void btn_cancel(object sender, EventArgs e)
  137.         {
  138.             Button b = (Button)sender;
  139.             PENGAR_UTTAG.Clear();
  140.         }
  141.     }
  142. }
Add Comment
Please, Sign In to add comment