Esempio n. 1
0
        public bool AddNetFirewallLogAllInfo(ref Entity.EntityFirewallLogInfo varEInfo, int varUseFileSign, ref string varErrorStr)
        {
            bool backSign = false;

            try
            {
                if (!GetXmlFilePathByUseFilePathKind(_FilePathInfo, varUseFileSign, ref sFilePathInfo, ref varErrorStr))
                {
                    return(backSign);
                }

                string[] sLInformationName = new string[13];
                sLInformationName[0]  = CCommon.Key_T_S_FirewallLog_FirewallLog_ID_Nvar;
                sLInformationName[1]  = CCommon.Key_T_S_FirewallLog_FirewallLog_Time_DateTime;
                sLInformationName[2]  = CCommon.Key_T_S_FirewallLog_Source_IPAddress_Nvar;
                sLInformationName[3]  = CCommon.Key_T_S_FirewallLog_Source_Port_Int;
                sLInformationName[4]  = CCommon.Key_T_S_FirewallLog_Destination_IPAddress_Nvar;
                sLInformationName[5]  = CCommon.Key_T_S_FirewallLog_Destination_Port_Int;
                sLInformationName[6]  = CCommon.Key_T_S_FirewallLog_FirewallRule_ID_Nvar;
                sLInformationName[7]  = CCommon.Key_T_A_NetProtocol_NetProtocol_ID_Nvar;
                sLInformationName[8]  = CCommon.Key_T_A_NetProtocol_NetProtocol_Name_Nvar;
                sLInformationName[9]  = CCommon.Key_T_S_FirewallLog_FirewallLogType_ID_Nvar;
                sLInformationName[10] = CCommon.Key_T_A_NetFirewallInModel_NetFirewall_ID_Nvar;
                sLInformationName[11] = CCommon.Key_T_A_NetFirewallInModel_NetFirewall_Name_Nvar;
                sLInformationName[12] = CCommon.Key_T_S_Uppermonitor_ControlParameters_IPAddress_Nvar;

                string[] sLInformationValue = new string[13];
                sLInformationValue[0]  = varEInfo.FirewallLog_ID;
                sLInformationValue[1]  = varEInfo.FirewallLog_Time.ToString("yyyy-MM-dd HH:mm:ss");
                sLInformationValue[2]  = varEInfo.Source_IPAddress;
                sLInformationValue[3]  = varEInfo.Source_Port.ToString();
                sLInformationValue[4]  = varEInfo.Destination_IPAddress;
                sLInformationValue[5]  = varEInfo.Destination_Port.ToString();
                sLInformationValue[6]  = varEInfo.FirewallRule_ID;
                sLInformationValue[7]  = varEInfo.NetProtocol_ID;
                sLInformationValue[8]  = varEInfo.NetProtocol_Name;
                sLInformationValue[9]  = varEInfo.FirewallLogType_ID;
                sLInformationValue[10] = varEInfo.NetFirewall_ID;
                sLInformationValue[11] = varEInfo.NetFirewall_Name;
                sLInformationValue[12] = varEInfo.NetFirewall_IPAddress;

                if (ACXDocumentControl.addSonNodeSingleElementAllInfo(sFilePathInfo, sRootNode,
                                                                      sNodeKeyName, "", sLInformationName, sLInformationValue, 0, 0, ref varErrorStr))
                {
                    backSign = true;
                }
            }
            catch (Exception ee)
            {
                throw new Exception(ee.Message);
            }

            return(backSign);
        }
Esempio n. 2
0
        public static bool insertLocalLogRecord(ref Entity.EntityLocalLogInfo varEInfo, int varUseFileSign, ref string varErrorStr)
        {
            bool backSign = false;

            XmlControl.CXDocumentControl ACXDocumentControl = new XmlControl.CXDocumentControl();

            string sRootNode     = CCommon.Key_XML_RootNode_Nvar;
            string sNodeKeyName  = CCommon.Key_T_S_LocalLog_XML_NodeName_Nvar;
            string sFilePathInfo = "";

            try
            {
                if (!GetXmlFilePathByUseFilePathKind(GLocalLogFilePathInfo, varUseFileSign, ref sFilePathInfo, ref varErrorStr))
                {
                    return(backSign);
                }

                string[] sLInformationName = new string[7];
                sLInformationName[0] = CCommon.Key_T_S_LocalLog_LocalLog_ID_Nvar;
                sLInformationName[1] = CCommon.Key_T_S_LocalLog_LocalLog_Time_DateTime;
                sLInformationName[2] = CCommon.Key_T_S_LocalLog_LocalLog_UserID_Nvar;
                sLInformationName[3] = CCommon.Key_T_S_LocalLog_LocalLog_UserName_Nvar;
                sLInformationName[4] = CCommon.Key_T_S_LocalLog_LocalLog_ExecOperation_Nvar;
                sLInformationName[5] = CCommon.Key_T_S_LocalLog_LocalLog_ExecResult_Nvar;
                sLInformationName[6] = CCommon.Key_T_S_LocalLog_LocalLog_Description_Nvar;

                string[] sLInformationValue = new string[7];
                sLInformationValue[0] = varEInfo.LocalLog_ID;
                sLInformationValue[1] = varEInfo.LocalLog_Time.ToString("yyyy-MM-dd HH:mm:ss");;
                sLInformationValue[2] = varEInfo.LocalLog_UserID;
                sLInformationValue[3] = varEInfo.LocalLog_UserName;
                sLInformationValue[4] = varEInfo.LocalLog_ExecOperation;
                sLInformationValue[5] = varEInfo.LocalLog_ExecResult;
                sLInformationValue[6] = varEInfo.LocalLog_Description;

                if (ACXDocumentControl.addSonNodeSingleElementAllInfo(sFilePathInfo, sRootNode,
                                                                      sNodeKeyName, "", sLInformationName, sLInformationValue, 0, 0, ref varErrorStr))
                {
                    backSign = true;
                }
            }
            catch (Exception ee)
            {
                throw new Exception(ee.Message);
            }

            return(backSign);
        }