예제 #1
0
파일: CardForm.cs 프로젝트: TerraPass/ATM
 public CardForm(ATM master, string text = "Enter your card number", int maxLength = 16)
 {
     InitializeComponent();
     _master = master;
     this.HintLabel.Text = text;
     this.NumBox.MaxLength = maxLength;
 }
예제 #2
0
파일: Program.cs 프로젝트: TerraPass/ATM
 static void Main()
 {
     System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
     atm = new ATM(0, "Kyiv-Mohyla Academy");
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     //Task t = Task.Factory.StartNew(() => {
     //    while (true)
     //    {
     //        atm.stateMachine.Update();
     //        MessageDispatcher.instance.Update();
     //        System.Threading.Thread.Sleep(3000);
     //    }
     //});
     Application.Run(new Screen(atm));
 }
예제 #3
0
        static void Main(string[] args)
        {
            Action <int, string, int> Messenge = new Action <int, string, int>(encashment);

            Messenge += menegers;
            Action <int> Displey     = new Action <int>(disleymessege);
            ATM          CashMachine = new ATM(125, "Televizionaya street 4-a", Messenge, Displey);

            do
            {
                Console.WriteLine("\n" + CashMachine.ToString());
                Console.WriteLine("Set Summ please!");
                int Summ = Convert.ToInt32(Console.ReadLine());
                CashMachine.WithdrawMoney(Summ);
                Console.WriteLine("Set esc for exite please!");
            } while (Console.ReadKey().Key != ConsoleKey.Escape);
        }
예제 #4
0
파일: Screen.cs 프로젝트: TerraPass/ATM
 public Screen(ATM simulatedAtm)
 {
     InitializeComponent();
     _simAtm = simulatedAtm;
     _simAtm.screen = this;
     for (int i = 0; i < BTN_COUNT; i++)
     {
         physButtons[i] = new Button();
         physButtons[i].Size = new Size(208, 61);
         if (i < 4)
             physButtons[i].Location = new Point(10, 101 + i * 80);
         else
             physButtons[i].Location = new Point(Size.Width - 223, 101 + (i - 4) * 80);
         physButtons[i].Visible = physButtons[i].Enabled = false;
         physButtons[i].BackColor = System.Drawing.Color.White;
         physButtons[i].Font = new System.Drawing.Font("Microsoft Sans Serif", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
         physButtons[i].Tag = new List<string>();
         Controls.Add(physButtons[i]);
     }
     ((List<string>)(physButtons[1].Tag)).Add("transferButton");
     ((List<string>)(physButtons[2].Tag)).Add("exitButton");
     ((List<string>)(physButtons[3].Tag)).Add("exitButton2");
     ((List<string>)(physButtons[5].Tag)).Add("ledgerButton");
     ((List<string>)(physButtons[6].Tag)).Add("withdrawalButton");
     ((List<string>)(physButtons[6].Tag)).Add("proceedButton");
     ((List<string>)(physButtons[7].Tag)).Add("backButton");
     physButtons[0].Click += OnPhysButton0_Click;
     physButtons[1].Click += OnPhysButton1_Click;
     physButtons[2].Click += OnPhysButton2_Click;
     physButtons[3].Click += OnPhysButton3_Click;
     physButtons[4].Click += OnPhysButton4_Click;
     physButtons[5].Click += OnPhysButton5_Click;
     physButtons[6].Click += OnPhysButton6_Click;
     physButtons[7].Click += OnPhysButton7_Click;
     DrawMaintenance();
 }