Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #define ATM_PLEASE_INPUT_CARD 0
- #define ATM_PLEASE_INPUT_PINCODE 1
- #define ATM_MENU 2
- #define ATM_PLEASE_TAKE_CARD_BACK 3
- #define ATM_MENU_BALANCE 4
- #define ATM_MENU_TAKE_MONEY 5
- #define ATM_MENU_TAKE_MONEY_INPUT_PINCODE 6
- #define ATM_MENU_TAKE_MONEY_SUCCESS 7
- #define CARD_PINCODE "1234"
- #define isInputPINCODEScreeen (ATMstate == ATM_PLEASE_INPUT_PINCODE || ATMstate == ATM_MENU_TAKE_MONEY_INPUT_PINCODE)
- using namespace std;
- namespace CourseProject {
- using namespace System;
- using namespace System::ComponentModel;
- using namespace System::Collections;
- using namespace System::Windows::Forms;
- using namespace System::Data;
- using namespace System::Drawing;
- /// <summary>
- /// Сводка для MyForm
- /// </summary>
- public ref class MyForm : public System::Windows::Forms::Form
- {
- protected: int ATMstate = ATM_PLEASE_INPUT_CARD;
- protected: int CardBalance = 500;
- protected: int TakeMoney = 0;
- private: System::Windows::Forms::FlowLayoutPanel^ flowLayoutPanel1;
- private: System::Windows::Forms::Button^ buttonBalance;
- private: System::Windows::Forms::Button^ buttonGiveMoney;
- protected:
- private: System::Windows::Forms::Button^ buttonExit;
- private: System::Windows::Forms::Button^ buttonMoney500;
- private: System::Windows::Forms::Button^ buttonMoney50;
- private: System::Windows::Forms::Button^ buttonMoney250;
- private: System::Windows::Forms::Button^ buttonMoney25;
- private: System::Windows::Forms::Button^ buttonMoney100;
- private: System::Windows::Forms::Button^ buttonMoney10;
- private: System::Windows::Forms::ImageList^ imageList_Картоприемник;
- private: System::Windows::Forms::ImageList^ imageListВыдачаДенег;
- protected:
- protected: System::String^ ATMinput = "";
- public:
- MyForm(void)
- {
- InitializeComponent();
- //
- //TODO: добавьте код конструктора
- //
- }
- protected:
- /// <summary>
- /// Освободить все используемые ресурсы.
- /// </summary>
- ~MyForm()
- {
- if (components)
- {
- delete components;
- }
- }
- protected:
- private: System::Windows::Forms::Button^ button1;
- private: System::Windows::Forms::Button^ button2;
- private: System::Windows::Forms::Button^ button3;
- private: System::Windows::Forms::Button^ button6;
- private: System::Windows::Forms::Button^ button7;
- private: System::Windows::Forms::Button^ button8;
- private: System::Windows::Forms::Button^ button_09;
- private: System::Windows::Forms::Button^ button_08;
- private: System::Windows::Forms::Button^ button_07;
- private: System::Windows::Forms::Button^ button_01;
- private: System::Windows::Forms::Button^ button_02;
- private: System::Windows::Forms::Button^ button_03;
- private: System::Windows::Forms::Button^ button_06;
- private: System::Windows::Forms::Button^ button_05;
- private: System::Windows::Forms::Button^ button_04;
- private: System::Windows::Forms::Button^ button_00;
- private: System::Windows::Forms::Label^ label1;
- private: System::Windows::Forms::Button^ button19;
- private: System::Windows::Forms::Button^ button20;
- private: System::Windows::Forms::Button^ button21;
- private: System::Windows::Forms::Button^ button22;
- private: System::Windows::Forms::PictureBox^ pictureBox1;
- private: System::Windows::Forms::Button^ button23;
- private: System::Windows::Forms::Button^ button24;
- private: System::ComponentModel::IContainer^ components;
- protected:
- protected:
- private:
- /// <summary>
- /// Обязательная переменная конструктора.
- /// </summary>
- #pragma region Windows Form Designer generated code
- /// <summary>
- /// Требуемый метод для поддержки конструктора — не изменяйте
- /// содержимое этого метода с помощью редактора кода.
- /// </summary>
- void InitializeComponent(void)
- {
- this->components = (gcnew System::ComponentModel::Container());
- System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid));
- this->button1 = (gcnew System::Windows::Forms::Button());
- this->button2 = (gcnew System::Windows::Forms::Button());
- this->button3 = (gcnew System::Windows::Forms::Button());
- this->button6 = (gcnew System::Windows::Forms::Button());
- this->button7 = (gcnew System::Windows::Forms::Button());
- this->button8 = (gcnew System::Windows::Forms::Button());
- this->button_09 = (gcnew System::Windows::Forms::Button());
- this->button_08 = (gcnew System::Windows::Forms::Button());
- this->button_07 = (gcnew System::Windows::Forms::Button());
- this->button_01 = (gcnew System::Windows::Forms::Button());
- this->button_02 = (gcnew System::Windows::Forms::Button());
- this->button_03 = (gcnew System::Windows::Forms::Button());
- this->button_06 = (gcnew System::Windows::Forms::Button());
- this->button_05 = (gcnew System::Windows::Forms::Button());
- this->button_04 = (gcnew System::Windows::Forms::Button());
- this->button_00 = (gcnew System::Windows::Forms::Button());
- this->label1 = (gcnew System::Windows::Forms::Label());
- this->button19 = (gcnew System::Windows::Forms::Button());
- this->button20 = (gcnew System::Windows::Forms::Button());
- this->button21 = (gcnew System::Windows::Forms::Button());
- this->button22 = (gcnew System::Windows::Forms::Button());
- this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
- this->button23 = (gcnew System::Windows::Forms::Button());
- this->button24 = (gcnew System::Windows::Forms::Button());
- this->flowLayoutPanel1 = (gcnew System::Windows::Forms::FlowLayoutPanel());
- this->buttonBalance = (gcnew System::Windows::Forms::Button());
- this->buttonGiveMoney = (gcnew System::Windows::Forms::Button());
- this->buttonExit = (gcnew System::Windows::Forms::Button());
- this->buttonMoney500 = (gcnew System::Windows::Forms::Button());
- this->buttonMoney50 = (gcnew System::Windows::Forms::Button());
- this->buttonMoney250 = (gcnew System::Windows::Forms::Button());
- this->buttonMoney25 = (gcnew System::Windows::Forms::Button());
- this->buttonMoney100 = (gcnew System::Windows::Forms::Button());
- this->buttonMoney10 = (gcnew System::Windows::Forms::Button());
- this->imageList_Картоприемник = (gcnew System::Windows::Forms::ImageList(this->components));
- this->imageListВыдачаДенег = (gcnew System::Windows::Forms::ImageList(this->components));
- (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->BeginInit();
- this->flowLayoutPanel1->SuspendLayout();
- this->SuspendLayout();
- //
- // button1
- //
- this->button1->Location = System::Drawing::Point(27, 43);
- this->button1->Margin = System::Windows::Forms::Padding(2);
- this->button1->Name = L"button1";
- this->button1->Size = System::Drawing::Size(35, 30);
- this->button1->TabIndex = 0;
- this->button1->Text = L">";
- this->button1->UseVisualStyleBackColor = true;
- this->button1->Click += gcnew System::EventHandler(this, &MyForm::button1_Click);
- //
- // button2
- //
- this->button2->Location = System::Drawing::Point(27, 77);
- this->button2->Margin = System::Windows::Forms::Padding(2);
- this->button2->Name = L"button2";
- this->button2->Size = System::Drawing::Size(35, 30);
- this->button2->TabIndex = 1;
- this->button2->Text = L">";
- this->button2->UseVisualStyleBackColor = true;
- this->button2->Click += gcnew System::EventHandler(this, &MyForm::button2_Click);
- //
- // button3
- //
- this->button3->Location = System::Drawing::Point(27, 111);
- this->button3->Margin = System::Windows::Forms::Padding(2);
- this->button3->Name = L"button3";
- this->button3->Size = System::Drawing::Size(35, 30);
- this->button3->TabIndex = 2;
- this->button3->Text = L">";
- this->button3->UseVisualStyleBackColor = true;
- this->button3->Click += gcnew System::EventHandler(this, &MyForm::button3_Click);
- //
- // button6
- //
- this->button6->Location = System::Drawing::Point(298, 111);
- this->button6->Margin = System::Windows::Forms::Padding(2);
- this->button6->Name = L"button6";
- this->button6->Size = System::Drawing::Size(35, 30);
- this->button6->TabIndex = 6;
- this->button6->Text = L"<";
- this->button6->UseVisualStyleBackColor = true;
- this->button6->Click += gcnew System::EventHandler(this, &MyForm::button6_Click);
- //
- // button7
- //
- this->button7->Location = System::Drawing::Point(298, 77);
- this->button7->Margin = System::Windows::Forms::Padding(2);
- this->button7->Name = L"button7";
- this->button7->Size = System::Drawing::Size(35, 30);
- this->button7->TabIndex = 5;
- this->button7->Text = L"<";
- this->button7->UseVisualStyleBackColor = true;
- this->button7->Click += gcnew System::EventHandler(this, &MyForm::button7_Click);
- //
- // button8
- //
- this->button8->Location = System::Drawing::Point(298, 42);
- this->button8->Margin = System::Windows::Forms::Padding(2);
- this->button8->Name = L"button8";
- this->button8->Size = System::Drawing::Size(35, 30);
- this->button8->TabIndex = 4;
- this->button8->Text = L"<";
- this->button8->UseVisualStyleBackColor = true;
- this->button8->Click += gcnew System::EventHandler(this, &MyForm::button8_Click);
- //
- // button_09
- //
- this->button_09->Location = System::Drawing::Point(158, 270);
- this->button_09->Margin = System::Windows::Forms::Padding(2);
- this->button_09->Name = L"button_09";
- this->button_09->Size = System::Drawing::Size(35, 30);
- this->button_09->TabIndex = 16;
- this->button_09->Text = L"9";
- this->button_09->UseVisualStyleBackColor = true;
- this->button_09->Click += gcnew System::EventHandler(this, &MyForm::button9_Click);
- //
- // button_08
- //
- this->button_08->Location = System::Drawing::Point(120, 270);
- this->button_08->Margin = System::Windows::Forms::Padding(2);
- this->button_08->Name = L"button_08";
- this->button_08->Size = System::Drawing::Size(35, 30);
- this->button_08->TabIndex = 15;
- this->button_08->Text = L"8";
- this->button_08->UseVisualStyleBackColor = true;
- this->button_08->Click += gcnew System::EventHandler(this, &MyForm::button10_Click);
- //
- // button_07
- //
- this->button_07->Location = System::Drawing::Point(80, 270);
- this->button_07->Margin = System::Windows::Forms::Padding(2);
- this->button_07->Name = L"button_07";
- this->button_07->Size = System::Drawing::Size(35, 30);
- this->button_07->TabIndex = 14;
- this->button_07->Text = L"7";
- this->button_07->UseVisualStyleBackColor = true;
- this->button_07->Click += gcnew System::EventHandler(this, &MyForm::button11_Click);
- //
- // button_01
- //
- this->button_01->Location = System::Drawing::Point(80, 202);
- this->button_01->Margin = System::Windows::Forms::Padding(2);
- this->button_01->Name = L"button_01";
- this->button_01->Size = System::Drawing::Size(35, 30);
- this->button_01->TabIndex = 8;
- this->button_01->Text = L"1";
- this->button_01->UseVisualStyleBackColor = true;
- this->button_01->Click += gcnew System::EventHandler(this, &MyForm::button12_Click);
- //
- // button_02
- //
- this->button_02->Location = System::Drawing::Point(119, 202);
- this->button_02->Margin = System::Windows::Forms::Padding(2);
- this->button_02->Name = L"button_02";
- this->button_02->Size = System::Drawing::Size(35, 30);
- this->button_02->TabIndex = 9;
- this->button_02->Text = L"2";
- this->button_02->UseVisualStyleBackColor = true;
- this->button_02->Click += gcnew System::EventHandler(this, &MyForm::button13_Click);
- //
- // button_03
- //
- this->button_03->Location = System::Drawing::Point(158, 202);
- this->button_03->Margin = System::Windows::Forms::Padding(2);
- this->button_03->Name = L"button_03";
- this->button_03->Size = System::Drawing::Size(35, 30);
- this->button_03->TabIndex = 10;
- this->button_03->Text = L"3";
- this->button_03->UseVisualStyleBackColor = true;
- this->button_03->Click += gcnew System::EventHandler(this, &MyForm::button14_Click);
- //
- // button_06
- //
- this->button_06->Location = System::Drawing::Point(158, 236);
- this->button_06->Margin = System::Windows::Forms::Padding(2);
- this->button_06->Name = L"button_06";
- this->button_06->Size = System::Drawing::Size(35, 30);
- this->button_06->TabIndex = 13;
- this->button_06->Text = L"6";
- this->button_06->UseVisualStyleBackColor = true;
- this->button_06->Click += gcnew System::EventHandler(this, &MyForm::button15_Click);
- //
- // button_05
- //
- this->button_05->Location = System::Drawing::Point(119, 236);
- this->button_05->Margin = System::Windows::Forms::Padding(2);
- this->button_05->Name = L"button_05";
- this->button_05->Size = System::Drawing::Size(35, 30);
- this->button_05->TabIndex = 12;
- this->button_05->Text = L"5";
- this->button_05->UseVisualStyleBackColor = true;
- this->button_05->Click += gcnew System::EventHandler(this, &MyForm::button16_Click);
- //
- // button_04
- //
- this->button_04->Location = System::Drawing::Point(80, 236);
- this->button_04->Margin = System::Windows::Forms::Padding(2);
- this->button_04->Name = L"button_04";
- this->button_04->Size = System::Drawing::Size(35, 30);
- this->button_04->TabIndex = 11;
- this->button_04->Text = L"4";
- this->button_04->UseVisualStyleBackColor = true;
- this->button_04->Click += gcnew System::EventHandler(this, &MyForm::button17_Click);
- //
- // button_00
- //
- this->button_00->Location = System::Drawing::Point(119, 304);
- this->button_00->Margin = System::Windows::Forms::Padding(2);
- this->button_00->Name = L"button_00";
- this->button_00->Size = System::Drawing::Size(35, 30);
- this->button_00->TabIndex = 17;
- this->button_00->Text = L"0";
- this->button_00->UseVisualStyleBackColor = true;
- this->button_00->Click += gcnew System::EventHandler(this, &MyForm::button18_Click);
- //
- // label1
- //
- this->label1->AutoSize = true;
- this->label1->Enabled = false;
- this->label1->Location = System::Drawing::Point(373, 21);
- this->label1->Name = L"label1";
- this->label1->Size = System::Drawing::Size(175, 19);
- this->label1->TabIndex = 30;
- this->label1->Text = L"ОАО \"БАНК РАЗВОДИЛА\"";
- //
- // button19
- //
- this->button19->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
- this->button19->Enabled = false;
- this->button19->Location = System::Drawing::Point(67, 30);
- this->button19->Name = L"button19";
- this->button19->Size = System::Drawing::Size(226, 125);
- this->button19->TabIndex = 20;
- this->button19->Text = L"Вставьте карту для начала работы";
- this->button19->UseVisualStyleBackColor = false;
- //
- // button20
- //
- this->button20->Location = System::Drawing::Point(197, 202);
- this->button20->Margin = System::Windows::Forms::Padding(2);
- this->button20->Name = L"button20";
- this->button20->Size = System::Drawing::Size(91, 30);
- this->button20->TabIndex = 18;
- this->button20->Text = L"ОТМЕНА";
- this->button20->UseVisualStyleBackColor = true;
- this->button20->Click += gcnew System::EventHandler(this, &MyForm::button20_Click);
- //
- // button21
- //
- this->button21->Location = System::Drawing::Point(197, 236);
- this->button21->Margin = System::Windows::Forms::Padding(2);
- this->button21->Name = L"button21";
- this->button21->Size = System::Drawing::Size(91, 30);
- this->button21->TabIndex = 19;
- this->button21->Text = L"СБРОС";
- this->button21->UseVisualStyleBackColor = true;
- this->button21->Click += gcnew System::EventHandler(this, &MyForm::button21_Click);
- //
- // button22
- //
- this->button22->Location = System::Drawing::Point(197, 270);
- this->button22->Margin = System::Windows::Forms::Padding(2);
- this->button22->Name = L"button22";
- this->button22->Size = System::Drawing::Size(91, 30);
- this->button22->TabIndex = 20;
- this->button22->Text = L"ВВОД";
- this->button22->UseVisualStyleBackColor = true;
- this->button22->Click += gcnew System::EventHandler(this, &MyForm::button22_Click);
- //
- // pictureBox1
- //
- this->pictureBox1->BackgroundImage = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"pictureBox1.BackgroundImage")));
- this->pictureBox1->Location = System::Drawing::Point(377, 43);
- this->pictureBox1->Name = L"pictureBox1";
- this->pictureBox1->Size = System::Drawing::Size(167, 123);
- this->pictureBox1->TabIndex = 29;
- this->pictureBox1->TabStop = false;
- //
- // button23
- //
- this->button23->BackColor = System::Drawing::Color::Gray;
- this->button23->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Stretch;
- this->button23->ImageIndex = 0;
- this->button23->ImageList = this->imageList_Картоприемник;
- this->button23->Location = System::Drawing::Point(351, 172);
- this->button23->Name = L"button23";
- this->button23->Size = System::Drawing::Size(226, 132);
- this->button23->TabIndex = 30;
- this->button23->UseVisualStyleBackColor = false;
- this->button23->Click += gcnew System::EventHandler(this, &MyForm::button23_Click);
- //
- // button24
- //
- this->button24->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
- this->button24->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Stretch;
- this->button24->ImageIndex = 0;
- this->button24->ImageList = this->imageListВыдачаДенег;
- this->button24->Location = System::Drawing::Point(351, 310);
- this->button24->Name = L"button24";
- this->button24->Size = System::Drawing::Size(226, 73);
- this->button24->TabIndex = 31;
- this->button24->UseVisualStyleBackColor = false;
- this->button24->Click += gcnew System::EventHandler(this, &MyForm::button24_Click);
- //
- // flowLayoutPanel1
- //
- this->flowLayoutPanel1->AutoSize = true;
- this->flowLayoutPanel1->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
- this->flowLayoutPanel1->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
- this->flowLayoutPanel1->Controls->Add(this->buttonBalance);
- this->flowLayoutPanel1->Controls->Add(this->buttonGiveMoney);
- this->flowLayoutPanel1->Controls->Add(this->buttonExit);
- this->flowLayoutPanel1->FlowDirection = System::Windows::Forms::FlowDirection::TopDown;
- this->flowLayoutPanel1->Location = System::Drawing::Point(109, 39);
- this->flowLayoutPanel1->Name = L"flowLayoutPanel1";
- this->flowLayoutPanel1->Size = System::Drawing::Size(137, 102);
- this->flowLayoutPanel1->TabIndex = 32;
- this->flowLayoutPanel1->Visible = false;
- //
- // buttonBalance
- //
- this->buttonBalance->AutoSize = true;
- this->buttonBalance->Enabled = false;
- this->buttonBalance->Location = System::Drawing::Point(2, 2);
- this->buttonBalance->Margin = System::Windows::Forms::Padding(2);
- this->buttonBalance->Name = L"buttonBalance";
- this->buttonBalance->Size = System::Drawing::Size(133, 30);
- this->buttonBalance->TabIndex = 33;
- this->buttonBalance->Text = L"Баланс";
- this->buttonBalance->UseVisualStyleBackColor = true;
- //
- // buttonGiveMoney
- //
- this->buttonGiveMoney->AutoSize = true;
- this->buttonGiveMoney->Enabled = false;
- this->buttonGiveMoney->Location = System::Drawing::Point(2, 36);
- this->buttonGiveMoney->Margin = System::Windows::Forms::Padding(2);
- this->buttonGiveMoney->Name = L"buttonGiveMoney";
- this->buttonGiveMoney->Size = System::Drawing::Size(133, 30);
- this->buttonGiveMoney->TabIndex = 34;
- this->buttonGiveMoney->Text = L"Выдача наличных";
- this->buttonGiveMoney->UseVisualStyleBackColor = true;
- //
- // buttonExit
- //
- this->buttonExit->AutoSize = true;
- this->buttonExit->Enabled = false;
- this->buttonExit->Location = System::Drawing::Point(2, 70);
- this->buttonExit->Margin = System::Windows::Forms::Padding(2);
- this->buttonExit->Name = L"buttonExit";
- this->buttonExit->Size = System::Drawing::Size(133, 30);
- this->buttonExit->TabIndex = 36;
- this->buttonExit->Text = L"Выход";
- this->buttonExit->UseVisualStyleBackColor = true;
- //
- // buttonMoney500
- //
- this->buttonMoney500->Enabled = false;
- this->buttonMoney500->Location = System::Drawing::Point(197, 110);
- this->buttonMoney500->Margin = System::Windows::Forms::Padding(2);
- this->buttonMoney500->Name = L"buttonMoney500";
- this->buttonMoney500->Size = System::Drawing::Size(75, 30);
- this->buttonMoney500->TabIndex = 49;
- this->buttonMoney500->Text = L"500";
- this->buttonMoney500->UseVisualStyleBackColor = true;
- this->buttonMoney500->Visible = false;
- //
- // buttonMoney50
- //
- this->buttonMoney50->Enabled = false;
- this->buttonMoney50->Location = System::Drawing::Point(99, 110);
- this->buttonMoney50->Margin = System::Windows::Forms::Padding(2);
- this->buttonMoney50->Name = L"buttonMoney50";
- this->buttonMoney50->Size = System::Drawing::Size(75, 30);
- this->buttonMoney50->TabIndex = 48;
- this->buttonMoney50->Text = L"50";
- this->buttonMoney50->UseVisualStyleBackColor = true;
- this->buttonMoney50->Visible = false;
- //
- // buttonMoney250
- //
- this->buttonMoney250->Enabled = false;
- this->buttonMoney250->Location = System::Drawing::Point(197, 75);
- this->buttonMoney250->Margin = System::Windows::Forms::Padding(2);
- this->buttonMoney250->Name = L"buttonMoney250";
- this->buttonMoney250->Size = System::Drawing::Size(75, 30);
- this->buttonMoney250->TabIndex = 47;
- this->buttonMoney250->Text = L"250";
- this->buttonMoney250->UseVisualStyleBackColor = true;
- this->buttonMoney250->Visible = false;
- //
- // buttonMoney25
- //
- this->buttonMoney25->Enabled = false;
- this->buttonMoney25->Location = System::Drawing::Point(99, 75);
- this->buttonMoney25->Margin = System::Windows::Forms::Padding(2);
- this->buttonMoney25->Name = L"buttonMoney25";
- this->buttonMoney25->Size = System::Drawing::Size(75, 30);
- this->buttonMoney25->TabIndex = 46;
- this->buttonMoney25->Text = L"25";
- this->buttonMoney25->UseVisualStyleBackColor = true;
- this->buttonMoney25->Visible = false;
- //
- // buttonMoney100
- //
- this->buttonMoney100->Enabled = false;
- this->buttonMoney100->Location = System::Drawing::Point(197, 40);
- this->buttonMoney100->Margin = System::Windows::Forms::Padding(2);
- this->buttonMoney100->Name = L"buttonMoney100";
- this->buttonMoney100->Size = System::Drawing::Size(75, 30);
- this->buttonMoney100->TabIndex = 45;
- this->buttonMoney100->Text = L"100";
- this->buttonMoney100->UseVisualStyleBackColor = true;
- this->buttonMoney100->Visible = false;
- //
- // buttonMoney10
- //
- this->buttonMoney10->Enabled = false;
- this->buttonMoney10->Location = System::Drawing::Point(99, 40);
- this->buttonMoney10->Margin = System::Windows::Forms::Padding(2);
- this->buttonMoney10->Name = L"buttonMoney10";
- this->buttonMoney10->Size = System::Drawing::Size(75, 30);
- this->buttonMoney10->TabIndex = 44;
- this->buttonMoney10->Text = L"10";
- this->buttonMoney10->UseVisualStyleBackColor = true;
- this->buttonMoney10->Visible = false;
- //
- // imageList_Картоприемник
- //
- this->imageList_Картоприемник->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageList_Картоприемник.ImageStream")));
- this->imageList_Картоприемник->TransparentColor = System::Drawing::Color::Transparent;
- this->imageList_Картоприемник->Images->SetKeyName(0, L"неткарты.jpg");
- this->imageList_Картоприемник->Images->SetKeyName(1, L"заберитекарту.jpg");
- //
- // imageListВыдачаДенег
- //
- this->imageListВыдачаДенег->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageListВыдачаДенег.ImageStream")));
- this->imageListВыдачаДенег->TransparentColor = System::Drawing::Color::Transparent;
- this->imageListВыдачаДенег->Images->SetKeyName(0, L"Пусто.jpg");
- this->imageListВыдачаДенег->Images->SetKeyName(1, L"Заберитеденьги.jpg");
- //
- // MyForm
- //
- this->AllowDrop = true;
- this->AutoScaleDimensions = System::Drawing::SizeF(7, 17);
- this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
- this->AutoValidate = System::Windows::Forms::AutoValidate::EnableAllowFocusChange;
- this->ClientSize = System::Drawing::Size(589, 389);
- this->Controls->Add(this->buttonMoney500);
- this->Controls->Add(this->buttonMoney50);
- this->Controls->Add(this->buttonMoney250);
- this->Controls->Add(this->buttonMoney25);
- this->Controls->Add(this->buttonMoney100);
- this->Controls->Add(this->buttonMoney10);
- this->Controls->Add(this->button24);
- this->Controls->Add(this->button23);
- this->Controls->Add(this->pictureBox1);
- this->Controls->Add(this->button22);
- this->Controls->Add(this->button21);
- this->Controls->Add(this->button20);
- this->Controls->Add(this->label1);
- this->Controls->Add(this->button_00);
- this->Controls->Add(this->button_06);
- this->Controls->Add(this->button_05);
- this->Controls->Add(this->button_04);
- this->Controls->Add(this->button_03);
- this->Controls->Add(this->button_09);
- this->Controls->Add(this->button_02);
- this->Controls->Add(this->button_08);
- this->Controls->Add(this->button_01);
- this->Controls->Add(this->button_07);
- this->Controls->Add(this->button6);
- this->Controls->Add(this->button7);
- this->Controls->Add(this->button8);
- this->Controls->Add(this->button3);
- this->Controls->Add(this->button2);
- this->Controls->Add(this->button1);
- this->Controls->Add(this->flowLayoutPanel1);
- this->Controls->Add(this->button19);
- this->Font = (gcnew System::Drawing::Font(L"Segoe UI", 10));
- this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"$this.Icon")));
- this->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
- this->Name = L"MyForm";
- this->Text = L"Банкомат ОАО \"БАНК РАЗВОДИЛА\"";
- this->Load += gcnew System::EventHandler(this, &MyForm::MyForm_Load);
- (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->EndInit();
- this->flowLayoutPanel1->ResumeLayout(false);
- this->flowLayoutPanel1->PerformLayout();
- this->ResumeLayout(false);
- this->PerformLayout();
- }
- #pragma endregion
- private: System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e) {
- }
- // кнопка-картинка ВСТАВИТЬ КАРТУ
- private: System::Void button23_Click(System::Object^ sender, System::EventArgs^ e) {
- switch (ATMstate) {
- case ATM_PLEASE_INPUT_CARD:
- {
- setATMstate(ATM_PLEASE_INPUT_PINCODE);
- return;
- }
- case ATM_PLEASE_TAKE_CARD_BACK:
- {
- setATMstate(ATM_PLEASE_INPUT_CARD);
- return;
- }
- }
- }
- // кнопка СБРОС
- private: System::Void button21_Click(System::Object^ sender, System::EventArgs^ e) {
- setATMstate(ATMstate);
- }
- private: void hideAllMoneyButtons() {
- this->buttonMoney10->Visible = false;
- this->buttonMoney25->Visible = false;
- this->buttonMoney50->Visible = false;
- this->buttonMoney100->Visible = false;
- this->buttonMoney250->Visible = false;
- this->buttonMoney500->Visible = false;
- }
- private: void InputPINCODE(int number) {
- if (!isInputPINCODEScreeen)
- return;
- if (number >= 0)
- {
- if (ATMinput->Length == 4)
- return;
- ATMinput += number.ToString();
- }
- int len = 4 - ATMinput->Length;
- this->button19->Text = L"Введите ПИНКОД\n" + ATMinput;
- for (int i = 0; i < len; i++)
- this->button19->Text += " _";
- }
- private: void Button1() {
- if (ATMstate == ATM_MENU)
- {
- setATMstate(ATM_MENU_BALANCE);
- return;
- }
- if (ATMstate == ATM_MENU_TAKE_MONEY && this->buttonMoney10->Visible == true)
- {
- TakeMoney = 10;
- setATMstate(ATM_MENU_TAKE_MONEY_INPUT_PINCODE);
- return;
- }
- }
- private: void Button2() {
- if (ATMstate == ATM_MENU)
- {
- setATMstate(ATM_MENU_TAKE_MONEY);
- return;
- }
- if (ATMstate == ATM_MENU_TAKE_MONEY && this->buttonMoney25->Visible == true)
- {
- TakeMoney = 25;
- setATMstate(ATM_MENU_TAKE_MONEY_INPUT_PINCODE);
- return;
- }
- }
- private: void Button3() {
- if (ATMstate == ATM_MENU)
- {
- setATMstate(ATM_PLEASE_TAKE_CARD_BACK);
- return;
- }
- if (ATMstate == ATM_MENU_TAKE_MONEY && this->buttonMoney50->Visible == true)
- {
- TakeMoney = 50;
- setATMstate(ATM_MENU_TAKE_MONEY_INPUT_PINCODE);
- return;
- }
- }
- private: void Button4() {
- if (ATMstate == ATM_MENU)
- {
- setATMstate(ATM_MENU_BALANCE);
- return;
- }
- if (ATMstate == ATM_MENU_TAKE_MONEY && this->buttonMoney100->Visible == true)
- {
- TakeMoney = 100;
- setATMstate(ATM_MENU_TAKE_MONEY_INPUT_PINCODE);
- return;
- }
- }
- private: void Button5() {
- if (ATMstate == ATM_MENU)
- {
- setATMstate(ATM_MENU_TAKE_MONEY);
- return;
- }
- if (ATMstate == ATM_MENU_TAKE_MONEY && this->buttonMoney250->Visible == true)
- {
- TakeMoney = 250;
- setATMstate(ATM_MENU_TAKE_MONEY_INPUT_PINCODE);
- return;
- }
- }
- private: void Button6() {
- if (ATMstate == ATM_MENU)
- {
- setATMstate(ATM_PLEASE_TAKE_CARD_BACK);
- return;
- }
- if (ATMstate == ATM_MENU_TAKE_MONEY && this->buttonMoney500->Visible == true)
- {
- TakeMoney = 500;
- setATMstate(ATM_MENU_TAKE_MONEY_INPUT_PINCODE);
- return;
- }
- }
- private: void setATMstate(int state) {
- ATMinput = "";
- ATMstate = state;
- hideAllMoneyButtons();
- this->button23->ImageIndex = 0;
- this->button24->ImageIndex = 0;
- switch (ATMstate)
- {
- case ATM_PLEASE_INPUT_CARD:
- {
- this->flowLayoutPanel1->Visible = false;
- this->button19->Text = L"Вставьте карту для начала работы";
- return;
- }
- case ATM_PLEASE_INPUT_PINCODE:
- {
- this->flowLayoutPanel1->Visible = false;
- this->button19->Text = L"Введите ПИНКОД\n_ _ _ _";
- return;
- }
- case ATM_MENU:
- {
- this->button19->Text = L"";
- this->flowLayoutPanel1->Visible = true;
- return;
- }
- case ATM_PLEASE_TAKE_CARD_BACK:
- {
- this->flowLayoutPanel1->Visible = false;
- this->button19->Text = L"Заберите карту!";
- this->button23->ImageIndex = 1;
- return;
- }
- case ATM_MENU_BALANCE:
- {
- this->flowLayoutPanel1->Visible = false;
- this->button19->Text = L"Текущий баланс: " + CardBalance + " BYN";
- return;
- }
- case ATM_MENU_TAKE_MONEY:
- {
- this->flowLayoutPanel1->Visible = false;
- if (CardBalance < 10)
- {
- this->button19->Text = L"Недостаточно средств для вывода!";
- return;
- }
- this->buttonMoney10->Visible = true;
- if (CardBalance < 25)
- return;
- this->buttonMoney25->Visible = true;
- if (CardBalance < 50)
- return;
- this->buttonMoney50->Visible = true;
- if (CardBalance < 100)
- return;
- this->buttonMoney100->Visible = true;
- if (CardBalance < 250)
- return;
- this->buttonMoney250->Visible = true;
- if (CardBalance < 500)
- return;
- this->buttonMoney500->Visible = true;
- return;
- }
- case ATM_MENU_TAKE_MONEY_INPUT_PINCODE:
- {
- this->flowLayoutPanel1->Visible = false;
- this->button19->Text = L"Введите ПИНКОД\n_ _ _ _";
- return;
- }
- case ATM_MENU_TAKE_MONEY_SUCCESS:
- {
- this->flowLayoutPanel1->Visible = false;
- this->button19->Text = L"Заберите деньги!";
- this->button24->ImageIndex = 1;
- return;
- }
- }
- }
- // Кнопки 1-9,0
- private: System::Void button12_Click(System::Object^ sender, System::EventArgs^ e) {
- InputPINCODE(1);
- }
- private: System::Void button13_Click(System::Object^ sender, System::EventArgs^ e) {
- InputPINCODE(2);
- }
- private: System::Void button14_Click(System::Object^ sender, System::EventArgs^ e) {
- InputPINCODE(3);
- }
- private: System::Void button17_Click(System::Object^ sender, System::EventArgs^ e) {
- InputPINCODE(4);
- }
- private: System::Void button16_Click(System::Object^ sender, System::EventArgs^ e) {
- InputPINCODE(5);
- }
- private: System::Void button15_Click(System::Object^ sender, System::EventArgs^ e) {
- InputPINCODE(6);
- }
- private: System::Void button11_Click(System::Object^ sender, System::EventArgs^ e) {
- InputPINCODE(7);
- }
- private: System::Void button10_Click(System::Object^ sender, System::EventArgs^ e) {
- InputPINCODE(8);
- }
- private: System::Void button9_Click(System::Object^ sender, System::EventArgs^ e) {
- InputPINCODE(9);
- }
- private: System::Void button18_Click(System::Object^ sender, System::EventArgs^ e) {
- InputPINCODE(0);
- }
- // Кнопка ОТМЕНА
- private: System::Void button20_Click(System::Object^ sender, System::EventArgs^ e) {
- if (isInputPINCODEScreeen)
- {
- if (ATMinput->Length == 0)
- return;
- ATMinput = ATMinput->Substring(0, ATMinput->Length - 1);
- InputPINCODE(-1);
- return;
- }
- if (ATMstate == ATM_MENU_BALANCE || ATMstate == ATM_MENU_TAKE_MONEY)
- setATMstate(ATM_MENU);
- }
- // Кнопка ВВОД
- private: System::Void button22_Click(System::Object^ sender, System::EventArgs^ e) {
- if (isInputPINCODEScreeen)
- {
- if (ATMinput != CARD_PINCODE)
- {
- this->button19->Text = L"ПИНКОД введён неверно!";
- ATMinput = "";
- return;
- }
- if (ATMstate == ATM_PLEASE_INPUT_PINCODE)
- setATMstate(ATM_MENU);
- if (ATMstate == ATM_MENU_TAKE_MONEY_INPUT_PINCODE)
- {
- CardBalance -= TakeMoney;
- setATMstate(ATM_MENU_TAKE_MONEY_SUCCESS);
- }
- }
- }
- private: System::Void button24_Click(System::Object^ sender, System::EventArgs^ e) {
- if (ATMstate == ATM_MENU_TAKE_MONEY_SUCCESS)
- setATMstate(ATM_MENU);
- }
- private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
- Button1();
- }
- private: System::Void button8_Click(System::Object^ sender, System::EventArgs^ e) {
- Button4();
- }
- private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
- Button2();
- }
- private: System::Void button7_Click(System::Object^ sender, System::EventArgs^ e) {
- Button5();
- }
- private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
- Button3();
- }
- private: System::Void button6_Click(System::Object^ sender, System::EventArgs^ e) {
- Button6();
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment