Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Intermediate_page Check = new Intermediate_page(email);

            Check.Show();
            Close();
        }
Пример #2
0
        private void lizard_submit_Click(object sender, EventArgs e)
        {
            string provider         = ConfigurationManager.AppSettings["provider"];
            string connectionString = ConfigurationManager.AppSettings["connectionString"];

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();
                SqlCommand cmd = new SqlCommand("INSERT INTO LIZARD (Email, Name, Breed, Weight, Gender, Personality, Preffered_Temp, Food_Type, Age) VALUES " +
                                                "(@Email, @Name, @Breed, @Weight, @Gender, @Personality, @Preffered_Temp, @Food_Type, @Age)", connection);
                cmd.Parameters.AddWithValue("@Email", mail);
                cmd.Parameters.AddWithValue("@Name", name_text.Text);
                cmd.Parameters.AddWithValue("@Breed", breed_combo.SelectedItem.ToString());
                cmd.Parameters.AddWithValue("@Weight", weight_combo.SelectedItem.ToString());
                cmd.Parameters.AddWithValue("@Gender", gender_combo.SelectedItem.ToString());
                cmd.Parameters.AddWithValue("@Personality", personality_combo.SelectedItem.ToString());
                cmd.Parameters.AddWithValue("@Preffered_Temp", preffered_temp_combo.SelectedItem.ToString());
                cmd.Parameters.AddWithValue("@Food_Type", food_type.SelectedItem.ToString());
                cmd.Parameters.AddWithValue("@Age", age_combo.SelectedItem.ToString());
                try
                {
                    cmd.ExecuteNonQuery();
                }
                catch (SqlException sqlEX)
                {
                    MessageBox.Show(sqlEX.Message);
                }
                connection.Close();
            }
            Intermediate_page Check = new Intermediate_page(mail);

            Check.Show();
            Close();
        }
Пример #3
0
        private void Loigin_click(object sender, EventArgs e)
        {
            DataTable Emails           = new DataTable();
            bool      login2           = false;
            string    provider         = ConfigurationManager.AppSettings["provider"];
            string    connectionString = ConfigurationManager.AppSettings["connectionString"];

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlDataAdapter adapter = new SqlDataAdapter("Select Email FROM Seller ", connection))
                {
                    try
                    {
                        adapter.Fill(Emails);
                    }
                    catch (SqlException sql)
                    {
                        MessageBox.Show(sql.ToString());
                    }
                }
            }
            foreach (DataRow row in Emails.Rows)
            {
                if (owner_email_info.Text == row["Email"].ToString())
                {
                    Intermediate_page Check = new Intermediate_page(owner_email_info.Text);
                    Check.Show();
                    Close();
                    login2 = true;
                    break;
                }
                else
                {
                    login2 = false;
                }
            }
            if (!login2)
            {
                MessageBox.Show("Please sign in using valid Email.");
            }
        }