MainWindow.xaml.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. namespace bobrovTounApp
  17. {
  18. /// <summary>
  19. /// Логика взаимодействия для MainWindow.xaml
  20. /// </summary>
  21. public partial class MainWindow : Window
  22. {
  23. public MainWindow(object MainFrame)
  24. {
  25. InitializeComponent();
  26. }
  27. private void Button_Click(object sender, RoutedEventArgs e)
  28. {
  29. }
  30. private void MainFrame_Navigated(object sender, NavigationEventArgs e)
  31. {
  32. }
  33. private void ImportTours()
  34. {
  35. var fileData = File.ReadAllLines(@"C:\Users\user2\Desktop\Новая папка (2)\Tours2.txt");
  36. var images = Directory.GetFiles(@"C:\Users\user2\Desktop\Новая папка (3)");
  37. foreach (var line in fileData)
  38. {
  39. var data = line.Split('\t');
  40. var tempTour = new Tour
  41. {
  42. Name = data[0].Replace("\"", ""),
  43. TicketCount = int.Parse(data[2]),
  44. Price = decimal.Parse(data[3]),
  45. isActual = (data[4] == "0") ? false : true
  46. };
  47. foreach (var tourType in data[5].Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries))
  48. {
  49. }
  50. }
  51. }
  52. private string ReadAllBytes(string v)
  53. {
  54. throw new NotImplementedException();
  55. }
  56. }
  57. }