Exemplo n.º 1
0
 static void HandleUpdateOperation()
 {
     Console.Write("Enter Job Id to Update: ");
     if (int.TryParse(Console.ReadLine(), out var temp))
     {
         JobModel.JobId = temp;
     }
     else
     {
         JobModel.JobId = 0;
         Console.WriteLine("Input is not in numbers..INVALID");
     }
     if (Oracle.CheckJobExists())
     {
         UserInteraction.GetJobDetails();
         Oracle.UpdateJob();
     }
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            while (true)
            {
                switch (UserInteraction.GetCRUDOperation())
                {
                case 1:
                    UserInteraction.GetJobDetails();
                    Oracle.InsertJob();
                    break;

                case 2:
                    HandleRetrieveOperation();
                    break;

                case 3:
                    HandleUpdateOperation();
                    break;

                case 4:
                    HandleDeleteOperation();
                    break;

                default:
                    Console.WriteLine("Choise is Not awailable..exiting..!");
                    break;
                }

                Console.Write("\nWant to do another operation ? Y/N  :   ");
                var userInput = Console.ReadLine();
                if (!(userInput == "Y" || userInput == "y"))
                {
                    break;
                }
                Console.WriteLine();
            }
            Console.WriteLine("\nProgram is Terminating...!");
            Thread.Sleep(500);
        }