Beispiel #1
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (i == 0)
     {
         timer1.Enabled = false;
         timer1.Stop();
         login sf = new login();
         sf.Show();
         this.Hide();
     }
     else
     {
         i = i - 1;
     }
     lblCountDwn.Text = "Countdown ..... " + i.ToString();
 }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string[] lines = File.ReadAllLines(@"C:\Users\MAHE\documents\visual studio 2015\Projects\WindowsFormsApplication1\WindowsFormsApplication1\user.txt");

            for (int i = 0; i < lines.Length; i++)
            {
                line = lines[i];
                if (line.Equals(login_name))
                {
                    i = lines.Length;

                    if (flag == 1)
                    {
                        flag = 0; f = 1;
                        MessageBox.Show("Authenticated for player 1, now login/signup for player 2.");
                        var home = new home();
                        home.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Authenticated for both players, now let the games begin");
                        var khelshuru = new khelshuru();
                        f = 0;
                        khelshuru.Show();
                        this.Hide();
                    }
                }
            }
            if (f == 1 && flag != 0)
            {
                MessageBox.Show("Not Authenticated,try again");
                var login = new login();
                login.Show();
                this.Hide();
            }
        }
 private void closeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //START SHOW SIGN IN FORM
     login login = new login();
     login.Show();
     //END SHOW SIGN IN FORM
     this.Close();
 }
Beispiel #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            login sf = new login();
            this.Hide();

            sf.Show();
        }
Beispiel #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form frm2 = new login();

            frm2.Show();
        }
Beispiel #6
0
        private void bckbtmfrmqa_Click(object sender, EventArgs e)
        {
            login frm = new login();

            frm.Show();
        }
Beispiel #7
0
 private void salirToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var form = new login();
     form.Show();
     Hide();
 }
        private void signup_Click(object sender, EventArgs e)
        {
            string        connetionString;
            SqlConnection cnn;

            connetionString = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\ITECH\Desktop\HRMIS PA\HRMIS\HRMIS\Database1.mdf;Integrated Security=True";
            cnn             = new SqlConnection(connetionString);
            cnn.Open();
            if (txtadd.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtname.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            else if (txtpword.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtuname.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtcpword.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtposition.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (txtID.Text == "")
            {
                MessageBox.Show("Input your Personal Information", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                SqlCommand     cmd = new SqlCommand("Select * from tblAccount where uname = '" + txtuname.Text + "'", cnn);
                SqlDataAdapter da  = new SqlDataAdapter(cmd);
                DataSet        ds  = new DataSet();
                DataTable      dt  = new DataTable();
                da.Fill(ds);

                int i = ds.Tables[0].Rows.Count;
                if (i > 0)
                {
                    MessageBox.Show("Username:"******" is already exist.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    if (txtcpword.Text == txtpword.Text)
                    {
                        try
                        {
                            string     sql    = "INSERT INTO tblAccount (name,address,position,uname,pword,confirmpword,Id_no) values ('" + txtname.Text + "','" + txtadd.Text + "','" + txtposition.Text + "','" + txtuname.Text + "','" + txtpword.Text + "','" + txtcpword.Text + "','" + txtID.Text + "')";
                            SqlCommand exesql = new SqlCommand(sql, cnn);
                            exesql.ExecuteNonQuery();
                            MessageBox.Show("Account Registered", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            cnn.Close();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        this.Hide();
                        login f2 = new login();
                        f2.Show();
                    }

                    else
                    {
                        MessageBox.Show("Password not Match", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
        }