Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApp1
- {
- public partial class Form1 : Form
- {
- ProgressBar[] ProgressBars;
- int Total = 32;
- public Form1()
- {
- InitializeComponent();
- ProgressBars = new ProgressBar[]
- {
- progressBar1,
- progressBar2,
- progressBar3,
- progressBar4,
- };
- }
- private void BuyButtonClick(object sender, EventArgs e)
- {
- Button button = (Button)sender;
- int tableNumber = Convert.ToInt32(button.Tag.ToString());
- ProgressBar table = ProgressBars[tableNumber];
- if (table.Value != table.Maximum)
- {
- table.Value++;
- logLabel.Text = "Столик забронирован";
- Total--;
- label5.Text = " Осталось столиков: " + (Total);
- }
- else
- {
- logLabel.Text = "За столиком нет мест";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement