4DM3M

Jul_curs

Jun 9th, 2021
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 34.48 KB | None | 0 0
  1. #pragma once
  2. #define ATM_PLEASE_INPUT_CARD             0
  3. #define ATM_PLEASE_INPUT_PINCODE          1
  4. #define ATM_MENU                          2
  5. #define ATM_PLEASE_TAKE_CARD_BACK         3
  6. #define ATM_MENU_BALANCE                  4
  7. #define ATM_MENU_TAKE_MONEY               5
  8. #define ATM_MENU_TAKE_MONEY_INPUT_PINCODE 6
  9. #define ATM_MENU_TAKE_MONEY_SUCCESS       7
  10. #define CARD_PINCODE "1234"
  11. #define isInputPINCODEScreeen (ATMstate == ATM_PLEASE_INPUT_PINCODE || ATMstate == ATM_MENU_TAKE_MONEY_INPUT_PINCODE)
  12. using namespace std;
  13. namespace CourseProject {
  14.     using namespace System;
  15.     using namespace System::ComponentModel;
  16.     using namespace System::Collections;
  17.     using namespace System::Windows::Forms;
  18.     using namespace System::Data;
  19.     using namespace System::Drawing;
  20.  
  21.  
  22.     /// <summary>
  23.     /// Сводка для MyForm
  24.     /// </summary>
  25.     public ref class MyForm : public System::Windows::Forms::Form
  26.     {
  27.     protected: int ATMstate = ATM_PLEASE_INPUT_CARD;
  28.     protected: int CardBalance = 500;
  29.     protected: int TakeMoney = 0;
  30.              
  31.     private: System::Windows::Forms::FlowLayoutPanel^ flowLayoutPanel1;
  32.     private: System::Windows::Forms::Button^ buttonBalance;
  33.     private: System::Windows::Forms::Button^ buttonGiveMoney;
  34.     protected:
  35.  
  36.  
  37.     private: System::Windows::Forms::Button^ buttonExit;
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.     private: System::Windows::Forms::Button^ buttonMoney500;
  46.     private: System::Windows::Forms::Button^ buttonMoney50;
  47.     private: System::Windows::Forms::Button^ buttonMoney250;
  48.     private: System::Windows::Forms::Button^ buttonMoney25;
  49.     private: System::Windows::Forms::Button^ buttonMoney100;
  50.     private: System::Windows::Forms::Button^ buttonMoney10;
  51.     private: System::Windows::Forms::ImageList^ imageList_Картоприемник;
  52.     private: System::Windows::Forms::ImageList^ imageListВыдачаДенег;
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.     protected:
  61.     protected: System::String^ ATMinput = "";
  62.     public:
  63.         MyForm(void)
  64.         {
  65.             InitializeComponent();
  66.             //
  67.             //TODO: добавьте код конструктора
  68.             //
  69.         }
  70.  
  71.     protected:
  72.         /// <summary>
  73.         /// Освободить все используемые ресурсы.
  74.         /// </summary>
  75.         ~MyForm()
  76.         {
  77.             if (components)
  78.             {
  79.                 delete components;
  80.             }
  81.         }
  82.  
  83.     protected:
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.     private: System::Windows::Forms::Button^ button1;
  91.     private: System::Windows::Forms::Button^ button2;
  92.     private: System::Windows::Forms::Button^ button3;
  93.  
  94.  
  95.     private: System::Windows::Forms::Button^ button6;
  96.     private: System::Windows::Forms::Button^ button7;
  97.     private: System::Windows::Forms::Button^ button8;
  98.     private: System::Windows::Forms::Button^ button_09;
  99.  
  100.     private: System::Windows::Forms::Button^ button_08;
  101.  
  102.     private: System::Windows::Forms::Button^ button_07;
  103.  
  104.     private: System::Windows::Forms::Button^ button_01;
  105.     private: System::Windows::Forms::Button^ button_02;
  106.     private: System::Windows::Forms::Button^ button_03;
  107.     private: System::Windows::Forms::Button^ button_06;
  108.  
  109.  
  110.  
  111.  
  112.     private: System::Windows::Forms::Button^ button_05;
  113.  
  114.     private: System::Windows::Forms::Button^ button_04;
  115.     private: System::Windows::Forms::Button^ button_00;
  116.  
  117.  
  118.     private: System::Windows::Forms::Label^ label1;
  119.     private: System::Windows::Forms::Button^ button19;
  120.     private: System::Windows::Forms::Button^ button20;
  121.     private: System::Windows::Forms::Button^ button21;
  122.     private: System::Windows::Forms::Button^ button22;
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.     private: System::Windows::Forms::PictureBox^ pictureBox1;
  135.     private: System::Windows::Forms::Button^ button23;
  136.     private: System::Windows::Forms::Button^ button24;
  137.  
  138.  
  139.  
  140.  
  141.     private: System::ComponentModel::IContainer^ components;
  142.  
  143.  
  144.     protected:
  145.  
  146.  
  147.  
  148.  
  149.     protected:
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.     private:
  158.         /// <summary>
  159.         /// Обязательная переменная конструктора.
  160.         /// </summary>
  161.  
  162.  
  163. #pragma region Windows Form Designer generated code
  164.         /// <summary>
  165.         /// Требуемый метод для поддержки конструктора — не изменяйте
  166.         /// содержимое этого метода с помощью редактора кода.
  167.         /// </summary>
  168.         void InitializeComponent(void)
  169.         {
  170.             this->components = (gcnew System::ComponentModel::Container());
  171.             System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid));
  172.             this->button1 = (gcnew System::Windows::Forms::Button());
  173.             this->button2 = (gcnew System::Windows::Forms::Button());
  174.             this->button3 = (gcnew System::Windows::Forms::Button());
  175.             this->button6 = (gcnew System::Windows::Forms::Button());
  176.             this->button7 = (gcnew System::Windows::Forms::Button());
  177.             this->button8 = (gcnew System::Windows::Forms::Button());
  178.             this->button_09 = (gcnew System::Windows::Forms::Button());
  179.             this->button_08 = (gcnew System::Windows::Forms::Button());
  180.             this->button_07 = (gcnew System::Windows::Forms::Button());
  181.             this->button_01 = (gcnew System::Windows::Forms::Button());
  182.             this->button_02 = (gcnew System::Windows::Forms::Button());
  183.             this->button_03 = (gcnew System::Windows::Forms::Button());
  184.             this->button_06 = (gcnew System::Windows::Forms::Button());
  185.             this->button_05 = (gcnew System::Windows::Forms::Button());
  186.             this->button_04 = (gcnew System::Windows::Forms::Button());
  187.             this->button_00 = (gcnew System::Windows::Forms::Button());
  188.             this->label1 = (gcnew System::Windows::Forms::Label());
  189.             this->button19 = (gcnew System::Windows::Forms::Button());
  190.             this->button20 = (gcnew System::Windows::Forms::Button());
  191.             this->button21 = (gcnew System::Windows::Forms::Button());
  192.             this->button22 = (gcnew System::Windows::Forms::Button());
  193.             this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
  194.             this->button23 = (gcnew System::Windows::Forms::Button());
  195.             this->button24 = (gcnew System::Windows::Forms::Button());
  196.             this->flowLayoutPanel1 = (gcnew System::Windows::Forms::FlowLayoutPanel());
  197.             this->buttonBalance = (gcnew System::Windows::Forms::Button());
  198.             this->buttonGiveMoney = (gcnew System::Windows::Forms::Button());
  199.             this->buttonExit = (gcnew System::Windows::Forms::Button());
  200.             this->buttonMoney500 = (gcnew System::Windows::Forms::Button());
  201.             this->buttonMoney50 = (gcnew System::Windows::Forms::Button());
  202.             this->buttonMoney250 = (gcnew System::Windows::Forms::Button());
  203.             this->buttonMoney25 = (gcnew System::Windows::Forms::Button());
  204.             this->buttonMoney100 = (gcnew System::Windows::Forms::Button());
  205.             this->buttonMoney10 = (gcnew System::Windows::Forms::Button());
  206.             this->imageList_Картоприемник = (gcnew System::Windows::Forms::ImageList(this->components));
  207.             this->imageListВыдачаДенег = (gcnew System::Windows::Forms::ImageList(this->components));
  208.             (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->BeginInit();
  209.             this->flowLayoutPanel1->SuspendLayout();
  210.             this->SuspendLayout();
  211.             //
  212.             // button1
  213.             //
  214.             this->button1->Location = System::Drawing::Point(27, 43);
  215.             this->button1->Margin = System::Windows::Forms::Padding(2);
  216.             this->button1->Name = L"button1";
  217.             this->button1->Size = System::Drawing::Size(35, 30);
  218.             this->button1->TabIndex = 0;
  219.             this->button1->Text = L">";
  220.             this->button1->UseVisualStyleBackColor = true;
  221.             this->button1->Click += gcnew System::EventHandler(this, &MyForm::button1_Click);
  222.             //
  223.             // button2
  224.             //
  225.             this->button2->Location = System::Drawing::Point(27, 77);
  226.             this->button2->Margin = System::Windows::Forms::Padding(2);
  227.             this->button2->Name = L"button2";
  228.             this->button2->Size = System::Drawing::Size(35, 30);
  229.             this->button2->TabIndex = 1;
  230.             this->button2->Text = L">";
  231.             this->button2->UseVisualStyleBackColor = true;
  232.             this->button2->Click += gcnew System::EventHandler(this, &MyForm::button2_Click);
  233.             //
  234.             // button3
  235.             //
  236.             this->button3->Location = System::Drawing::Point(27, 111);
  237.             this->button3->Margin = System::Windows::Forms::Padding(2);
  238.             this->button3->Name = L"button3";
  239.             this->button3->Size = System::Drawing::Size(35, 30);
  240.             this->button3->TabIndex = 2;
  241.             this->button3->Text = L">";
  242.             this->button3->UseVisualStyleBackColor = true;
  243.             this->button3->Click += gcnew System::EventHandler(this, &MyForm::button3_Click);
  244.             //
  245.             // button6
  246.             //
  247.             this->button6->Location = System::Drawing::Point(298, 111);
  248.             this->button6->Margin = System::Windows::Forms::Padding(2);
  249.             this->button6->Name = L"button6";
  250.             this->button6->Size = System::Drawing::Size(35, 30);
  251.             this->button6->TabIndex = 6;
  252.             this->button6->Text = L"<";
  253.             this->button6->UseVisualStyleBackColor = true;
  254.             this->button6->Click += gcnew System::EventHandler(this, &MyForm::button6_Click);
  255.             //
  256.             // button7
  257.             //
  258.             this->button7->Location = System::Drawing::Point(298, 77);
  259.             this->button7->Margin = System::Windows::Forms::Padding(2);
  260.             this->button7->Name = L"button7";
  261.             this->button7->Size = System::Drawing::Size(35, 30);
  262.             this->button7->TabIndex = 5;
  263.             this->button7->Text = L"<";
  264.             this->button7->UseVisualStyleBackColor = true;
  265.             this->button7->Click += gcnew System::EventHandler(this, &MyForm::button7_Click);
  266.             //
  267.             // button8
  268.             //
  269.             this->button8->Location = System::Drawing::Point(298, 42);
  270.             this->button8->Margin = System::Windows::Forms::Padding(2);
  271.             this->button8->Name = L"button8";
  272.             this->button8->Size = System::Drawing::Size(35, 30);
  273.             this->button8->TabIndex = 4;
  274.             this->button8->Text = L"<";
  275.             this->button8->UseVisualStyleBackColor = true;
  276.             this->button8->Click += gcnew System::EventHandler(this, &MyForm::button8_Click);
  277.             //
  278.             // button_09
  279.             //
  280.             this->button_09->Location = System::Drawing::Point(158, 270);
  281.             this->button_09->Margin = System::Windows::Forms::Padding(2);
  282.             this->button_09->Name = L"button_09";
  283.             this->button_09->Size = System::Drawing::Size(35, 30);
  284.             this->button_09->TabIndex = 16;
  285.             this->button_09->Text = L"9";
  286.             this->button_09->UseVisualStyleBackColor = true;
  287.             this->button_09->Click += gcnew System::EventHandler(this, &MyForm::button9_Click);
  288.             //
  289.             // button_08
  290.             //
  291.             this->button_08->Location = System::Drawing::Point(120, 270);
  292.             this->button_08->Margin = System::Windows::Forms::Padding(2);
  293.             this->button_08->Name = L"button_08";
  294.             this->button_08->Size = System::Drawing::Size(35, 30);
  295.             this->button_08->TabIndex = 15;
  296.             this->button_08->Text = L"8";
  297.             this->button_08->UseVisualStyleBackColor = true;
  298.             this->button_08->Click += gcnew System::EventHandler(this, &MyForm::button10_Click);
  299.             //
  300.             // button_07
  301.             //
  302.             this->button_07->Location = System::Drawing::Point(80, 270);
  303.             this->button_07->Margin = System::Windows::Forms::Padding(2);
  304.             this->button_07->Name = L"button_07";
  305.             this->button_07->Size = System::Drawing::Size(35, 30);
  306.             this->button_07->TabIndex = 14;
  307.             this->button_07->Text = L"7";
  308.             this->button_07->UseVisualStyleBackColor = true;
  309.             this->button_07->Click += gcnew System::EventHandler(this, &MyForm::button11_Click);
  310.             //
  311.             // button_01
  312.             //
  313.             this->button_01->Location = System::Drawing::Point(80, 202);
  314.             this->button_01->Margin = System::Windows::Forms::Padding(2);
  315.             this->button_01->Name = L"button_01";
  316.             this->button_01->Size = System::Drawing::Size(35, 30);
  317.             this->button_01->TabIndex = 8;
  318.             this->button_01->Text = L"1";
  319.             this->button_01->UseVisualStyleBackColor = true;
  320.             this->button_01->Click += gcnew System::EventHandler(this, &MyForm::button12_Click);
  321.             //
  322.             // button_02
  323.             //
  324.             this->button_02->Location = System::Drawing::Point(119, 202);
  325.             this->button_02->Margin = System::Windows::Forms::Padding(2);
  326.             this->button_02->Name = L"button_02";
  327.             this->button_02->Size = System::Drawing::Size(35, 30);
  328.             this->button_02->TabIndex = 9;
  329.             this->button_02->Text = L"2";
  330.             this->button_02->UseVisualStyleBackColor = true;
  331.             this->button_02->Click += gcnew System::EventHandler(this, &MyForm::button13_Click);
  332.             //
  333.             // button_03
  334.             //
  335.             this->button_03->Location = System::Drawing::Point(158, 202);
  336.             this->button_03->Margin = System::Windows::Forms::Padding(2);
  337.             this->button_03->Name = L"button_03";
  338.             this->button_03->Size = System::Drawing::Size(35, 30);
  339.             this->button_03->TabIndex = 10;
  340.             this->button_03->Text = L"3";
  341.             this->button_03->UseVisualStyleBackColor = true;
  342.             this->button_03->Click += gcnew System::EventHandler(this, &MyForm::button14_Click);
  343.             //
  344.             // button_06
  345.             //
  346.             this->button_06->Location = System::Drawing::Point(158, 236);
  347.             this->button_06->Margin = System::Windows::Forms::Padding(2);
  348.             this->button_06->Name = L"button_06";
  349.             this->button_06->Size = System::Drawing::Size(35, 30);
  350.             this->button_06->TabIndex = 13;
  351.             this->button_06->Text = L"6";
  352.             this->button_06->UseVisualStyleBackColor = true;
  353.             this->button_06->Click += gcnew System::EventHandler(this, &MyForm::button15_Click);
  354.             //
  355.             // button_05
  356.             //
  357.             this->button_05->Location = System::Drawing::Point(119, 236);
  358.             this->button_05->Margin = System::Windows::Forms::Padding(2);
  359.             this->button_05->Name = L"button_05";
  360.             this->button_05->Size = System::Drawing::Size(35, 30);
  361.             this->button_05->TabIndex = 12;
  362.             this->button_05->Text = L"5";
  363.             this->button_05->UseVisualStyleBackColor = true;
  364.             this->button_05->Click += gcnew System::EventHandler(this, &MyForm::button16_Click);
  365.             //
  366.             // button_04
  367.             //
  368.             this->button_04->Location = System::Drawing::Point(80, 236);
  369.             this->button_04->Margin = System::Windows::Forms::Padding(2);
  370.             this->button_04->Name = L"button_04";
  371.             this->button_04->Size = System::Drawing::Size(35, 30);
  372.             this->button_04->TabIndex = 11;
  373.             this->button_04->Text = L"4";
  374.             this->button_04->UseVisualStyleBackColor = true;
  375.             this->button_04->Click += gcnew System::EventHandler(this, &MyForm::button17_Click);
  376.             //
  377.             // button_00
  378.             //
  379.             this->button_00->Location = System::Drawing::Point(119, 304);
  380.             this->button_00->Margin = System::Windows::Forms::Padding(2);
  381.             this->button_00->Name = L"button_00";
  382.             this->button_00->Size = System::Drawing::Size(35, 30);
  383.             this->button_00->TabIndex = 17;
  384.             this->button_00->Text = L"0";
  385.             this->button_00->UseVisualStyleBackColor = true;
  386.             this->button_00->Click += gcnew System::EventHandler(this, &MyForm::button18_Click);
  387.             //
  388.             // label1
  389.             //
  390.             this->label1->AutoSize = true;
  391.             this->label1->Enabled = false;
  392.             this->label1->Location = System::Drawing::Point(373, 21);
  393.             this->label1->Name = L"label1";
  394.             this->label1->Size = System::Drawing::Size(175, 19);
  395.             this->label1->TabIndex = 30;
  396.             this->label1->Text = L"ОАО \"БАНК РАЗВОДИЛА\"";
  397.             //
  398.             // button19
  399.             //
  400.             this->button19->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
  401.             this->button19->Enabled = false;
  402.             this->button19->Location = System::Drawing::Point(67, 30);
  403.             this->button19->Name = L"button19";
  404.             this->button19->Size = System::Drawing::Size(226, 125);
  405.             this->button19->TabIndex = 20;
  406.             this->button19->Text = L"Вставьте карту для начала работы";
  407.             this->button19->UseVisualStyleBackColor = false;
  408.             //
  409.             // button20
  410.             //
  411.             this->button20->Location = System::Drawing::Point(197, 202);
  412.             this->button20->Margin = System::Windows::Forms::Padding(2);
  413.             this->button20->Name = L"button20";
  414.             this->button20->Size = System::Drawing::Size(91, 30);
  415.             this->button20->TabIndex = 18;
  416.             this->button20->Text = L"ОТМЕНА";
  417.             this->button20->UseVisualStyleBackColor = true;
  418.             this->button20->Click += gcnew System::EventHandler(this, &MyForm::button20_Click);
  419.             //
  420.             // button21
  421.             //
  422.             this->button21->Location = System::Drawing::Point(197, 236);
  423.             this->button21->Margin = System::Windows::Forms::Padding(2);
  424.             this->button21->Name = L"button21";
  425.             this->button21->Size = System::Drawing::Size(91, 30);
  426.             this->button21->TabIndex = 19;
  427.             this->button21->Text = L"СБРОС";
  428.             this->button21->UseVisualStyleBackColor = true;
  429.             this->button21->Click += gcnew System::EventHandler(this, &MyForm::button21_Click);
  430.             //
  431.             // button22
  432.             //
  433.             this->button22->Location = System::Drawing::Point(197, 270);
  434.             this->button22->Margin = System::Windows::Forms::Padding(2);
  435.             this->button22->Name = L"button22";
  436.             this->button22->Size = System::Drawing::Size(91, 30);
  437.             this->button22->TabIndex = 20;
  438.             this->button22->Text = L"ВВОД";
  439.             this->button22->UseVisualStyleBackColor = true;
  440.             this->button22->Click += gcnew System::EventHandler(this, &MyForm::button22_Click);
  441.             //
  442.             // pictureBox1
  443.             //
  444.             this->pictureBox1->BackgroundImage = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"pictureBox1.BackgroundImage")));
  445.             this->pictureBox1->Location = System::Drawing::Point(377, 43);
  446.             this->pictureBox1->Name = L"pictureBox1";
  447.             this->pictureBox1->Size = System::Drawing::Size(167, 123);
  448.             this->pictureBox1->TabIndex = 29;
  449.             this->pictureBox1->TabStop = false;
  450.             //
  451.             // button23
  452.             //
  453.             this->button23->BackColor = System::Drawing::Color::Gray;
  454.             this->button23->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Stretch;
  455.             this->button23->ImageIndex = 0;
  456.             this->button23->ImageList = this->imageList_Картоприемник;
  457.             this->button23->Location = System::Drawing::Point(351, 172);
  458.             this->button23->Name = L"button23";
  459.             this->button23->Size = System::Drawing::Size(226, 132);
  460.             this->button23->TabIndex = 30;
  461.             this->button23->UseVisualStyleBackColor = false;
  462.             this->button23->Click += gcnew System::EventHandler(this, &MyForm::button23_Click);
  463.             //
  464.             // button24
  465.             //
  466.             this->button24->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
  467.             this->button24->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Stretch;
  468.             this->button24->ImageIndex = 0;
  469.             this->button24->ImageList = this->imageListВыдачаДенег;
  470.             this->button24->Location = System::Drawing::Point(351, 310);
  471.             this->button24->Name = L"button24";
  472.             this->button24->Size = System::Drawing::Size(226, 73);
  473.             this->button24->TabIndex = 31;
  474.             this->button24->UseVisualStyleBackColor = false;
  475.             this->button24->Click += gcnew System::EventHandler(this, &MyForm::button24_Click);
  476.             //
  477.             // flowLayoutPanel1
  478.             //
  479.             this->flowLayoutPanel1->AutoSize = true;
  480.             this->flowLayoutPanel1->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
  481.             this->flowLayoutPanel1->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
  482.             this->flowLayoutPanel1->Controls->Add(this->buttonBalance);
  483.             this->flowLayoutPanel1->Controls->Add(this->buttonGiveMoney);
  484.             this->flowLayoutPanel1->Controls->Add(this->buttonExit);
  485.             this->flowLayoutPanel1->FlowDirection = System::Windows::Forms::FlowDirection::TopDown;
  486.             this->flowLayoutPanel1->Location = System::Drawing::Point(109, 39);
  487.             this->flowLayoutPanel1->Name = L"flowLayoutPanel1";
  488.             this->flowLayoutPanel1->Size = System::Drawing::Size(137, 102);
  489.             this->flowLayoutPanel1->TabIndex = 32;
  490.             this->flowLayoutPanel1->Visible = false;
  491.             //
  492.             // buttonBalance
  493.             //
  494.             this->buttonBalance->AutoSize = true;
  495.             this->buttonBalance->Enabled = false;
  496.             this->buttonBalance->Location = System::Drawing::Point(2, 2);
  497.             this->buttonBalance->Margin = System::Windows::Forms::Padding(2);
  498.             this->buttonBalance->Name = L"buttonBalance";
  499.             this->buttonBalance->Size = System::Drawing::Size(133, 30);
  500.             this->buttonBalance->TabIndex = 33;
  501.             this->buttonBalance->Text = L"Баланс";
  502.             this->buttonBalance->UseVisualStyleBackColor = true;
  503.             //
  504.             // buttonGiveMoney
  505.             //
  506.             this->buttonGiveMoney->AutoSize = true;
  507.             this->buttonGiveMoney->Enabled = false;
  508.             this->buttonGiveMoney->Location = System::Drawing::Point(2, 36);
  509.             this->buttonGiveMoney->Margin = System::Windows::Forms::Padding(2);
  510.             this->buttonGiveMoney->Name = L"buttonGiveMoney";
  511.             this->buttonGiveMoney->Size = System::Drawing::Size(133, 30);
  512.             this->buttonGiveMoney->TabIndex = 34;
  513.             this->buttonGiveMoney->Text = L"Выдача наличных";
  514.             this->buttonGiveMoney->UseVisualStyleBackColor = true;
  515.             //
  516.             // buttonExit
  517.             //
  518.             this->buttonExit->AutoSize = true;
  519.             this->buttonExit->Enabled = false;
  520.             this->buttonExit->Location = System::Drawing::Point(2, 70);
  521.             this->buttonExit->Margin = System::Windows::Forms::Padding(2);
  522.             this->buttonExit->Name = L"buttonExit";
  523.             this->buttonExit->Size = System::Drawing::Size(133, 30);
  524.             this->buttonExit->TabIndex = 36;
  525.             this->buttonExit->Text = L"Выход";
  526.             this->buttonExit->UseVisualStyleBackColor = true;
  527.             //
  528.             // buttonMoney500
  529.             //
  530.             this->buttonMoney500->Enabled = false;
  531.             this->buttonMoney500->Location = System::Drawing::Point(197, 110);
  532.             this->buttonMoney500->Margin = System::Windows::Forms::Padding(2);
  533.             this->buttonMoney500->Name = L"buttonMoney500";
  534.             this->buttonMoney500->Size = System::Drawing::Size(75, 30);
  535.             this->buttonMoney500->TabIndex = 49;
  536.             this->buttonMoney500->Text = L"500";
  537.             this->buttonMoney500->UseVisualStyleBackColor = true;
  538.             this->buttonMoney500->Visible = false;
  539.             //
  540.             // buttonMoney50
  541.             //
  542.             this->buttonMoney50->Enabled = false;
  543.             this->buttonMoney50->Location = System::Drawing::Point(99, 110);
  544.             this->buttonMoney50->Margin = System::Windows::Forms::Padding(2);
  545.             this->buttonMoney50->Name = L"buttonMoney50";
  546.             this->buttonMoney50->Size = System::Drawing::Size(75, 30);
  547.             this->buttonMoney50->TabIndex = 48;
  548.             this->buttonMoney50->Text = L"50";
  549.             this->buttonMoney50->UseVisualStyleBackColor = true;
  550.             this->buttonMoney50->Visible = false;
  551.             //
  552.             // buttonMoney250
  553.             //
  554.             this->buttonMoney250->Enabled = false;
  555.             this->buttonMoney250->Location = System::Drawing::Point(197, 75);
  556.             this->buttonMoney250->Margin = System::Windows::Forms::Padding(2);
  557.             this->buttonMoney250->Name = L"buttonMoney250";
  558.             this->buttonMoney250->Size = System::Drawing::Size(75, 30);
  559.             this->buttonMoney250->TabIndex = 47;
  560.             this->buttonMoney250->Text = L"250";
  561.             this->buttonMoney250->UseVisualStyleBackColor = true;
  562.             this->buttonMoney250->Visible = false;
  563.             //
  564.             // buttonMoney25
  565.             //
  566.             this->buttonMoney25->Enabled = false;
  567.             this->buttonMoney25->Location = System::Drawing::Point(99, 75);
  568.             this->buttonMoney25->Margin = System::Windows::Forms::Padding(2);
  569.             this->buttonMoney25->Name = L"buttonMoney25";
  570.             this->buttonMoney25->Size = System::Drawing::Size(75, 30);
  571.             this->buttonMoney25->TabIndex = 46;
  572.             this->buttonMoney25->Text = L"25";
  573.             this->buttonMoney25->UseVisualStyleBackColor = true;
  574.             this->buttonMoney25->Visible = false;
  575.             //
  576.             // buttonMoney100
  577.             //
  578.             this->buttonMoney100->Enabled = false;
  579.             this->buttonMoney100->Location = System::Drawing::Point(197, 40);
  580.             this->buttonMoney100->Margin = System::Windows::Forms::Padding(2);
  581.             this->buttonMoney100->Name = L"buttonMoney100";
  582.             this->buttonMoney100->Size = System::Drawing::Size(75, 30);
  583.             this->buttonMoney100->TabIndex = 45;
  584.             this->buttonMoney100->Text = L"100";
  585.             this->buttonMoney100->UseVisualStyleBackColor = true;
  586.             this->buttonMoney100->Visible = false;
  587.             //
  588.             // buttonMoney10
  589.             //
  590.             this->buttonMoney10->Enabled = false;
  591.             this->buttonMoney10->Location = System::Drawing::Point(99, 40);
  592.             this->buttonMoney10->Margin = System::Windows::Forms::Padding(2);
  593.             this->buttonMoney10->Name = L"buttonMoney10";
  594.             this->buttonMoney10->Size = System::Drawing::Size(75, 30);
  595.             this->buttonMoney10->TabIndex = 44;
  596.             this->buttonMoney10->Text = L"10";
  597.             this->buttonMoney10->UseVisualStyleBackColor = true;
  598.             this->buttonMoney10->Visible = false;
  599.             //
  600.             // imageList_Картоприемник
  601.             //
  602.             this->imageList_Картоприемник->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageList_Картоприемник.ImageStream")));
  603.             this->imageList_Картоприемник->TransparentColor = System::Drawing::Color::Transparent;
  604.             this->imageList_Картоприемник->Images->SetKeyName(0, L"неткарты.jpg");
  605.             this->imageList_Картоприемник->Images->SetKeyName(1, L"заберитекарту.jpg");
  606.             //
  607.             // imageListВыдачаДенег
  608.             //
  609.             this->imageListВыдачаДенег->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageListВыдачаДенег.ImageStream")));
  610.             this->imageListВыдачаДенег->TransparentColor = System::Drawing::Color::Transparent;
  611.             this->imageListВыдачаДенег->Images->SetKeyName(0, L"Пусто.jpg");
  612.             this->imageListВыдачаДенег->Images->SetKeyName(1, L"Заберитеденьги.jpg");
  613.             //
  614.             // MyForm
  615.             //
  616.             this->AllowDrop = true;
  617.             this->AutoScaleDimensions = System::Drawing::SizeF(7, 17);
  618.             this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  619.             this->AutoValidate = System::Windows::Forms::AutoValidate::EnableAllowFocusChange;
  620.             this->ClientSize = System::Drawing::Size(589, 389);
  621.             this->Controls->Add(this->buttonMoney500);
  622.             this->Controls->Add(this->buttonMoney50);
  623.             this->Controls->Add(this->buttonMoney250);
  624.             this->Controls->Add(this->buttonMoney25);
  625.             this->Controls->Add(this->buttonMoney100);
  626.             this->Controls->Add(this->buttonMoney10);
  627.             this->Controls->Add(this->button24);
  628.             this->Controls->Add(this->button23);
  629.             this->Controls->Add(this->pictureBox1);
  630.             this->Controls->Add(this->button22);
  631.             this->Controls->Add(this->button21);
  632.             this->Controls->Add(this->button20);
  633.             this->Controls->Add(this->label1);
  634.             this->Controls->Add(this->button_00);
  635.             this->Controls->Add(this->button_06);
  636.             this->Controls->Add(this->button_05);
  637.             this->Controls->Add(this->button_04);
  638.             this->Controls->Add(this->button_03);
  639.             this->Controls->Add(this->button_09);
  640.             this->Controls->Add(this->button_02);
  641.             this->Controls->Add(this->button_08);
  642.             this->Controls->Add(this->button_01);
  643.             this->Controls->Add(this->button_07);
  644.             this->Controls->Add(this->button6);
  645.             this->Controls->Add(this->button7);
  646.             this->Controls->Add(this->button8);
  647.             this->Controls->Add(this->button3);
  648.             this->Controls->Add(this->button2);
  649.             this->Controls->Add(this->button1);
  650.             this->Controls->Add(this->flowLayoutPanel1);
  651.             this->Controls->Add(this->button19);
  652.             this->Font = (gcnew System::Drawing::Font(L"Segoe UI", 10));
  653.             this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"$this.Icon")));
  654.             this->Margin = System::Windows::Forms::Padding(3, 4, 3, 4);
  655.             this->Name = L"MyForm";
  656.             this->Text = L"Банкомат ОАО \"БАНК РАЗВОДИЛА\"";
  657.             this->Load += gcnew System::EventHandler(this, &MyForm::MyForm_Load);
  658.             (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->EndInit();
  659.             this->flowLayoutPanel1->ResumeLayout(false);
  660.             this->flowLayoutPanel1->PerformLayout();
  661.             this->ResumeLayout(false);
  662.             this->PerformLayout();
  663.  
  664.         }
  665. #pragma endregion
  666.     private: System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e) {
  667.     }
  668.  
  669. // кнопка-картинка ВСТАВИТЬ КАРТУ
  670. private: System::Void button23_Click(System::Object^ sender, System::EventArgs^ e) {
  671.     switch (ATMstate) {
  672.         case ATM_PLEASE_INPUT_CARD:
  673.         {
  674.             setATMstate(ATM_PLEASE_INPUT_PINCODE);
  675.             return;
  676.         }
  677.         case ATM_PLEASE_TAKE_CARD_BACK:
  678.         {
  679.             setATMstate(ATM_PLEASE_INPUT_CARD);
  680.             return;
  681.         }
  682.     }
  683. }
  684.  
  685. // кнопка СБРОС
  686. private: System::Void button21_Click(System::Object^ sender, System::EventArgs^ e) {
  687.     setATMstate(ATMstate);
  688. }
  689.     private: void hideAllMoneyButtons() {
  690.         this->buttonMoney10->Visible = false;
  691.         this->buttonMoney25->Visible = false;
  692.         this->buttonMoney50->Visible = false;
  693.         this->buttonMoney100->Visible = false;
  694.         this->buttonMoney250->Visible = false;
  695.         this->buttonMoney500->Visible = false;
  696.     }
  697.  
  698. private: void InputPINCODE(int number) {
  699.     if (!isInputPINCODEScreeen)
  700.         return;
  701.     if (number >= 0)
  702.     {
  703.         if (ATMinput->Length == 4)
  704.             return;
  705.         ATMinput += number.ToString();
  706.     }
  707.     int len = 4 - ATMinput->Length;
  708.     this->button19->Text = L"Введите ПИНКОД\n" + ATMinput;
  709.     for (int i = 0; i < len; i++)
  710.         this->button19->Text += " _";
  711. }
  712.  
  713. private: void Button1() {
  714.     if (ATMstate == ATM_MENU)
  715.     {
  716.         setATMstate(ATM_MENU_BALANCE);
  717.         return;
  718.     }
  719.     if (ATMstate == ATM_MENU_TAKE_MONEY && this->buttonMoney10->Visible == true)
  720.     {
  721.         TakeMoney = 10;
  722.         setATMstate(ATM_MENU_TAKE_MONEY_INPUT_PINCODE);
  723.         return;
  724.     }
  725. }
  726. private: void Button2() {
  727.     if (ATMstate == ATM_MENU)
  728.     {
  729.         setATMstate(ATM_MENU_TAKE_MONEY);
  730.         return;
  731.     }
  732.     if (ATMstate == ATM_MENU_TAKE_MONEY && this->buttonMoney25->Visible == true)
  733.     {
  734.         TakeMoney = 25;
  735.         setATMstate(ATM_MENU_TAKE_MONEY_INPUT_PINCODE);
  736.         return;
  737.     }
  738. }
  739. private: void Button3() {
  740.     if (ATMstate == ATM_MENU)
  741.     {
  742.         setATMstate(ATM_PLEASE_TAKE_CARD_BACK);
  743.         return;
  744.     }
  745.     if (ATMstate == ATM_MENU_TAKE_MONEY && this->buttonMoney50->Visible == true)
  746.     {
  747.         TakeMoney = 50;
  748.         setATMstate(ATM_MENU_TAKE_MONEY_INPUT_PINCODE);
  749.         return;
  750.     }
  751. }
  752. private: void Button4() {
  753.     if (ATMstate == ATM_MENU)
  754.     {
  755.         setATMstate(ATM_MENU_BALANCE);
  756.         return;
  757.     }
  758.     if (ATMstate == ATM_MENU_TAKE_MONEY && this->buttonMoney100->Visible == true)
  759.     {
  760.         TakeMoney = 100;
  761.         setATMstate(ATM_MENU_TAKE_MONEY_INPUT_PINCODE);
  762.         return;
  763.     }
  764. }
  765. private: void Button5() {
  766.     if (ATMstate == ATM_MENU)
  767.     {
  768.         setATMstate(ATM_MENU_TAKE_MONEY);
  769.         return;
  770.     }
  771.     if (ATMstate == ATM_MENU_TAKE_MONEY && this->buttonMoney250->Visible == true)
  772.     {
  773.         TakeMoney = 250;
  774.         setATMstate(ATM_MENU_TAKE_MONEY_INPUT_PINCODE);
  775.         return;
  776.     }
  777. }
  778. private: void Button6() {
  779.     if (ATMstate == ATM_MENU)
  780.     {
  781.         setATMstate(ATM_PLEASE_TAKE_CARD_BACK);
  782.         return;
  783.     }
  784.     if (ATMstate == ATM_MENU_TAKE_MONEY && this->buttonMoney500->Visible == true)
  785.     {
  786.         TakeMoney = 500;
  787.         setATMstate(ATM_MENU_TAKE_MONEY_INPUT_PINCODE);
  788.         return;
  789.     }
  790. }
  791. private: void setATMstate(int state) {
  792.     ATMinput = "";
  793.     ATMstate = state;
  794.     hideAllMoneyButtons();
  795.     this->button23->ImageIndex = 0;
  796.     this->button24->ImageIndex = 0;
  797.     switch (ATMstate)
  798.     {
  799.         case ATM_PLEASE_INPUT_CARD:
  800.         {
  801.             this->flowLayoutPanel1->Visible = false;
  802.             this->button19->Text = L"Вставьте карту для начала работы";
  803.             return;
  804.         }
  805.         case ATM_PLEASE_INPUT_PINCODE:
  806.         {
  807.             this->flowLayoutPanel1->Visible = false;
  808.             this->button19->Text = L"Введите ПИНКОД\n_ _ _ _";
  809.             return;
  810.         }
  811.         case ATM_MENU:
  812.         {
  813.             this->button19->Text = L"";
  814.             this->flowLayoutPanel1->Visible = true;
  815.             return;
  816.         }
  817.         case ATM_PLEASE_TAKE_CARD_BACK:
  818.         {
  819.             this->flowLayoutPanel1->Visible = false;
  820.             this->button19->Text = L"Заберите карту!";
  821.             this->button23->ImageIndex = 1;
  822.             return;
  823.         }
  824.         case ATM_MENU_BALANCE:
  825.         {
  826.             this->flowLayoutPanel1->Visible = false;
  827.             this->button19->Text = L"Текущий баланс: " + CardBalance + " BYN";
  828.             return;
  829.         }
  830.         case ATM_MENU_TAKE_MONEY:
  831.         {
  832.             this->flowLayoutPanel1->Visible = false;
  833.             if (CardBalance < 10)
  834.             {
  835.                 this->button19->Text = L"Недостаточно средств для вывода!";
  836.                 return;
  837.             }
  838.             this->buttonMoney10->Visible = true;
  839.             if (CardBalance < 25)
  840.                 return;
  841.             this->buttonMoney25->Visible = true;
  842.             if (CardBalance < 50)
  843.                 return;
  844.             this->buttonMoney50->Visible = true;
  845.             if (CardBalance < 100)
  846.                 return;
  847.             this->buttonMoney100->Visible = true;
  848.             if (CardBalance < 250)
  849.                 return;
  850.             this->buttonMoney250->Visible = true;
  851.             if (CardBalance < 500)
  852.                 return;
  853.             this->buttonMoney500->Visible = true;
  854.             return;
  855.         }
  856.         case ATM_MENU_TAKE_MONEY_INPUT_PINCODE:
  857.         {
  858.             this->flowLayoutPanel1->Visible = false;
  859.             this->button19->Text = L"Введите ПИНКОД\n_ _ _ _";
  860.             return;
  861.         }
  862.         case ATM_MENU_TAKE_MONEY_SUCCESS:
  863.         {
  864.             this->flowLayoutPanel1->Visible = false;
  865.             this->button19->Text = L"Заберите деньги!";
  866.             this->button24->ImageIndex = 1;
  867.             return;
  868.         }
  869.     }
  870. }
  871. // Кнопки 1-9,0
  872. private: System::Void button12_Click(System::Object^ sender, System::EventArgs^ e) {
  873.     InputPINCODE(1);
  874. }
  875. private: System::Void button13_Click(System::Object^ sender, System::EventArgs^ e) {
  876.     InputPINCODE(2);
  877. }
  878. private: System::Void button14_Click(System::Object^ sender, System::EventArgs^ e) {
  879.     InputPINCODE(3);
  880. }
  881. private: System::Void button17_Click(System::Object^ sender, System::EventArgs^ e) {
  882.     InputPINCODE(4);
  883. }
  884. private: System::Void button16_Click(System::Object^ sender, System::EventArgs^ e) {
  885.     InputPINCODE(5);
  886. }
  887. private: System::Void button15_Click(System::Object^ sender, System::EventArgs^ e) {
  888.     InputPINCODE(6);
  889. }
  890. private: System::Void button11_Click(System::Object^ sender, System::EventArgs^ e) {
  891.     InputPINCODE(7);
  892. }
  893. private: System::Void button10_Click(System::Object^ sender, System::EventArgs^ e) {
  894.     InputPINCODE(8);
  895. }
  896. private: System::Void button9_Click(System::Object^ sender, System::EventArgs^ e) {
  897.     InputPINCODE(9);
  898. }
  899. private: System::Void button18_Click(System::Object^ sender, System::EventArgs^ e) {
  900.     InputPINCODE(0);
  901. }
  902.  
  903. // Кнопка ОТМЕНА
  904. private: System::Void button20_Click(System::Object^ sender, System::EventArgs^ e) {
  905.     if (isInputPINCODEScreeen)
  906.     {
  907.         if (ATMinput->Length == 0)
  908.             return;
  909.         ATMinput = ATMinput->Substring(0, ATMinput->Length - 1);
  910.         InputPINCODE(-1);
  911.         return;
  912.     }
  913.     if (ATMstate == ATM_MENU_BALANCE || ATMstate == ATM_MENU_TAKE_MONEY)
  914.         setATMstate(ATM_MENU);
  915.  
  916. }
  917. // Кнопка ВВОД
  918. private: System::Void button22_Click(System::Object^ sender, System::EventArgs^ e) {
  919.     if (isInputPINCODEScreeen)
  920.     {
  921.         if (ATMinput != CARD_PINCODE)
  922.         {
  923.             this->button19->Text = L"ПИНКОД введён неверно!";
  924.             ATMinput = "";
  925.             return;
  926.         }
  927.         if (ATMstate == ATM_PLEASE_INPUT_PINCODE)
  928.             setATMstate(ATM_MENU);
  929.         if (ATMstate == ATM_MENU_TAKE_MONEY_INPUT_PINCODE)
  930.         {
  931.             CardBalance -= TakeMoney;
  932.             setATMstate(ATM_MENU_TAKE_MONEY_SUCCESS);
  933.         }
  934.     }
  935. }
  936.  
  937. private: System::Void button24_Click(System::Object^ sender, System::EventArgs^ e) {
  938.     if (ATMstate == ATM_MENU_TAKE_MONEY_SUCCESS)
  939.         setATMstate(ATM_MENU);
  940. }
  941.  
  942. private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
  943.     Button1();
  944. }
  945. private: System::Void button8_Click(System::Object^ sender, System::EventArgs^ e) {
  946.     Button4();
  947. }
  948. private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
  949.     Button2();
  950. }
  951. private: System::Void button7_Click(System::Object^ sender, System::EventArgs^ e) {
  952.     Button5();
  953. }
  954. private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
  955.     Button3();
  956. }
  957. private: System::Void button6_Click(System::Object^ sender, System::EventArgs^ e) {
  958.     Button6();
  959. }
  960. };
  961.  
  962.  
  963.  
  964. }
  965.  
Advertisement
Add Comment
Please, Sign In to add comment