Example #1
0
        private void method_0()
        {
            Trace.Write("appserver - Thread upNewPosition, WebGpsClient_GetCurrentPosData start!");
            DataRow       row    = UpdataStruct.CloneDataTableColumn.NewRow();
            SqlDataAccess access = new SqlDataAccess();
            DateTime      dbTime = base.GetDbTime(access);

Label_0019:
            try
            {
                SqlParameter[] parameterArray = new SqlParameter[] { new SqlParameter("@ReadTime", dbTime) };
                DataTable      table          = access.getDataBySP("WebGpsClient_GetCurrentPosData", parameterArray);
                if (table != null)
                {
                    goto Label_0056;
                }
Label_004A:
                Thread.Sleep(0x7d0);
                goto Label_0019;
Label_0056:
                if (table.Rows.Count <= 0)
                {
                    goto Label_004A;
                }
                dbTime = Convert.ToDateTime(table.Rows[0]["svrTime"]);
                string      str  = string.Empty;
                string      str2 = string.Empty;
                CarInfo     dataCarInfoBySimNum = null;
                CarPartInfo info2 = new CarPartInfo();
                foreach (DataRow row2 in table.Rows)
                {
                    this.method_1(row2, row, info2);
                    str  = Convert.ToString(row2["phone"]);
                    str2 = Convert.ToString(row2["carNum"]);
                    dataCarInfoBySimNum = CarDataInfoBuffer.GetDataCarInfoBySimNum(str);
                    if (((dataCarInfoBySimNum != null) && !string.IsNullOrEmpty(str2)) && !str2.Equals(dataCarInfoBySimNum.CarNum))
                    {
                        CarDataInfoBuffer.GetDataCarInfoByCarNum(str2);
                    }
                    if (dataCarInfoBySimNum != null)
                    {
                        dataCarInfoBySimNum.CarPosData   = row.ItemArray;
                        dataCarInfoBySimNum.IsNewPosTime = dbTime;
                    }
                }
                Thread.Sleep(20);
                goto Label_0019;
            }
            catch (Exception exception)
            {
                Thread.Sleep(0xbb8);
                LogHelper helper = new LogHelper();
                ErrorMsg  msg    = new ErrorMsg("UpdataNewPosition", helper.GetCallFunction(), helper.GetExceptionMsg(exception));
                helper.WriteError(msg);
                goto Label_0019;
            }
        }
Example #2
0
        private CarInfo method_3(CmdParam.ParamType paramType, string str)
        {
            //修改类型判断
            switch (paramType)
            {
            case CmdParam.ParamType.CarNum:
                return(CarDataInfoBuffer.GetDataCarInfoByCarNum(str));

            case CmdParam.ParamType.CarId:
                return(CarDataInfoBuffer.GetDataCarInfoByCarId(str));

            case CmdParam.ParamType.SimNum:
                return(CarDataInfoBuffer.GetDataCarInfoBySimNum(str));
            }
            return(null);
        }
Example #3
0
        /// <summary>
        /// 添加客户端最新日志
        /// </summary>
        /// <param name="OrderID"></param>
        /// <param name="carNum"></param>
        /// <param name="strType"></param>
        /// <param name="strOrderCode"></param>
        /// <param name="strResult"></param>
        /// <param name="strMode"></param>
        /// <param name="strInfo"></param>
        /// <param name="strLon"></param>
        /// <param name="strLat"></param>
        /// <param name="strAcc"></param>
        /// <param name="speed"></param>
        /// <param name="IsFill"></param>
        /// <param name="GpsValid"></param>
        /// <param name="CarId"></param>
        /// <param name="Direct"></param>
        /// <param name="ReceTime"></param>
        /// <param name="GpsTime"></param>
        public void AddCarNewLogData(int OrderID, string carNum, string strType, string strOrderCode, string strResult, string strMode, string strInfo, string strLon, string strLat, string strAcc, string speed, string IsFill, string GpsValid, string CarId, int Direct, string ReceTime, string GpsTime)
        {
            this.initData();
            DataRow row = UpdataStruct.CloneDataTableColumn.NewRow();

            if (string.IsNullOrEmpty(CarId))
            {
                CarInfo dataCarInfoByCarNum = CarDataInfoBuffer.GetDataCarInfoByCarNum(carNum);
                if (dataCarInfoByCarNum != null)
                {
                    row["CarId"]  = dataCarInfoByCarNum.CarId;
                    row["SimNum"] = dataCarInfoByCarNum.SimNum;
                }
            }
            else
            {
                row["CarId"] = CarId;
            }
            row["GpsTime"]  = GpsTime;
            row["ReceTime"] = ReceTime;
            if (string.IsNullOrEmpty(GpsTime) || string.IsNullOrEmpty(ReceTime))
            {
                row["ReceTime"] = row["GpsTime"] = base.GetDBCurrentDateTime();
            }
            row["OrderID"]     = OrderID;
            row["CarNum"]      = carNum;
            row["OrderType"]   = strType;
            row["OrderName"]   = strOrderCode;
            row["msgType"]     = -1;
            row["OrderResult"] = strResult;
            row["CommFlag"]    = strMode;
            row["Describe"]    = strInfo;
            row["Longitude"]   = strLon;
            row["Latitude"]    = strLat;
            row["AccOn"]       = strAcc;
            row["Speed"]       = speed;
            row["IsFill"]      = IsFill;
            row["GpsValid"]    = GpsValid;
            row["Direct"]      = Direct;
            this.arrayList_CarNewLogData.Add(row.ItemArray);
        }