Exemplo n.º 1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            tssl3.Text = "现在时间:" + System.DateTime.Now.ToLongTimeString();
            string time = dbl.Remindtime();

            if (Convert.ToInt32(db.ExecuteSelect("select * from Remind where RemindTime='" + time + "'and IsRemind='是' and Statue='尚未提示'")) > 0)
            {
                DataSet ds = new DataSet();
                ds = dbl.GetDataset("select * from Remind where RemindTime='" + time + "'");
                string Reminid = Convert.ToString(ds.Tables[0].Rows[0][3]);           //获得备忘表中的备忘记录
                string type    = Convert.ToString(ds.Tables[0].Rows[0][5]);
                if (type == "一次提醒")
                {
                    db.ExeInfochange("update Remind set Statue='已经提示' where RemindTime='" + time + "'");   //更改提示的状态
                }
                if (MessageBox.Show("\n 您有新的备忘:        \n \n" + "    " + Reminid + "    ", "备忘提示", MessageBoxButtons.OK, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    fmr.Refresh();
                }
            }
        }