예제 #1
0
        public override bool upDateVIDResultCode(string eq_id, AVEHICLE.VehicleState vehicleState, CompleteStatus cmp_status)
        {
            bool isSuccess = true;

            try
            {
                string result_code = SECSConst.convert2MCS(vehicleState, cmp_status);
                using (DBConnection_EF con = DBConnection_EF.GetUContext())
                {
                    AVIDINFO vid_info = vidIvfoDAO.getByID(con, eq_id);
                    if (vid_info != null)
                    {
                        vid_info.RESULT_CODE = int.Parse(result_code); //TODO 這樣 Parse 的方式好嗎?
                        vidIvfoDAO.update(con);
                        //con.Commit();
                    }
                    else
                    {
                        isSuccess = false;
                        //TODO Exception log
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
                isSuccess = false;
                throw ex;
            }
            finally
            {
            }
            return(isSuccess);
        }
        protected virtual void S2F35ReceiveLinkEventReport(object sender, SECSEventArgs e)
        {
            try
            {
                S2F35 s2f35 = ((S2F35)e.secsHandler.Parse<S2F35>(e));
                SCUtility.secsActionRecordMsg(scApp, true, s2f35);
                if (!isProcess(s2f35)) { return; }


                S2F36 s2f36 = null;
                s2f36 = new S2F36();
                s2f36.SystemByte = s2f35.SystemByte;
                s2f36.SECSAgentName = scApp.EAPSecsAgentName;
                s2f36.LRACK = "0";

                TrxSECS.ReturnCode rtnCode = ISECSControl.replySECS(bcfApp, s2f36);
                SCUtility.secsActionRecordMsg(scApp, false, s2f36);
                if (rtnCode != TrxSECS.ReturnCode.Normal)
                {
                    logger.Warn("Reply EQPT S2F18 Error:{0}", rtnCode);
                }

                scApp.CEIDBLL.DeleteCEIDInfoByBatch();

                if (s2f35.RPTITEMS != null && s2f35.RPTITEMS.Length > 0)
                    scApp.CEIDBLL.buildCEIDsFromMCS(s2f35.RPTITEMS);

                SECSConst.setDicCEIDAndRPTID(scApp.CEIDBLL.loadDicCEIDAndRPTID());

            }
            catch (Exception ex)
            {
                logger.Error("MESDefaultMapAction has Error[Line Name:{0}],[Error method:{1}],[Error Message:{2}", line.LINE_ID, "S2F17_Receive_Date_Time_Req", ex.ToString());
            }
        }