Exemple #1
0
        private int method_1(int int_0, int int_1, string string_0)
        {
            SqlParameter[] parameterArray = new SqlParameter[] { new SqlParameter("@wrkid", int_0), new SqlParameter("@carid", string_0), new SqlParameter("@flg", int_1) };
            int            num            = 0;

            try
            {
                new SqlDataAccess().insertBySp("WebGpsClient_WatchCarInfo", parameterArray);
                if (int_1 == 0)
                {
                    CarInfo info = CarDataInfoBuffer.GetDataCarInfoByCarId(string_0);
                    if (info != null)
                    {
                        this.AddCarFilterList(info);
                    }
                    return(num);
                }
                CarInfo dataCarInfoByCarId = CarDataInfoBuffer.GetDataCarInfoByCarId(string_0);
                if (dataCarInfoByCarId != null)
                {
                    this.RomoveCarFilterList(dataCarInfoByCarId.SimNum);
                }
            }
            catch
            {
                num = -1;
            }
            return(num);
        }
Exemple #2
0
        public void UpdateAlarmFlag(bool bool_0, string string_0, object[] object_0)
        {
            CarInfo dataCarInfoByCarId = CarDataInfoBuffer.GetDataCarInfoByCarId(string_0);

            dataCarInfoByCarId.isAlarm      = bool_0;
            dataCarInfoByCarId.CarAlarmData = object_0;
        }
Exemple #3
0
        public Hashtable GpsCarFilterToHashTable(int int_0)
        {
            SqlParameter[] parameterArray = new SqlParameter[] { new SqlParameter("@workId", int_0) };
            DataTable      table          = new SqlDataAccess().getDataBySP("WebGpsClient_GetCarFilter", parameterArray);
            Hashtable      hashtable      = new Hashtable();

            if (hashtable.Count > 0)
            {
                hashtable.Clear();
            }
            CarFilterInfo info = null;

            foreach (DataRow row in table.Rows)
            {
                if (row["simNum"] != DBNull.Value)
                {
                    info = new CarFilterInfo {
                        SimNum      = Convert.ToString(row["simNum"]),
                        CarInfoData = CarDataInfoBuffer.GetDataCarInfoBySimNum(info.SimNum)
                    };
                    if (info.CarInfoData != null)
                    {
                        info.PosReadTime = info.CarInfoData.IsNewPosTime;
                        info.PicReadTime = info.CarInfoData.IsNewPicTime;
                        hashtable.Add(info.SimNum, info);
                    }
                }
            }
            return(hashtable);
        }
Exemple #4
0
 private void method_4(DataTable dataTable_0)
 {
     lock (this.hashtable_0.SyncRoot)
     {
         if (this.hashtable_0.Count > 0)
         {
             this.hashtable_0.Clear();
         }
         CarFilterInfo info = null;
         foreach (DataRow row in dataTable_0.Rows)
         {
             if (row["simNum"] != DBNull.Value)
             {
                 info = new CarFilterInfo
                 {
                     SimNum      = Convert.ToString(row["simNum"]),
                     CarInfoData = CarDataInfoBuffer.GetDataCarInfoBySimNum(Convert.ToString(row["simNum"]))
                 };
                 if (info.CarInfoData != null)
                 {
                     info.PosReadTime = info.CarInfoData.IsNewPosTime;
                     info.PicReadTime = info.CarInfoData.IsNewPicTime;
                     this.hashtable_0.Add(info.SimNum, info);
                 }
             }
         }
     }
 }
Exemple #5
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;
            }
        }
Exemple #6
0
        private bool method_1(string string_1)
        {
            bool flag = true;

            if (CarDataInfoBuffer.GetDataCarInfoBySimNum(string_1) == null)
            {
                flag = false;
            }
            return(flag);
        }
Exemple #7
0
        private CarFilterInfo method_0(string string_0)
        {
            string simNum = CarDataInfoBuffer.GetDataCarInfoByCarId(string_0).SimNum;

            if ((this.hashtable_0 != null) && this.hashtable_0.ContainsKey(simNum))
            {
                return(this.hashtable_0[simNum] as CarFilterInfo);
            }
            return(null);
        }
Exemple #8
0
        private bool method_2(string string_1, string string_2)
        {
            bool    flag = true;
            CarInfo dataCarInfoBySimNum = CarDataInfoBuffer.GetDataCarInfoBySimNum(string_1);

            if (((dataCarInfoBySimNum != null) && !string.IsNullOrEmpty(dataCarInfoBySimNum.Password)) && !dataCarInfoBySimNum.Password.Equals(string_2))
            {
                flag = false;
            }
            return(flag);
        }
Exemple #9
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);
        }
Exemple #10
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);
        }
Exemple #11
0
        /// <summary>
        /// 初始化程序数据,开启线程
        /// </summary>
        public static void AppInitDataAndStarRun()
        {
            try
            {
                CarDataInfoBuffer.LoadAllCarInfoList();
            }
            catch (Exception exception)
            {
                ErrorMsg msg = new ErrorMsg("BussinessHelper", "StartRun", "车辆缓存信息加载错误:" + exception.Message);
                new LogHelper().WriteError(msg);

                Thread.Sleep(0x1388);
            }
            try
            {
                CarAlarmType.LoadAllCarAlarmTypeList();
            }
            catch (Exception exception2)
            {
                ErrorMsg msg2 = new ErrorMsg("BussinessHelper", "StartRun", "报警类型数据加载错误:" + exception2.Message);
                new LogHelper().WriteError(msg2);
                Thread.Sleep(0x1388);
            }
            try
            {
                AlamStatus.LoadAllAlarmStatu();
            }
            catch (Exception exception3)
            {
                ErrorMsg msg3 = new ErrorMsg("BussinessHelper", "StartRun", "报警状态数据加载错误:" + exception3.Message);
                new LogHelper().WriteError(msg3);
                Thread.Sleep(0x1388);
            }
            upNewPosition.Start();
            upResponse.Start();
            upOutEquipmentData.Start();
            upOtherData.Start();
        }