Exemple #1
0
        public static void HandelProfileCreation(CreateProfileView sender)
        {
            sender.TextBlockErrorDisplay.Text = "";
            bool NoFailture = true;

            if (DataOperations.ChekProfileFileExsists(sender.TextBoxUserInputProfileName.Text))
            {
                sender.TextBlockErrorDisplay.Text += "Profile already exist!\n";
                NoFailture = false;
            }


            if (sender.TextBoxUserInputProfileName.Text.Count() <= 0)
            {
                sender.TextBlockErrorDisplay.Text += "Your Profilename have to be longer than 0 Charakters!\n";
                NoFailture = false;
            }


            if (!DataOperations.ComparePasswords(sender.PasswordBoxUserInputPassword.Password, sender.PasswordBoxUserInputPasswordRepate.Password))
            {
                sender.TextBlockErrorDisplay.Text += "The Passwords are not the same!\n";
                NoFailture = false;
            }

            if (NoFailture)
            {
                ProfileType Profile = new ProfileType();
                Profile.ProfileName = sender.TextBoxUserInputProfileName.Text;
                DataOperations.WriteProfileToDisk(Profile, sender.PasswordBoxUserInputPassword.Password);
                AppData.PointerMainWindow.Content = new StartupView();
            }
        }
Exemple #2
0
        public static void HandelProfileCreation(CreateProfileView sender)
        {
            sender.TextBlockErrorDisplay.Text = "";
            bool NoFailture = true;

            if (DataOperations.ChekProfileFileExsists(sender.TextBoxUserInputProfileName.Text))
            {
                sender.TextBlockErrorDisplay.Text += "Profile already exist!\n";
                NoFailture = false;
            }

            if (sender.TextBoxUserInputProfileName.Text.Count() <= 0)
            {
                sender.TextBlockErrorDisplay.Text += "Your Profilename have to be longer than 0 Charakters!\n";
                NoFailture = false;
            }

            if (!DataOperations.ComparePasswords(sender.PasswordBoxUserInputPassword.Password, sender.PasswordBoxUserInputPasswordRepate.Password))
            {
                sender.TextBlockErrorDisplay.Text += "The Passwords are not the same!\n";
                NoFailture = false;
            }

            if (NoFailture)
            {
                ProfileType Profile = new ProfileType();
                Profile.ProfileName = sender.TextBoxUserInputProfileName.Text;
                DataOperations.WriteProfileToDisk(Profile, sender.PasswordBoxUserInputPassword.Password);
                AppData.PointerMainWindow.Content = new StartupView();
            }
        }