static void Main()
    {
        WorkingWithDates datesExample = new WorkingWithDates();
        datesExample.ConnectToSqlServer();
		try
		{
			datesExample.DropMessagesTable();
			datesExample.CreateMessagesTable();
			datesExample.AddMessage("Test message 1", DateTime.Now);
			datesExample.AddMessage("Test message 2", DateTime.Now);
			datesExample.AddMessage("Test message 3", DateTime.Now);
			CultureInfo cultureBulgaria = new CultureInfo("bg-BG");
			datesExample.DisplayAllMessages(cultureBulgaria, "dd-MMM-yyyy HH:mm:ss");
			datesExample.DropMessagesTable();
		}
		finally
		{
			datesExample.DisconnectFromSqlServer();
		}
    }
    static void Main()
    {
        WorkingWithDates datesExample = new WorkingWithDates();

        datesExample.ConnectToSqlServer();
        try
        {
            datesExample.DropMessagesTable();
            datesExample.CreateMessagesTable();
            datesExample.AddMessage("Test message 1", DateTime.Now);
            datesExample.AddMessage("Test message 2", DateTime.Now);
            datesExample.AddMessage("Test message 3", DateTime.Now);
            CultureInfo cultureBulgaria = new CultureInfo("bg-BG");
            datesExample.DisplayAllMessages(cultureBulgaria, "dd-MMM-yyyy HH:mm:ss");
            datesExample.DropMessagesTable();
        }
        finally
        {
            datesExample.DisconnectFromSqlServer();
        }
    }
Beispiel #3
0
        // side methods
        void programLoader(int programState)
        {
            switch (programState)
            {
            // Gholizadeh practices
            case 1:
                Console.Clear();
                var numPrinter = new NumPrinter();
                numPrinter.Printer();
                break;

            case 2:
                Console.Clear();
                var whileTest = new WhileTest();
                whileTest.WhileTester();
                break;

            case 3:
                Console.Clear();
                var nestedLoop = new NestedLoop();
                nestedLoop.NestedLoopTester();
                break;

            case 4:
                Console.Clear();
                var primeCheck = new PrimeCheck();
                primeCheck.PrimeChecker();
                break;

            case 5:
                Console.Clear();
                var elitePrimeCheck = new ElitePrimeCheck();
                elitePrimeCheck.ElitePrimeChecker();
                break;

            case 6:
                Console.Clear();
                var powerNumber = new PowerNumber();
                powerNumber.PowerNumberDealer();
                break;

            case 7:
                Console.Clear();
                var arkanoidMechanic = new ArkanoidMechanic();
                arkanoidMechanic.MainMenu();
                break;

            case 8:
                Console.Clear();
                var snakeMainLoop = new SnakeMainLoop();
                snakeMainLoop.GameLaunch();
                break;

            case 9:
                Console.Clear();
                var grandStringPrinter = new GrandStringPrinter();
                grandStringPrinter.stringPrinter();
                break;

            // Udemy practices
            case 10:
                Console.Clear();
                var EnumsTest = new EnumsTest();
                EnumsTest.enumTester();
                Console.ReadKey();
                break;

            case 11:
                Console.Clear();
                int number = 1;
                var valueTypesAndReferenceTypes = new ValueTypesAndReferenceType();
                valueTypesAndReferenceTypes.Increment(number);
                Console.WriteLine(number);
                Console.WriteLine("press 'enter' to continue");
                Console.ReadKey();
                valueTypesAndReferenceTypes.Age = 20;
                valueTypesAndReferenceTypes.MakeOld(valueTypesAndReferenceTypes);
                Console.WriteLine(valueTypesAndReferenceTypes.Age);
                Console.WriteLine("press 'enter' to continue");
                Console.ReadKey();
                break;

            case 12:
                Console.Clear();
                var controlFlowExercisesP1 = new ControlFlowExercises();
                controlFlowExercisesP1.ControlFlowExercisePart1();
                break;

            case 13:
                Console.Clear();
                var controlFlowExercisesP2 = new ControlFlowExercises();
                controlFlowExercisesP2.ControlFlowExercisePart2();
                break;

            case 14:
                Console.Clear();
                var arraysAndListsExercises = new ArraysAndListsExercises();
                arraysAndListsExercises.ArraysAndListExecise();
                break;

            case 15:
                Console.Clear();
                var workingWithTexts = new WorkingWithTexts();
                workingWithTexts.StringFunctions();
                break;

            case 16:
                Console.Clear();
                var workingWithDates = new WorkingWithDates();
                workingWithDates.ShowTimeAndDate();
                break;

            case 17:
                Console.Clear();
                var workingWithFiles = new WorkingWithFiles();
                workingWithFiles.FileAndFileInfo();
                break;

            case 18:
                Console.Clear();
                var republicStart = new RepublicStart();
                republicStart.StartTheRegime();
                break;

            case 19:
                Console.Clear();
                var knightAttributeHandler = new KnightAttributeHandler();
                knightAttributeHandler.BuildKnight();
                break;

            case 20:
                Console.Clear();
                var constructorAndObjInitializer = new ConstructorAndObjInitializer
                {
                    PersonName   = "ali",
                    PersonAge    = 10,
                    PersonHeight = 110
                };
                constructorAndObjInitializer.ShowPersonInfo();
                break;

            case 21:
                Console.Clear();
                var personIdentifier = new PersonIdentifier();
                personIdentifier.IntroducePerson();
                break;

            case 22:
                Console.Clear();
                var cookieAccessor = new CookieAccessor();
                cookieAccessor.AccessUser();
                break;

            case 23:
                Console.Clear();
                var stackOverflowUser = new StackOverflowUser();
                stackOverflowUser.ProgramStart();
                break;

            case 24:
                Console.Clear();
                var stopwatch = new Stopwatch();
                stopwatch.WatchFunction();
                break;

            case 25:
                Console.Clear();
                var serverTest01 = new ServerTest01();
                serverTest01.ServerSetup();
                break;

            case 26:
                Console.Clear();
                var animals = new Animals();
                animals.Specimen();
                break;

            case 27:
                Console.Clear();
                var bufferSizeExample = new ConsoleBufferSizeExample();
                bufferSizeExample.ScreenBuffer();
                break;

            case 28:
                Console.Clear();
                var barcodeRangeGame = new BarcodeRangeGame();
                barcodeRangeGame.RangeCalculator();
                break;

            default:
                break;
            }
        }