This is extension class that contain different SQL extension methods.
Example #1
0
        public void converterMenu()
        {
            Console.WriteLine ("\n UNIT CONVERTER \n\n---------\n\n Choose a type of conversion: \n\n 1) Temperature from fahrenheit to celsius \n 2) Temperature from celsius to fahrenheit \n 3) Speed from km/h to miles/h \n 4) Speed from miles/h to km/h ");
            int key = Convert.ToInt32 (Console.ReadLine ());

            extension ext = new extension ();
            switch (key) {
            case 1:
                //Convert temperature from fahrenheit to celsius
                FahrenheitToCelsiusTemp ();
                converterMenu ();
                break;
            case 2:
                //Convert temperature from celsius to fahrenheit
                CelsiusToFahrenheitTemp ();
                converterMenu ();
                break;
            case 3:
                //Convert speed from kilometers per hour to miles per hour
                KmPerHourToMilesPerHour ();
                converterMenu ();
                break;
            case 4:
                //Convert speed from miles per hour to kilometers per hour
                MilesPerHourToKmPerHour ();
                converterMenu ();
                break;
            case 5:
                Length ();
                converterMenu ();
                switch (key) {
                case 1:
                    CentimetersToMeters ();
                    converterMenu ();
                    break;
                case 2:
                    CentimetersToKilometers ();
                    converterMenu ();
                    break;
                case 3:
                    MetersToCentimeters ();
                    converterMenu ();
                    break;
                case 4:
                    MetersToKilometers ();
                    converterMenu ();
                    break;
                case 5:
                    KilometersToCentimeters ();
                    converterMenu ();
                    break;
                case 6:
                    KilometersToMeters ();
                    converterMenu ();
                    break;
                }
                break;
            }
        }
        private bool phoneOperation(string operation, string ext1, string ext2)
        {
            log.Info("---> operation:" + "; ext1:" + ext1 + "; ext2:" + ext2);
            try
            {
                endpoints ep = new endpoints();
                ep.originatingExtension = ext1;
                ep.destinationNumber    = ext2;

                extension ex = new extension();
                ex.extension1 = ext1;

                switch (operation)
                {
                case "makecall":
                    service.makeCall(ep);
                    break;

                case "answer":
                    service.answerAlertingCall(ex);
                    break;

                case "disconnect":
                    service.disconnectActiveCall(ex);
                    break;

                case "conference":
                    service.singleStepConferenceCall(ep);
                    break;

                case "transfer":
                    service.singleStepTransferCall(ep);
                    break;

                default:
                    faultRaised = true;
                    break;
                }
            }
            catch (Exception e)
            {
                log.Error("Error invoking phone operation to the Telephony Web service " + e);
                log.Error(e.StackTrace);
                faultRaised = true;
            }

            // Set the session ID for the next request.
            manageSession();

            releaseSession();
            log.Info("<--- ");
            return(!faultRaised);
        }
Example #3
0
        public void converterMenu()
        {
            Console.WriteLine("\n UNIT CONVERTER \n\n---------\n\n Choose a type of conversion: \n\n 1) Temperature from fahrenheit to celsius \n 2) Temperature from celsius to fahrenheit \n 3) Speed from km/h to miles/h \n 4) Speed from miles/h to km/h ");
            int key = Convert.ToInt32(Console.ReadLine());

            extension ext = new extension();

            switch (key)
            {
            case 1:
                //Convert temperature from fahrenheit to celsius
                FahrenheitToCelsiusTemp();
                converterMenu();
                break;

            case 2:
                //Convert temperature from celsius to fahrenheit
                CelsiusToFahrenheitTemp();
                converterMenu();
                break;

            case 3:
                //Convert speed from kilometers per hour to miles per hour
                KmPerHourToMilesPerHour();
                converterMenu();
                break;

            case 4:
                //Convert speed from miles per hour to kilometers per hour
                MilesPerHourToKmPerHour();
                converterMenu();
                break;

            case 5:
                Length();
                converterMenu();
                switch (key)
                {
                case 1:
                    CentimetersToMeters();
                    converterMenu();
                    break;

                case 2:
                    CentimetersToKilometers();
                    converterMenu();
                    break;

                case 3:
                    MetersToCentimeters();
                    converterMenu();
                    break;

                case 4:
                    MetersToKilometers();
                    converterMenu();
                    break;

                case 5:
                    KilometersToCentimeters();
                    converterMenu();
                    break;

                case 6:
                    KilometersToMeters();
                    converterMenu();
                    break;
                }
                break;
            }
        }