Ejemplo n.º 1
0
        public void ConnectUser()
        {
            Console.WriteLine("Connect your self");
            Console.Write("Login :"******"Password :"******"command_line") != null)
            {
                Console.Clear();
                while (true)
                {
                    DataManager.Instance.PrintUserChoice();
                }
            }
            else
            {
                Console.WriteLine("Bad credential");
                Console.ReadLine();
                Console.Clear();
                ConnectUser();
            }
        }
Ejemplo n.º 2
0
        private void BtnLogMe_Click(object sender, RoutedEventArgs e)
        {
            UserMySqlManager userManager = new UserMySqlManager();
            User             loggedUser  = userManager
                                           .GetByLogin(
                this.loginView.txtBoxLogin.Text,
                this.loginView.passwordBoxPassword.Password);

            if (loggedUser.Roles.Select(x => x.Name == "admin").FirstOrDefault())
            {
                UserManagerViewModel viewModel = new UserManagerViewModel();
            }
            else if (loggedUser.Roles.Select(x => x.Name == "wpf_user").FirstOrDefault())
            {
                DataInsertViewModel viewModel = new DataInsertViewModel(loggedUser);
            }
        }