private void notify_save() { DeviceInfoModel devInfo = new DeviceInfoModel { IDCardNo = idNo }; devInfo.UpdateData = DateTime.Now.ToString(); bool flag = TranslateClsResult.TranslateToModel(devInfo, this.baseInfo); DeviceInfoBLL deviceinfo2 = new DeviceInfoBLL(); if (!flag) { try { if (deviceinfo2.Add(devInfo) != 0) { TranslateClsResult.set_tj_content(devInfo); } } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } } }
private void clsTrans_SendMsgNt(string msg) { if (!this.m_IsLogIn) { if (msg.Contains("TRANSEND") || (msg == "ERROR")) { new MessageForm("非会员用户测量数据无效") { StartPosition = FormStartPosition.CenterScreen }.ShowDialog(); Thread.Sleep(500); } } else { bool flag1 = msg == "UNKNOWN"; if (msg.Contains("CONNECT")) { this.g_bt = Guid.NewGuid(); this.WriteComPort(string.Format("{0} reading", msg.Substring(msg.Length - 2, 2))); } if (msg == "ERROR") { base.Invoke(new Action <string, string>(this.run_notify_window), new object[] { ClsResult.DeviceName, "接收数据失败!" }); } if ((msg == "TRANSEND") && ClsResult.ResultFlag) { try { string str = !(ClsResult.DeviceName == "QCTBE") ? TranslateClsResult.TranslateToStr() : "(查看)"; ClsMsgWindow.SendDeviceInfo(ClsResult.DeviceName + ";BT"); base.Invoke(new Action <string, string>(this.run_notify_window), new object[] { TranslateClsResult.GetDeviceCName(ClsResult.DeviceName), str }); this.notify_save(); this.WriteComPort(string.Format("{0} successed", ClsResult.DeviceName.Substring(3, 2))); } catch (Exception ex) { ErrorLog.WriteLog(ex.ToString()); } } } }