Example #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();
        }
Example #2
0
        private void Run()
        {
            SQLConnection sqlcon = new SQLConnection();

            while (true)
            {
                string input = System.Console.ReadLine();

                switch (input)
                {
                case "login":
                    sqlcon.LogIn();
                    break;

                case "logout":
                    sqlcon.LogOut();
                    break;

                case "loggedin":
                    if (sqlcon.LoggedIn())
                    {
                        System.Console.WriteLine("You are logged in");
                    }
                    else
                    {
                        System.Console.WriteLine("you are logged out");
                    }
                    break;

                case "insert":
                    Package package           = new Package();
                    PackageListController PLC = new PackageListController();
                    package = PLC.GenerateRandomPackage();
                    sqlcon.InsertIntoFragt(package);
                    break;

                default:
                    break;
                }
            }
        }