Beispiel #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (textBox2.Text.Length == 0 || textBox3.Text.Length == 0)
            {
                MessageBox.Show("Please filled all the field properly", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else
            {
                ai.UFirstName = textBox2.Text;
                ai.ULastName  = textBox3.Text;
                UpdateDBlink ul = new UpdateDBlink();
                string       x  = ul.UpdateAdmin(textBox1.Text, textBox2.Text, textBox3.Text);
                MessageBox.Show(x);


                AdminHome h = new AdminHome(ai);
                h.Show();
                this.Visible = false;



                button1.Show();
                button3.Hide();
                this.disableA();
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox2.Text.Length <= 3)
            {
                MessageBox.Show("Password is too short !", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                textBox2.Text = "";
                textBox3.Text = "";
                textBox2.Select();
            }
            if (textBox1.Text.Length == 0 || textBox2.Text.Length == 0 || textBox3.Text.Length == 0)
            {
                MessageBox.Show("Fillup All Text Boxs", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                if (textBox2.Text != textBox3.Text)
                {
                    MessageBox.Show("Enter Valid password", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    UpdateDBlink ul = new UpdateDBlink();
                    string       x  = ul.UpdateUserPassword(textBox1.Text, textBox2.Text, textBox3.Text);
                    MessageBox.Show(x);

                    UserHome uh = new UserHome(ui);
                    uh.Show();
                    this.Visible = false;
                }
            }
        }
        public AddAdmin(AdminInfo ai)
        {
            this.ai = ai;
            InitializeComponent();
            UpdateDBlink db = new UpdateDBlink();

            textBox1.Text = Convert.ToString(db.getLatAdminId() + 1);
        }
        private void textBox2_Leave(object sender, EventArgs e)
        {
            UpdateDBlink ul = new UpdateDBlink();

            u  = ul.getUser(textBox2.Text);
            ai = ul.getAdmin(textBox2.Text);
            if (textBox2.Text == u.Name || textBox2.Text == ai.UName)
            {
                MessageBox.Show("Invalid Username", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textBox2.Text = "";
                textBox2.Select();
            }
        }
Beispiel #5
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (textBox7.Text.Length == 0 || textBox8.Text.Length == 0 || textBox9.Text.Length == 0 || textBox12.Text.Length == 0 || textBox10.Text.Length == 0 || textBox11.Text.Length == 0 || comboBox1.Text.Length == 0 || comboBox2.Text.Length == 0)
     {
         MessageBox.Show("Please filled all the field properly", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
     else
     {
         UpdateDBlink ul = new UpdateDBlink();
         string       x  = ul.UpdateProduct(textBox7.Text, textBox8.Text, textBox9.Text, textBox12.Text, textBox10.Text, textBox11.Text, comboBox1.Text, comboBox2.Text);
         MessageBox.Show(x);
         button2.Show();
         button4.Hide();
         this.disableP();
     }
 }
Beispiel #6
0
 private void textBox1_Leave(object sender, EventArgs e)
 {
     if (textBox1.Text == "")
     {
         textBox1.Text = "Enter Your User Name Here";
     }
     else
     {
         UpdateDBlink ul = new UpdateDBlink();
         u = ul.getUser(textBox1.Text);
         if (textBox1.Text == u.Name)
         {
             MessageBox.Show("Invalid Username", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             textBox1.Text = "";
             textBox1.Select();
         }
     }
 }
Beispiel #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            UpdateDBlink ul = new UpdateDBlink();

            ai = ul.getAdmin(textBox1.Text);

            string pass;

            if (textBox1.Text == ai.UName && ai.UStatus == "Admin")
            {
                if (textBox2.Text == ai.Pword)
                {
                    /* HomeAdmin h = new HomeAdmin(ai);
                     * h.Show();
                     * this.Visible = false;
                     */
                    AdminHome h = new AdminHome(ai);
                    h.Show();
                    this.Visible = false;
                }
                else
                {
                    MessageBox.Show("Wrong Password or Username", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                ui   = ul.getUser(textBox1.Text);
                pass = ul.getPassword(textBox1.Text);

                if (textBox2.Text == pass)
                {
                    UserHome h = new UserHome(ui);
                    h.Show();
                    this.Visible = false;
                }
                else
                {
                    MessageBox.Show("Wrong Password or Username", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
 private void textBox1_Leave(object sender, EventArgs e)
 {
     if (textBox1.Text == "")
     {
         textBox1.Text = "Enter current password Here";
     }
     else
     {
         UpdateDBlink ul = new UpdateDBlink();
         string       pa = ul.getPassword(textBox1.Text);
         if (textBox1.Text == pa)
         {
             MessageBox.Show("current password matched", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         }
         else
         {
             MessageBox.Show("Enter valid current password", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             textBox1.Text = "";
             textBox1.Select();
         }
     }
 }