private void cmdok_Click(object sender, EventArgs e) { this.Hide(); if (Static_class.con.State != ConnectionState.Open) { Static_class.con.Open(); } //msql = " select SEC from TBLUSR where username='******'"; //cmd = new SqlCommand(msql, Static_class.con); //Static_class.sector = cmd.ExecuteScalar().ToString(); //msql = " select SUF from TBLUSR where username='******'"; //cmd = new SqlCommand(msql, Static_class.con); //Static_class.suffix = cmd.ExecuteScalar().ToString(); //if (Static_class.con.State != ConnectionState.Closed) Static_class.con.Close(); MainFrm mainfrm = new MainFrm(); mainfrm.ShowDialog(); }
private void cmdok_Click(object sender, EventArgs e) { int pos = TBLUSR_Table.Rows.IndexOf(TBLUSR_Table.Rows.Find(nm.Text)); string pw = TBLUSR_Table.Rows[pos]["password"].ToString(); if (pw != txtpassword.Text) { MessageBox.Show("كلمة مرور غيرمعرفة من قبل", "دخول خطا", MessageBoxButtons.OK, MessageBoxIcon.Hand); this.ActiveControl = txtpassword; txtpassword.SelectAll(); } else { Static_class.muser = nm.Text; MainFrm mainfrm = new MainFrm(); mainfrm.ShowDialog(); } }