Example #1
0
        public static Student GetStudentInformations(bool isAdd, string studentIdToUpdate)
        {
            Student toReturnStudent = new Student();

            Console.Write("Name: ");
            toReturnStudent.Name = Console.ReadLine();

            Console.Write("Surname: ");
            toReturnStudent.Surname = Console.ReadLine();

            Console.Write("Birthday(dd.MM.yyyy): ");
            toReturnStudent.Birthday = Utils.GetDateTimeOnConsoleWithValidationAndFormat(Console.ReadLine(), "\nBirthday(dd.MM.yyyy): ", "Please Enter Valid Birthday with these format (dd.MM.yyyy)\n\n");

            if (isAdd)
            {
                Console.Write("StudentId: ");
                toReturnStudent.StudentId = AddOperations.AddingId();
            }
            else
            {
                toReturnStudent.StudentId = studentIdToUpdate;
            }

            Console.Write("Gsm: ");
            toReturnStudent.Gsm = Utils.GetNumericValueWithValidation(Console.ReadLine(), "Gsm: ", "\nPlease Enter Valid Gsm with these format (5#########)\n\n", true, 10);
            return(toReturnStudent);
        }
Example #2
0
        public static void RecordSystemMenu()
        {
            Console.WriteLine("Welcome " + LoginProcess.loginedUser.Name + " " + LoginProcess.loginedUser.Surname);
            string choice = "-1";

            while (choice != "9")
            {
                Console.WriteLine("\n<<<<< Please Choose One The Operation (1-ADD | 2-UPDATE | 3-REMOVE | 4-SEARCH | 9-EXIT) >>>>>");
                Console.Write("\nOperation>> ");
                choice = Console.ReadLine();
                switch (choice)
                {
                case "1":
                    AddOperations.AddRecord();
                    break;

                case "2":
                    UpdateOperations.UpdateRecord();
                    break;

                case "3":
                    RemoveOperations.RemoveRecord();
                    break;

                case "4":
                    SearchFindPrintOperations.SearchRecord();
                    break;

                case "9":
                    LoginProcess.logOutDate = DateTime.Now;
                    LogOperation.LogProgram.Info(LoginProcess.loginedUser.UserName + " logout.");
                    Console.WriteLine("...Exit...");
                    break;

                default:
                    Console.WriteLine("Please Enter Valid Operation Number\n");
                    break;
                }
            }
        }