Пример #1
0
        public void TestSetup()
        {
            _PackageListController = new PackageListController();
            packageList            = new List <Package>();
            examplePackage         = new Package();

            _PackageListController.GenerateExamplePackages(20);
            examplePackage = _PackageListController.GenerateRandomPackage();
            _PackageListController.AddPackageToList(examplePackage);
            packageList = _PackageListController.ReturnPackageList();
        }
Пример #2
0
 private void Btn_gem(object sender, RoutedEventArgs e)
 {
     try
     {
         Package tempPackage = new Package()
         {
             Date    = Convert.ToDateTime(DatoInput.Text),
             Type    = UdkastType.Text,
             Country = UdkastCountry.Text,
             Price   = UdkastPrice.Text,
             Comment = UdkastComment.Text
         };
         PLC.AddPackageToList(tempPackage);
         LoadSearch();
         packageDatagrid.ItemsSource = packageList;
         CalculateTotals();
         packageDatagrid.Items.Refresh();
     }
     catch (Exception exception)
     {
         MessageBoxResult result = MessageBox.Show("Der opstod et problem med at gemme filen. \n\n" + exception, "Error!");
     }
 }