Exemple #1
0
        private void Done_Click(object sender, EventArgs e)
        {
            if (TBox.Text.Equals("") || PBox.Text.Equals(""))
            {
                MessageBox.Show("You should Choose all the sizes first !!!");
            }
            else
            {
                string connectionString;
                connectionString = "Data Source=AHC-5-2-2017\\sqlexpress;Initial Catalog=SProject;Integrated Security=True";
                SqlConnection conn = new SqlConnection(connectionString);

                conn.Open();
                SqlCommand command = new SqlCommand("update emp  set [T-size] ='" + TBox.Text + "' , [P-size] = '" + PBox.Text + "'  where username = '******' ;", conn);

                command.ExecuteNonQuery();

                MessageBox.Show("Sizes added");


                this.Hide();
                UserMain2 us = new UserMain2(username);
                us.Show();
            }
        }
Exemple #2
0
        private void Back_Click(object sender, EventArgs e)
        {
            this.Hide();
            UserMain2 us = new UserMain2(username);

            us.Show();
        }
Exemple #3
0
        private void Done_Click(object sender, EventArgs e)
        {

            string connectionString;
            connectionString = "Data Source=AHC-5-2-2017\\sqlexpress;Initial Catalog=SProject;Integrated Security=True";
            SqlConnection conn = new SqlConnection(connectionString);

            conn.Open();
            SqlCommand command = new SqlCommand("update emp  set [T-size] ='" + Tsize+ "' , [P-size] = '" + Psize + "'  where username = '******' ;", conn);

            command.ExecuteNonQuery();

            MessageBox.Show("Sizes added");

            KSensor.Dispose();
            this.Hide();
            UserMain2 us = new UserMain2(username);
            us.Show();
        }
Exemple #4
0
        private void LG_BUT_Click(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(connectionString);

            SqlCommand command = new SqlCommand();

            command.Connection = conn;
            conn.Open();
            command.CommandText = "Select UserType from emp where username ='******'and Password ='******' ; ";
            SqlDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                type = reader["UserType"].ToString();
            }

            if (type.Equals("A"))
            {
                this.Hide();
                AdminMain AD = new AdminMain();
                AD.Show();
            }
            else if (type.Equals("E"))
            {
                this.Hide();
                UserMain2 us = new UserMain2(UserBox.Text);
                us.Show();
            }
            else
            {
                MessageBox.Show("WRONG USERNAME OR PASSWORD");
            }



            conn.Close();
        }