Exemplo n.º 1
0
        public void Save(string a, string b)
        {
            SqlNote  sql = new SqlNote();
            DateTime r   = DateTime.Now.ToLocalTime();
            string   d   = "insert into Note values ('" + a + "','" + b + "','" + r + "')";

            if (sql.ExecuteSQL(d))
            {
                MessageBox.Show("同步上传到数据库成功!!!");
            }
        }
Exemplo n.º 2
0
        public void Login(string a, string b)
        {
            SqlNote sql = new SqlNote();
            string  c   = "select count(*) from Login where Login_Name = '" + a + "'and Login_Password = '******'";

            if (sql.GetCount(c) > 0)
            {
                FormMain f = new FormMain();
                f.Show();
                //this.Hide();
            }
            else
            {
                MessageBox.Show("用户账号、密码错误!!!");
            }
        }
Exemplo n.º 3
0
        public void Register(string a, string b)
        {
            SqlNote sql = new SqlNote();
            string  c   = "select count(*) from Login where Login_Name = '" + a + "'";

            if (sql.GetCount(c) > 0)
            {
                MessageBox.Show("用户名重复!!!");
            }
            else
            {
                string d = "insert into Login values ('" + a + "','" + b + "')";
                if (sql.ExecuteSQL(d))
                {
                    MessageBox.Show("注册成功");
                }
            }
        }
Exemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            SqlNote       sql = new SqlNote();
            SqlConnection cn  = new SqlConnection("Data Source=OPPAI;Initial Catalog=NoteBook;Integrated Security=True");
            SqlCommand    com = new SqlCommand("select Note_PathName from Note where Note_Notes = '" + a + "'", cn);

            cn.Open();
            string g = com.ExecuteScalar().ToString();

            cn.Close();
            string c = "delete from Note where Note_PathName = '" + g + "'";

            if (sql.ExecuteSQL(c))
            {
                string f = "select * from Note";
                dataGridView1.DataSource = sql.GetDataTable(f);
            }
        }