Пример #1
0
        public string PrepareAdoResultsFromDetail(TDetailResponse response)
        {
            var records = XmlUtility.CreateRecordSet(FieldNames);

            PopulateRecordsFromDetail(records, response);
            return(XmlUtility.GetXmlFromAdoRecordset(records));
        }
Пример #2
0
        /// <summary>
        /// Does the lookup. BUGBUG: we can refactor data access to DbClassLibrary
        /// need to build ADODB support -JJG
        /// </summary>
        /// <param name="vehicleId">The vehicle id.</param>
        /// <returns></returns>
        public static string DoLookup(int vehicleId)
        {
            string results          = String.Empty;
            string connectString    = GeneralUtility.GetFormattedConnectStringFromRegistry();
            string connectionString = String.Format("Provider=MSDAORA.1;{0}", connectString);

            Assert.Test(connectionString.Length > 0, "VehicleLookup: unable to obtaing ConnectionString");

            Connection conn    = new Connection();
            Command    command = new Command();

            try
            {
                conn.Open(connectionString, String.Empty, String.Empty, -1);

                command.ActiveConnection = conn;
                command.CommandType      = CommandTypeEnum.adCmdStoredProc;
                command.CommandText      = "GET_POL_VEHICLES_COV_PKG.GET_VEHICLE_COVERAGE";
                command.Parameters.Append(
                    command.CreateParameter("POLICY_ID_IN_PARAM", DataTypeEnum.adInteger,
                                            ParameterDirectionEnum.adParamInput, 4, vehicleId));

                object    dummy    = Type.Missing;
                Recordset vehicles = command.Execute(out dummy, ref dummy, 0);
                if (vehicles != null)
                {
                    results = XmlUtility.GetXmlFromAdoRecordset(vehicles);
                }
            }
            catch (Exception ex)
            {
                ErrorLog.LogError("GetXmlFromAdoRecordset(): Error " + ex.Message, "VehicleLookup");
            }
            finally
            {
                conn.Close();
            }

            return(results);
        }
Пример #3
0
 public static string PrepareAdoResultsFromException(Exception response)
 {
     return(XmlUtility.GetXmlFromAdoRecordset(XmlUtility.CreateRecordSet(new string[] { "ERROR_MESSAGE" })));
 }