Beispiel #1
0
        private void btnBack_Click_1(object sender, EventArgs e)
        {
            Mainfrom mainfrm = new Mainfrom();

            mainfrm.Show();
            this.Dispose();
        }
Beispiel #2
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            this.Dispose();
            Mainfrom mainformObj = new Mainfrom();

            mainformObj.Show();
        }
Beispiel #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Dispose();
            Mainfrom mainfrm = new Mainfrom();

            mainfrm.Show();
        }
Beispiel #4
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            if (txtpassword.Text != "" && txtUsername.Text != "")
            {
                SqlCommand cmd = new SqlCommand("select * from Admin where AdminName='" + txtUsername.Text + "'and AdminPassword='******'", MethodClassObj.sc);
                MethodClassObj.sc.Open();
                cmd.ExecuteNonQuery();
                SqlDataReader dr = cmd.ExecuteReader();
                dr.Read();
                if (dr.HasRows)
                {
                    MethodClassObj.sc.Close();
                    MessageBox.Show("Well Come");
                    insrt_trail();
                    txtpassword.Text = txtUsername.Text = null;
                    label3.Visible   = false;
                    label4.Visible   = false;
                    Mainfrom mainfrom = new Mainfrom();
                    mainfrom.Show();
                    this.Dispose();
                }
                else
                {
                    MessageBox.Show("User Name or Password  Does Not Exist", "Invalid User or Password", MessageBoxButtons.OK, MessageBoxIcon.None);

                    txtpassword.Text = txtUsername.Text = null;
                    label3.Visible   = true;
                    label4.Visible   = true;
                    MethodClassObj.sc.Close();
                }
            }
            else
            {
                MessageBox.Show("Please Input User Name or Password", "Fileds Empty", MessageBoxButtons.OK, MessageBoxIcon.None);
                if (txtUsername.Text == "" && txtpassword.Text == "")
                {
                    label3.Visible = true;
                    label4.Visible = true;
                }
                MethodClassObj.sc.Close();
            }
        }