Exemplo n.º 1
0
        private static void checkUser(out DTO.User user)
        {
            var userRepo      = new UserInfoRepository(DTO.Enums.BackEndOrFrontEndEnum.FrontEnd);
            var userDbManager = new UserDbManager(userRepo);

            user = userDbManager.GetUserByUsername(Environment.UserName);
            //A null user would mean the current Windows username doesn't exist in the User_Login_Info table
            if (user == null)
            {
                Console.Clear();
                Console.WriteLine("Sorry, but you are not currently an authorized user. Please speak to the database administrator if you believe you have " +
                                  "seen this message in error. Press enter to exit.");
                Console.ReadLine();
            }
        }