Exemplo n.º 1
0
        private List <KeyValuePair <string, string> > built() // 输出 地址 时间
        {
            List <KeyValuePair <string, string> > list = new List <KeyValuePair <string, string> >();
            LingTaskQueuer ling = lingTaskQueue.getLingTaskQueuer();

            for (int i = 0, j = ling.Size(); i < j; i++)
            {
                KeyValuePair <DateTime, string> at = ling.At(i);
                MysqlContentTool.Ins.ConnStr = "server=127.0.0.1;port=3306;user=root;password=1111111111a; database=uisrnns;";
                string sql = @"select Location from cnt_bell where RouterID=(select RouterID from cnt_router where IP=@ip)";
                List <MySqlParameter> Paramter = new List <MySqlParameter>();
                Paramter.Add(new MySqlParameter("@ip", at.Value));

                DataSet dt  = MysqlContentTool.Ins.ExecuteDataSet(sql, Paramter.ToArray());
                string  msg = (dt.Tables[0].Rows[0])[dt.Tables[0].Columns[0]].ToString();


                list.Add(new KeyValuePair <string, string>(msg, at.Key.ToString()));
            }

            return(list);
        }
Exemplo n.º 2
0
        private void skinButton2_Click(object sender, EventArgs e)
        {
            if (redel == true)
            {
                LingTaskQueuer ling = lingTaskQueue.getLingTaskQueuer();
                ///
                if (tp.Count == 0)
                {
                    ling.delindex(int.Parse(skinTextBox1.Text) - 1);
                }
                else
                {
                    string s1 = skinDataGridView1.Rows[int.Parse(skinTextBox1.Text) - 1].Cells[0].Value.ToString();
                    string s2 = skinDataGridView1.Rows[int.Parse(skinTextBox1.Text) - 1].Cells[1].Value.ToString();
                    List <KeyValuePair <string, string> > b = built();
                    int index = b.IndexOf(new KeyValuePair <string, string>(s1, s2));
                    ling.delindex(index);
                }


                lingTaskQueue.setLingTaskQueuer(ling);
            }
            else
            {
                lingTaskQueue.stop();
                lingTaskQueue.getLingTaskQueuer().delall();

                List <KeyValuePair <DateTime, string> > queues = new List <KeyValuePair <DateTime, string> >();
                for (int i = 0, j = controlDataGridView.getRownum(); i < j; ++i)
                {
                    queues.Add(new KeyValuePair <DateTime, string>(Convert.ToDateTime(this.skinDataGridView1.Rows[i].Cells[1].Value.ToString()), this.skinDataGridView1.Rows[i].Cells[2].Value.ToString()));
                }
                lingTaskQueue.setLingQueuer(queues);

                lingTaskQueue.start();
            }

            skinButton1_Click(sender, e);
        }
Exemplo n.º 3
0
 public void setLingTaskQueuer(LingTaskQueuer lingTaskQueuer)
 {
     this.ling = lingTaskQueuer;
 }