private void button4_Click(object sender, EventArgs e)
        {
            this.Hide();
            AdminSettings ast = new AdminSettings(this.loginUserName);

            ast.Show();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (blc.IsExistAdmin(textBox1.Text))
            {
                MessageBox.Show("Admin with same User Name already exist.\nPlease use another UserName.");
            }
            else if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "" || textBox6.Text == "" ||
                     textBox7.Text == "" || textBox8.Text == "")
            {
                MessageBox.Show("Please fill all the information correctly.");
            }
            else if (textBox1.Text.Length != 8)
            {
                MessageBox.Show("Please use 8 character for a User Name.");
            }
            else
            {
                blc.AddAdmin(textBox1.Text, textBox2.Text, textBox3.Text, textBox8.Text, textBox4.Text, textBox5.Text, textBox7.Text, textBox6.Text);
                this.Hide();
                AdminSettings obj = new AdminSettings(loginUserName);
                obj.Show();

                MessageBox.Show("Admin added successfully.");
            }
        }
Ejemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (label27.Text == "admin123")
            {
                MessageBox.Show("Can not delete primary admin.");
            }
            else
            {
                DialogResult result = MessageBox.Show("Are you sure to dlete this admin?", "Confirmation", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

                if (label27.Text == loginUserName)
                {
                    if (result == DialogResult.Yes)
                    {
                        blc.DeleteAdmin(label27.Text);
                        this.Hide();
                        Start obj = new Start();
                        obj.Show();
                        MessageBox.Show("Admin deleted successfully.");
                    }
                }
                else
                {
                    if (result == DialogResult.Yes)
                    {
                        blc.DeleteAdmin(label27.Text);
                        this.Hide();
                        AdminSettings obj = new AdminSettings("admin123");
                        obj.Show();
                        MessageBox.Show("Admin deleted successfully.");
                    }
                }
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            AdminSettings obj = new AdminSettings(loginUserName);

            obj.Show();
        }
Ejemplo n.º 5
0
 private void button3_Click(object sender, EventArgs e)
 {
     if ((label27.Text != loginUserName && loginUserName == "admin123") || (loginUserName == "admin123"))
     {
         this.Hide();
         AdminSettings obj = new AdminSettings("admin123");
         obj.Show();
     }
     else //if(label6.Text != loginUserName)
     {
         this.Hide();
         AdminSettings obj = new AdminSettings(loginUserName);
         obj.Show();
     }
 }