Пример #1
0
        public MySqlCommand Add_to_loginuser(InfoScreen window, MySqlConnection connection)
        {
            using (MD5 hash = MD5.Create())
            {
                window.txtPassword.Password = GetMd5Hash(hash, window.txtPassword.Password);
            }
            connection.Open();
            query = "INSERT INTO loginuser(UserName, Password, user_type) VALUES ('" + window.txtUsername.Text + "','" + window.txtPassword.Password + "','" + window.cbb_user_type.Text + "')";
            MySqlCommand command = new MySqlCommand(query, connection);

            return(command);
        }
Пример #2
0
        public bool CheckIsEmptyInInfoScreen(InfoScreen window)
        {
            #region zmienne do sprawdzania czy pusty textbox

            bool isEmptyUsername       = String.IsNullOrWhiteSpace(window.txtUsername.Text);
            bool isEmptyPassword       = String.IsNullOrWhiteSpace(window.txtPassword.Password);
            bool isEmptyRepeatPassword = String.IsNullOrWhiteSpace(window.txtRepeatPassword.Password);
            bool isEmptyUser_type      = String.IsNullOrWhiteSpace(window.cbb_user_type.Text);

            #endregion

            bool checkIsEmpty = (isEmptyUsername || isEmptyPassword || isEmptyUser_type || isEmptyRepeatPassword) ? true : false;
            return(checkIsEmpty);
        }
Пример #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.AppWindow = ((Praca_InzynierskaV2.InfoScreen)(target));
                return;

            case 2:
                this.txtUsername = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.txtPassword = ((System.Windows.Controls.PasswordBox)(target));
                return;

            case 4:
                this.txtRepeatPassword = ((System.Windows.Controls.PasswordBox)(target));
                return;

            case 5:
                this.cbb_user_type = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 6:
                this.RegisterButton = ((System.Windows.Controls.Button)(target));

            #line 130 "..\..\InfoScreen.xaml"
                this.RegisterButton.Click += new System.Windows.RoutedEventHandler(this.RegisterButton_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        private void InfoButton_Click(object sender, RoutedEventArgs e)
        {
            InfoScreen dashboard = new InfoScreen();

            dashboard.ShowDialog();
        }