EnterMinCostForAgentWindow.xaml.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Shapes;
  14. using mysql_connector2.res;
  15. using MySqlConnector;
  16. using Dapper;
  17. namespace mysql_connector2.Windows
  18. {
  19. public partial class EnterMinCostForAgentWindow : Window
  20. {
  21. public decimal Result;
  22. public EnterMinCostForAgentWindow(decimal AvgCost)
  23. {
  24. InitializeComponent();
  25. CostTextBox.Text = AvgCost.ToString();
  26. }
  27. private void Button_Click(object sender, RoutedEventArgs e)
  28. {
  29. try
  30. {
  31. Result = Convert.ToDecimal(CostTextBox.Text);
  32. DialogResult = true;
  33. }
  34. catch (Exception)
  35. {
  36. MessageBox.Show("Стоимость должна быть числом");
  37. }
  38. }
  39. }
  40. }