예제 #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            admin_view adp = new admin_view();

            this.Hide();
            adp.Show();
        }
예제 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (ad_id.Text == "")
     {
         ad_id.BackColor = Color.Red;
         MessageBox.Show("Admin ID field must be filled!", "Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
         ad_id.Focus();
         return;
     }
     if (new_un.Text == "")
     {
         new_un.BackColor = Color.Red;
         MessageBox.Show("Please Enter User Name!", "Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
         new_un.Focus();
         return;
     }
     if (confirm_un.Text == "")
     {
         confirm_un.BackColor = Color.Red;
         MessageBox.Show("Please Fill Confirm User Name Field!", "Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
         confirm_un.Focus();
         return;
     }
     if (ad_id.Text != "" && new_un.Text != "" && confirm_un.Text != "")
     {
         try
         {
             if (state.Admin_login_id == Convert.ToInt32(ad_id.Text))
             {
                 if (new_un.Text == confirm_un.Text)
                 {
                     con.Open();
                     string     qry = "update admin set user_name='" + new_un.Text + "'where admin_id='" + Convert.ToInt32(ad_id.Text) + "'";
                     SqlCommand cmd = new SqlCommand(qry, con);
                     cmd.ExecuteNonQuery();
                     con.Close();
                     ad_id.Text      = "";
                     new_un.Text     = "";
                     confirm_un.Text = "";
                     MessageBox.Show("User Name Changed successfully!", "User Name Changed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     admin_view adp = new admin_view();
                     this.Hide();
                     adp.Show();
                 }
                 else
                 {
                     MessageBox.Show("User Name not matched.");
                 }
             }
             else
             {
                 MessageBox.Show("Admin ID Incorrect.");
             }
         }
         catch (SqlException ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
        private void backToolStripMenuItem_Click(object sender, EventArgs e)
        {
            admin_view b = new admin_view();

            b.Show();
            this.Hide();
        }
예제 #4
0
        private void btn_back_Click(object sender, EventArgs e)
        {
            admin_view b = new admin_view();

            b.Show();
            this.Hide();
        }
        private void logoutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            admin_view av = new admin_view();

            this.Hide();
            av.ShowDialog();
            this.Close();
        }
예제 #6
0
        private void logoutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //admin_view av = new admin_view();
            //av.Show();
            //this.Hide();
            admin_view b = new admin_view();

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