Exemplo n.º 1
0
        public static Db updateData(Db db)
        {
            //Function to update data
            //User input- which table to update
            //Different Modules for each table
            try
            {
                Console.WriteLine(ConsoleConstants.ChoiceUpdate);
                int    choice = Convert.ToInt32(Console.ReadLine());
                string role   = string.Empty;
                switch (choice)
                {
                case 1:
                    db = DoctorModule.CRUD_Update(db);
                    break;

                case 2:
                    db = PatientModule.CRUD_Update(db);
                    break;

                case 3:
                    db = DoctorTypeModule.CRUD_Update(db);
                    break;

                default:
                    Console.WriteLine("Wrong Input");
                    break;
                }
            }catch (Exception ex)
            {
                db.errorlog = LogModule.insertErrorLog(db.errorlog, ex.ToString(), "Update Records");
            }

            return(db);
        }