Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Нүүр nvvr = new Нүүр(name);

            this.Hide();
            nvvr.ShowDialog();
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (username.Text != string.Empty && password.Text != string.Empty)
            {
                SqlDataAdapter check = new SqlDataAdapter("SELECT COUNT(*) FROM dbo.employees WHERE iD='" + username.Text + "'", con);
                DataTable      dt1   = new DataTable();

                check.Fill(dt1);



                if (Int32.Parse(dt1.Rows[0][0].ToString()) != 0)
                {
                    string sql = "SELECT type FROM sys.server_principals WHERE name = '" + username.Text + "';";
                    //SqlCommand cmnd1 = new SqlCommand(sql, con);
                    SqlDataAdapter type = new SqlDataAdapter(sql, con);
                    DataTable      dt   = new DataTable(); //this is creating a virtual table
                    type.Fill(dt);
                    if (dt.Rows[0][0].ToString() == "S")
                    {
                        int a = login();
                        if (a == 0)
                        {
                            MessageBox.Show("Таны нэр эсвэл нууц үг буруу байна !!!");
                        }
                        else
                        {
                            Нүүр nvvr = new Нүүр(username.Text.ToString());
                            this.Hide();
                            nvvr.ShowDialog();
                            password.Text = "";
                        }
                    }
                    con.Close();
                }
                else
                {
                    MessageBox.Show("Таны нэр эсвэл нууц үг буруу байна !!!");
                }
            }


            else
            {
                MessageBox.Show("   Ta iD болон нууц үгээ оруулна уу !!!");
                password.Text = "";
                username.Text = "";
            }
        }
Exemplo n.º 3
0
 private void butsah_Click(object sender, EventArgs e)
 {
     Нүүр nvvr = new Нүүр(name);
     this.Hide();
     nvvr.ShowDialog();
 }