Exemple #1
0
 private void bunifuThinButton23_Click(object sender, EventArgs e)
 {
     if (this.user.text.ToString() != null)
     {
         SqlConnection con = new SqlConnection(conString);
         con.Open();
         if (con.State == System.Data.ConnectionState.Open)
         {
             string         q    = "select * from Users Where username = '******'";
             SqlCommand     cmd  = new SqlCommand(q, con);
             SqlDataAdapter sda  = new SqlDataAdapter(q, con);
             DataTable      dtbl = new DataTable();
             sda.Fill(dtbl);
             if (dtbl.Rows.Count == 1)
             {
                 MoleShooter ms = new MoleShooter(this.user.text.ToString());
                 this.Visible = false;
                 ms.Visible   = true;
             }
             else
             {
                 MessageBox.Show("Хэрэглэгчийн нэр бүртгэлгүй байна!");
             }
         }
     }
     else
     {
         MessageBox.Show("Хоосон талбар байна!");
     }
 }
Exemple #2
0
        private void bunifuThinButton21_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(conString);

            con.Open();
            if (con.State == System.Data.ConnectionState.Open)
            {
                string     q   = "insert into Users(username) Values('" + username.text.ToString() + "')";
                SqlCommand cmd = new SqlCommand(q, con);
                cmd.ExecuteNonQuery();
                MessageBox.Show("Successful");


                MessageBox.Show("Сайн байна уу " + username.text.ToString() + " Ангийн улиралд тавтай морил ");

                MoleShooter ms = new MoleShooter(username.text.ToString());
                this.Visible = false;
                ms.Visible   = true;
            }

            //custom_dialog.ShowDialog("New Score!!");
        }