コード例 #1
0
        private void Button15_Click(object sender, EventArgs e)
        {
            UserReport u1 = new UserReport();

            this.Hide();
            u1.Show();
        }
コード例 #2
0
 private void Button7_Click(object sender, EventArgs e)
 {
     try
     {
         m.Close();
         m.Open();
         SqlCommand cmd = new SqlCommand("delete from [dbo].[user] where Uid='" + textBox1.Text + "'", m);
         int        a   = cmd.ExecuteNonQuery();
         if (a > 0)
         {
             MessageBox.Show("Deleted");
             textBox1.Clear();
             this.Hide();
             UserReport f1 = new UserReport();
             f1.Show();
         }
         else
         {
             MessageBox.Show("Invalid");
         }
         m.Close();
     }
     catch
     {
     }
 }
コード例 #3
0
        private void Button8_Click(object sender, EventArgs e)
        {
            try
            {
                m.Close();
                m.Open();
                SqlCommand cmd = new SqlCommand("update [dbo].[user] set Uname = '" + textBox2.Text + "', Phone = '" + textBox3.Text + "', Email = '" + textBox4.Text + "', Address = '" + textBox5.Text + "', Position = '" + textBox6.Text + "'  where Uid='" + textBox1.Text + "'", m);
                int        a   = cmd.ExecuteNonQuery();
                if (a > 0)
                {
                    MessageBox.Show("Updated");
                    textBox1.Clear();
                    textBox2.Clear();
                    textBox3.Clear();
                    textBox4.Clear();
                    textBox5.Clear();
                    textBox6.Clear();

                    this.Hide();
                    UserReport f1 = new UserReport();
                    f1.Show();
                }
                else
                {
                    MessageBox.Show("Invalid");
                }
                m.Close();
            }
            catch
            {
                MessageBox.Show("Error!!");
            }
        }