Example #1
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            try
            {
                string x = Encrypt(txtpass.Text);
                //MessageBox.Show(x);
                string           connectionString = "datasource=127.0.0.1;port=3306;username=root;password=;database=ugcnew";
                MySqlConnection  ugccon           = new MySqlConnection(connectionString);
                string           query1           = "select * from investment_table where EmployeeID='" + txtid.Text.Trim() + "' and Password='******'";
                MySqlDataAdapter sda1             = new MySqlDataAdapter(query1, ugccon);

                DataTable dtb1 = new DataTable();
                sda1.Fill(dtb1);

                if (dtb1.Rows.Count == 1)
                {
                    this.timer1.Start();
                    MessageBox.Show("Welcome !. Press OK to continue");
                    this.Hide();
                    investment1 i1 = new investment1();

                    i1.Show();

                    //MessageBox.Show(Encrypt(txtpass.Text));
                }

                else
                {
                    this.timer1.Start();
                    MessageBox.Show(" Please Check your Employee Id and password");
                    clear();
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Example #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            investment1 in1 = new investment1();

            in1.Show();
        }