Beispiel #1
0
        private void User_Click(object sender, EventArgs e)
        {
            YpravleniePolzovatelami zakaz = new YpravleniePolzovatelami();

            zakaz.Show();
            this.Hide();
        }
Beispiel #2
0
        private void Save_Click(object sender, EventArgs e)
        {
            connection = new SqlConnection(connectionString);
            try
            {
                connection.Open();
                cmd = new SqlCommand($"INSERT INTO [dbo].[User] (Email, FirstName,  LastName, RoleId, master_ID) VALUES ('{textBox1.Text}','{NameText.Text}','{SurnameText.Text}','{RoleText.SelectedValue}','{PasswordText.Text}')", connection);
                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                connection.Close();
            }
            YpravleniePolzovatelami zakaz = new YpravleniePolzovatelami();

            zakaz.Show();
            this.Hide();
        }