private void testTempWriteData() { LW = new List<WriteData>(); WriteData wd = new WriteData(); wd.Append("4", "E01501587145881C", "0011223344556677");// new DateTime(2012, 9, 9), new DateTime(2012, 1, 1)); LW.Add(wd); }
/// <summary> /// /// </summary> /// <param name="hs"> dt.Columns.Add("id"); //dt.Columns.Add("Zero"); //dt.Columns.Add("RFIDID"); //dt.Columns.Add("RFIDNO"); ///////////////////dt.Columns.Add("CheckDate"); //dt.Columns.Add("Birth");</param> /// <returns></returns> public void WriteRFIDData() { //throw new NotImplementedException(); foreach (DictionaryEntry de in xHs)//获取同一个分区中的数据 { //数据拆分出来,等待写入 //写数据 DataTable dt = (DataTable)de.Value; foreach (DataRow dr in dt.Rows) { if (LW.Count > 0) { if (((WriteData)LW[LW.Count - 1]).State <= 1) { ((WriteData)LW[LW.Count - 1]).Append(dr[0].ToString(), dr[2].ToString(), dr[3].ToString());//, DateTime.Parse(dr[4].ToString()), DateTime.Parse(dr[4].ToString())); continue; } } WriteData wd = new WriteData(); wd.Append(dr[0].ToString(), dr[2].ToString(), dr[3].ToString());//, DateTime.Parse(dr[4].ToString()), DateTime.Parse(dr[4].ToString())); LW.Add(wd); } xHs.Remove(de.Key); //发送指令 byte[] bb = WriteByteFormat(int.Parse(de.Key.ToString()) - 1); sp.Write(bb, 0, 128 + 5); command = CMD.Write; bControl = false; break; } }