Ejemplo n.º 1
0
 public static int InsertAlarmResult(TrafficALarmHandle trafficALarmHandle_0)
 {
     string format = "insert into GpsJTBAlarmProc values('{0}','{1}',getdate(),{2},{3},'{4}','{5}')";
     format = string.Format(format, new object[] { trafficALarmHandle_0.CarId, trafficALarmHandle_0.GpsTime, trafficALarmHandle_0.WorkID, trafficALarmHandle_0.OrderID, trafficALarmHandle_0.ProcMode, trafficALarmHandle_0.Remark });
     SqlDataAccess access = new SqlDataAccess();
     return access.insertBySql(format);
 }
Ejemplo n.º 2
0
 public Response icar_StopAlarmDeal(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, TrafficALarmHandle trafficALarmHandle_0, object object_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_StopAlarmDeal";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1 + ",指令-报警解除(交通部)";
     base.log.WriteLog(base.logMsg);
     response.ResultCode = 0L;
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     if (!base.isStartCommon())
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     foreach (Bussiness.CarInfo info in base.carInfoList)
     {
         try
         {
             int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
             trafficALarmHandle_0.OrderID = newOrderId;
             trafficALarmHandle_0.WorkID = base.WorkId;
             trafficALarmHandle_0.CarId = info.CarId;
             if (!string.IsNullOrEmpty(trafficALarmHandle_0.GpsTime))
             {
                 Alarm.InsertAlarmResult(trafficALarmHandle_0);
             }
             if ((trafficALarmHandle_0.iProcMode == 1) && (info.ProtocolName != SendBase.m_ProtocolName))
             {
                 SimpleCmd cmd = object_0 as SimpleCmd;
                 string paramDisc = cmd.GetParamDisc();
                 object pvArg = cmd.pvArg;
                 base.AddUpDataLog(newOrderId, info.CarNum, cmd.OrderCode.ToString(), paramDisc);
                 response.ResultCode = SendBase.CarCmdSend.icar_SimpleCmd(base.WorkId, newOrderId, info.SimNum, cmd.CmdCode, ref pvArg);
             }
             else
             {
                 string conntent = "";
                 CmdParamBase base2 = object_0 as CmdParamBase;
                 if (base2 == null)
                 {
                     return response;
                 }
                 if (trafficALarmHandle_0.iProcMode == 4)
                 {
                     base2.TransformCode = CmdParam.TrafficProtocolCodeExchange((int) ((TxtMsg) base2).MsgType);
                 }
                 else
                 {
                     base2.TransformCode = CmdParam.TrafficProtocolCodeExchange2((int) base2.OrderCode);
                 }
                 string str3 = base2.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SimpleCmd", ref conntent);
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", base2.OrderCode.ToString(), "等待", "", this.method_6(trafficALarmHandle_0.iProcMode, info.SimNum.ToString()));
                 response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, base2.TransformCode, (int) commMode_0, str3);
             }
         }
         catch (Exception exception)
         {
             response.ErrorMsg = exception.Message;
             response.ResultCode = -1L;
             return response;
         }
     }
     return response;
 }
Ejemplo n.º 3
0
 public static Response StopAlarmDeal(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, TrafficALarmHandle alarmHandle, object objOrder)
 {
     Response response;
     if (RemotingClient.app == null)
     {
         return RemotingClient.reResult;
     }
     try
     {
         response = RemotingClient.app.StopAlarmDeal(ParamType, CarValues, CarPw, CommMode, alarmHandle, objOrder);
     }
     catch (SocketException socketException)
     {
         Record.execFileRecord("交通部协议指令-->停止报警", socketException.Message);
         response = RemotingClient.reResult;
     }
     catch (RemotingException remotingException)
     {
         Record.execFileRecord("交通部协议指令-->停止报警", remotingException.Message);
         response = RemotingClient.reResult;
     }
     catch (Exception exception)
     {
         Record.execFileRecord("交通部协议指令-->停止报警", exception.ToString());
         response = RemotingClient.reResult;
     }
     return response;
 }
Ejemplo n.º 4
0
 public Response StopAlarmDeal(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, TrafficALarmHandle alarmHandle, object objOrder)
 {
     try
     {
         return this.myDownData.icar_StopAlarmDeal(ParamType, CarValues, CarPw, CommMode, alarmHandle, objOrder);
     }
     catch (Exception exception)
     {
         ErrorMsg msg = new ErrorMsg("RemotingServer", "StopAlarmDeal", exception.Message);
         this.m_LogHelper.WriteError(msg);
         return null;
     }
 }