Example #1
0
        public InfoContex(string strJCLSH)
        {
            DbHelper dbHelper = new DbHelper(@"JCX-server\localdb", "sa", "", "IVS_NEW");

            m_VEHICLE_DISPATCH = dbHelper.Query <VEHICLE_DISPATCH>(SqlHelper <VEHICLE_DISPATCH> .GetSearchSql(strJCLSH));
            string strSql = $"{SqlHelper<LOGIN_VEHICLE_INFO>.GetSearchSql()} WHERE VEHICLEID = '{m_VEHICLE_DISPATCH.VEHICLEID}'";

            m_LOGIN_VEHICLE_INFO = dbHelper.Query <LOGIN_VEHICLE_INFO>(strSql);
        }
Example #2
0
 private void SendMsg()
 {
     try
     {
         carInfo = new CarInfo();
         VEHICLE_DISPATCH vEHICLE_DISPATCH = dgvMain.CurrentRow.DataBoundItem as VEHICLE_DISPATCH;
         carInfo.JCLSH    = vEHICLE_DISPATCH.JCLSH;
         carInfo.sendTime = DateTime.Now;
         StreamWriter streamWriter = null;
         streamWriter = new StreamWriter(File.Open(ConfigHelper.SendTxtPath, FileMode.Create), System.Text.Encoding.GetEncoding("GBK"));
         InfoContex infoContex = new InfoContex(vEHICLE_DISPATCH.JCLSH);
         streamWriter.Write(infoContex.GetStr());
         streamWriter.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }