Exemplo n.º 1
0
        private void label1_Click(object sender, EventArgs e)
        {
            this.Hide();
            mainform mf = new mainform();

            mf.ShowDialog();
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            {
                var data = DBconnection.gettablebyquery("Select * from userid where UserName='******' and Password='******'");
                if (data.Rows.Count > 0)
                {
                    CommonInfo.UserId    = (int)data.Rows[0]["UserId"];
                    CommonInfo.StaffName = data.Rows[0]["StaffName"].ToString();
                    CommonInfo.Email     = data.Rows[0]["Email"].ToString();
                    CommonInfo.UserName  = data.Rows[0]["UserName"].ToString();
                    CommonInfo.Password  = txtpswrd.Text;
                    CommonInfo.Telephone = data.Rows[0]["Telephone"].ToString();
                    mainform mf = new mainform();
                    mf.ShowDialog();
                }

                else
                {
                    MessageBox.Show("username password doesnot match .");
                    txtpswrd.Focus();
                    txtpswrd.SelectAll();
                    //password error message
                }
            }
        }