コード例 #1
0
        /// <summary>
        /// Executes this instance.
        /// </summary>
        /// <returns>The resultSet as ADODB.RecordSetwvb
        /// </returns>
        public string Execute()
        {
            string results = String.Empty;
            object dummy   = Type.Missing;

            try
            {
                Connection connection = new ConnectionClass();
                connection.Open(GeneralUtility.GetAdoConnectStringFromInstance(dbInstance), String.Empty, String.Empty, -1);
                Command command = new CommandClass();
                command.ActiveConnection = connection;
                command.CommandType      = CommandTypeEnum.adCmdStoredProc;
                command.CommandText      = "DBCLASSLIBRARY.DoEsisLookupByPolicy";
                //===========================================================
                // ParentNodeId
                //===========================================================
                AddParameter(command, "p_parentNodeId", _parentNodeId, DataTypeEnum.adInteger, false);
                //===========================================================
                // Permitted
                //===========================================================
                AddParameter(command, "p_permittedNodeId", _permittedNodeId, DataTypeEnum.adInteger, false);
                //===========================================================
                // Policy Number
                //===========================================================
                AddParameter(command, "p_policyNumber", _policyNumber, DataTypeEnum.adVarChar, false);
                //===========================================================
                // LOB_CD
                //===========================================================
                AddParameter(command, "p_lobCd", _lobCd, DataTypeEnum.adVarChar, false);
                //===========================================================
                // LocationCode
                //===========================================================
                AddParameter(command, "p_locationCode", _locationCode, DataTypeEnum.adVarChar, false);
                //===========================================================
                // DepartmentCode
                //===========================================================
                AddParameter(command, "p_departmentCode", _departmentCode, DataTypeEnum.adVarChar, false);
                //===========================================================
                // ContractNumber
                //===========================================================
                AddParameter(command, "p_contractNumber", _contractNumber, DataTypeEnum.adVarChar, false);
                //===========================================================
                // Name
                //===========================================================
                AddParameter(command, "p_name", _name, DataTypeEnum.adVarChar, false);
                //===========================================================
                // City
                //===========================================================
                AddParameter(command, "p_city", _city, DataTypeEnum.adVarChar, false);
                //===========================================================
                // State
                //===========================================================
                AddParameter(command, "p_state", _state, DataTypeEnum.adVarChar, false);
                //===========================================================
                // Zip
                //===========================================================
                AddParameter(command, "p_zip", _zip, DataTypeEnum.adVarChar, false);

                Recordset policies = command.Execute(out dummy, ref dummy, 0);
                if (policies != null)
                {
                    results = GeneralUtility.GetXmlFromAdoRecordset(policies);
                    policies.Close();
                }
                connection.Close();
            }
            catch (Exception ex)
            {
                _lastError = ex.Message;
            }

            return(results);
        }