예제 #1
0
파일: GuiHelper.cs 프로젝트: Skorm/DataSave
        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();
            }
        }
예제 #2
0
파일: GuiHelper.cs 프로젝트: Skorm/DataSave
        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();
            }
        }