123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Shapes;
- namespace KFC
- {
- /// <summary>
- /// Логика взаимодействия для menu.xaml
- /// </summary>
- public partial class menu : Window
- {
- public long summ = 0;
- public menu()
- {
- InitializeComponent();
- }
- public void Update()
- {
- }
- private void Button_Pay(object sender, RoutedEventArgs e)
- {
- tabcontrol.Visibility = Visibility.Hidden;
- txt.Visibility = Visibility.Visible;
- txtsumm.Text = $"Итого: {summ}";
- btn_pay.Visibility = Visibility.Hidden;
- btn_exit.Visibility = Visibility.Visible;
- }
- #region Burger
- public void Burger1(object sender, MouseButtonEventArgs e)
- {
- summ += 149;
- txt.AppendText(Environment.NewLine + $"{"Шефбургер Де Люкс".PadRight(85, ' ')}149 p.");
- Update();
- }
- private void Burger2(object sender, MouseButtonEventArgs e)
- {
- summ += 99;
- txt.AppendText(Environment.NewLine + $"{"Шефбургер Джуниор".PadRight(86, ' ')}99 p.");
- Update();
- }
- private void Burger3(object sender, MouseButtonEventArgs e)
- {
- summ += 69;
- txt.AppendText(Environment.NewLine + $"{"Чизбургер с Луком".PadRight(90, ' ')}69 p.");
- Update();
- }
- private void Burger4(object sender, MouseButtonEventArgs e)
- {
- summ += 99;
- txt.AppendText(Environment.NewLine + $"{ "Шефбургер".PadRight(94, ' ')}99 p.");
- Update();
- }
- private void Burger5(object sender, MouseButtonEventArgs e)
- {
- summ += 129;
- txt.AppendText(Environment.NewLine + $"{"Чизбургер Де Люкс".PadRight(87, ' ')}129 p.");
- Update();
- }
- #endregion
- #region Tvister
- private void Tvister1(object sender, MouseButtonEventArgs e)
- {
- summ += 269;
- txt.AppendText(Environment.NewLine + $"{ "2 твистера".PadRight(95, ' ')}269 p.");
- Update();
- }
- private void Tvister2(object sender, MouseButtonEventArgs e)
- {
- summ += 189;
- txt.AppendText(Environment.NewLine + $"{"Твистер Де Люкс".PadRight(89, ' ')}189 p.");
- Update();
- }
- private void Tvister3(object sender, MouseButtonEventArgs e)
- {
- summ += 99;
- txt.AppendText(Environment.NewLine + $"{"Твистер Джуниор".PadRight(90, ' ')}99 p.");
- Update();
- }
- #endregion
- #region Potato
- private void Potato1(object sender, MouseButtonEventArgs e)
- {
- summ += 99;
- txt.AppendText(Environment.NewLine + $"{"Баскет фри".PadRight(96, ' ')}99 p.");
- Update();
- }
- private void Potato2(object sender, MouseButtonEventArgs e)
- {
- summ += 79;
- txt.AppendText(Environment.NewLine + $"{"Картофель по-деревенски".PadRight(83, ' ')}79 p.");
- Update();
- }
- #endregion
- #region Dessert
- private void Dessert1(object sender, MouseButtonEventArgs e)
- {
- summ += 55;
- txt.AppendText(Environment.NewLine + $"{"Пирожок с вишней".PadRight(88, ' ')}55 p.");
- Update();
- }
- private void Dessert2(object sender, MouseButtonEventArgs e)
- {
- summ += 79;
- txt.AppendText(Environment.NewLine + $"{"Донат Карамельный".PadRight(88, ' ')}79 p.");
- Update();
- }
- #endregion
- private void Button_Exit(object sender, RoutedEventArgs e)
- {
- Application.Current.Shutdown();
- }
- #region for tests
- public long Summ()
- {
- Burger1(null, null);
- Tvister1(null, null);
- Potato1(null, null);
- Dessert1(null, null);
- return summ;
- }
- public string Check()
- {
- Tvister1(null, null);
- Button_Pay(null, null);
- return txtsumm.Text;
- }
- public string CheckPuy()
- {
- Burger1(null, null);
- Button_Pay(null, null);
- return txt.Text;
- }
- public long CheckSumm2()
- {
- Burger1(null, null);
- Burger1(null, null);
- return summ;
- }
- #endregion
- }
- }
|