/// <summary> /// This method finds a 'RawImport' object. /// This method uses the 'RawImport_Find' procedure. /// </summary> /// <returns>A 'RawImport' object.</returns> /// </summary> public RawImport FindRawImport(FindRawImportStoredProcedure findRawImportProc, DataConnector databaseConnector) { // Initial Value RawImport rawImport = null; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // First Get Dataset DataSet rawImportDataSet = this.DataHelper.LoadDataSet(findRawImportProc, databaseConnector); // Verify DataSet Exists if (rawImportDataSet != null) { // Get DataTable From DataSet DataRow row = this.DataHelper.ReturnFirstRow(rawImportDataSet); // if row exists if (row != null) { // Load RawImport rawImport = RawImportReader.Load(row); } } } // return value return(rawImport); }
/// <summary> /// This method is used to delete RawImport objects. /// </summary> /// <param name="id">Delete the RawImport with this id</param> /// <param name="tempRawImport">Pass in a tempRawImport to perform a custom delete.</param> public bool DeleteRawImport(int id, RawImport tempRawImport = null) { // initial value bool deleted = false; // if the AppController exists if (this.HasAppController) { // if the tempRawImport does not exist if (tempRawImport == null) { // create a temp RawImport tempRawImport = new RawImport(); } // if the id is set if (id > 0) { // set the primary key tempRawImport.UpdateIdentity(id); } // perform the delete deleted = this.AppController.ControllerManager.RawImportController.Delete(tempRawImport); } // return value return(deleted); }
/// <summary> /// This method is used to find 'RawImport' objects. /// </summary> /// <param name="id">Find the RawImport with this id</param> /// <param name="tempRawImport">Pass in a tempRawImport to perform a custom find.</param> public RawImport FindRawImport(int id, RawImport tempRawImport = null) { // initial value RawImport rawImport = null; // if the AppController exists if (this.HasAppController) { // if the tempRawImport does not exist if (tempRawImport == null) { // create a temp RawImport tempRawImport = new RawImport(); } // if the id is set if (id > 0) { // set the primary key tempRawImport.UpdateIdentity(id); } // perform the find rawImport = this.AppController.ControllerManager.RawImportController.Find(tempRawImport); } // return value return(rawImport); }
/// <summary> /// Saves a 'RawImport' object into the database. /// This method calls the 'Insert' or 'Update' method. /// </summary> /// <param name='rawImport'>The 'RawImport' object to save.</param> /// <returns>True if successful or false if not.</returns> public bool Save(ref RawImport rawImport) { // Initial value bool saved = false; // If the rawImport exists. if (rawImport != null) { // Is this a new RawImport if (rawImport.IsNew) { // Insert new RawImport int newIdentity = this.Insert(rawImport); // if insert was successful if (newIdentity > 0) { // Update Identity rawImport.UpdateIdentity(newIdentity); // Set return value saved = true; } } else { // Update RawImport saved = this.Update(rawImport); } } // return value return(saved); }
/// <summary> /// This method deletes a 'RawImport' object. /// </summary> /// <param name='List<PolymorphicObject>'>The 'RawImport' to delete. /// <returns>A PolymorphicObject object with a Boolean value. internal PolymorphicObject DeleteRawImport(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Create Delete StoredProcedure DeleteRawImportStoredProcedure deleteRawImportProc = null; // verify the first parameters is a(n) 'RawImport'. if (parameters[0].ObjectValue as RawImport != null) { // Create RawImport RawImport rawImport = (RawImport)parameters[0].ObjectValue; // verify rawImport exists if (rawImport != null) { // Now create deleteRawImportProc from RawImportWriter // The DataWriter converts the 'RawImport' // to the SqlParameter[] array needed to delete a 'RawImport'. deleteRawImportProc = RawImportWriter.CreateDeleteRawImportStoredProcedure(rawImport); } } // Verify deleteRawImportProc exists if (deleteRawImportProc != null) { // Execute Delete Stored Procedure bool deleted = this.DataManager.RawImportManager.DeleteRawImport(deleteRawImportProc, dataConnector); // Create returnObject.Boolean returnObject.Boolean = new NullableBoolean(); // If delete was successful if (deleted) { // Set returnObject.Boolean.Value to true returnObject.Boolean.Value = NullableBooleanEnum.True; } else { // Set returnObject.Boolean.Value to false returnObject.Boolean.Value = NullableBooleanEnum.False; } } } else { // Raise Error Data Connection Not Available throw new Exception("The database connection is not available."); } // return value return(returnObject); }
/// <summary> /// This method finds a 'RawImport' object. /// </summary> /// <param name='List<PolymorphicObject>'>The 'RawImport' to delete. /// <returns>A PolymorphicObject object with a Boolean value. internal PolymorphicObject FindRawImport(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // locals RawImport rawImport = null; // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Create Find StoredProcedure FindRawImportStoredProcedure findRawImportProc = null; // verify the first parameters is a 'RawImport'. if (parameters[0].ObjectValue as RawImport != null) { // Get RawImportParameter RawImport paramRawImport = (RawImport)parameters[0].ObjectValue; // verify paramRawImport exists if (paramRawImport != null) { // Now create findRawImportProc from RawImportWriter // The DataWriter converts the 'RawImport' // to the SqlParameter[] array needed to find a 'RawImport'. findRawImportProc = RawImportWriter.CreateFindRawImportStoredProcedure(paramRawImport); } // Verify findRawImportProc exists if (findRawImportProc != null) { // Execute Find Stored Procedure rawImport = this.DataManager.RawImportManager.FindRawImport(findRawImportProc, dataConnector); // if dataObject exists if (rawImport != null) { // set returnObject.ObjectValue returnObject.ObjectValue = rawImport; } } } else { // Raise Error Data Connection Not Available throw new Exception("The database connection is not available."); } } // return value return(returnObject); }
/// <summary> /// This method fetches all 'RawImport' objects. /// </summary> /// <param name='List<PolymorphicObject>'>The 'RawImport' to delete. /// <returns>A PolymorphicObject object with all 'RawImports' objects. internal PolymorphicObject FetchAll(List <PolymorphicObject> parameters, DataConnector dataConnector) { // Initial Value PolymorphicObject returnObject = new PolymorphicObject(); // locals List <RawImport> rawImportListCollection = null; // Create FetchAll StoredProcedure FetchAllRawImportsStoredProcedure fetchAllProc = null; // If the data connection is connected if ((dataConnector != null) && (dataConnector.Connected == true)) { // Get RawImportParameter // Declare Parameter RawImport paramRawImport = null; // verify the first parameters is a(n) 'RawImport'. if (parameters[0].ObjectValue as RawImport != null) { // Get RawImportParameter paramRawImport = (RawImport)parameters[0].ObjectValue; } // Now create FetchAllRawImportsProc from RawImportWriter fetchAllProc = RawImportWriter.CreateFetchAllRawImportsStoredProcedure(paramRawImport); } // Verify fetchAllProc exists if (fetchAllProc != null) { // Execute FetchAll Stored Procedure rawImportListCollection = this.DataManager.RawImportManager.FetchAllRawImports(fetchAllProc, dataConnector); // if dataObjectCollection exists if (rawImportListCollection != null) { // set returnObject.ObjectValue returnObject.ObjectValue = rawImportListCollection; } } else { // Raise Error Data Connection Not Available throw new Exception("The database connection is not available."); } // return value return(returnObject); }
/// <summary> /// This method loads a collection of 'RawImport' objects. /// </summary> public List <RawImport> LoadRawImports(RawImport tempRawImport = null) { // initial value List <RawImport> rawImports = null; // if the AppController exists if (this.HasAppController) { // perform the load rawImports = this.AppController.ControllerManager.RawImportController.FetchAll(tempRawImport); } // return value return(rawImports); }
/// <summary> /// This method is used to save 'RawImport' objects. /// </summary> /// <param name="rawImport">The RawImport to save.</param> public bool SaveRawImport(ref RawImport rawImport) { // initial value bool saved = false; // if the AppController exists if (this.HasAppController) { // perform the save saved = this.AppController.ControllerManager.RawImportController.Save(ref rawImport); } // return value return(saved); }
/// <summary> /// Deletes a 'RawImport' from the database /// This method calls the DataBridgeManager to execute the delete using the /// procedure 'RawImport_Delete'. /// </summary> /// <param name='rawimport'>The 'RawImport' to delete.</param> /// <returns>True if the delete is successful or false if not.</returns> public bool Delete(RawImport tempRawImport) { // locals bool deleted = false; // Get information for calling 'DataBridgeManager.PerformDataOperation' method. string methodName = "DeleteRawImport"; string objectName = "ApplicationLogicComponent.Controllers"; try { // verify temprawImport exists before attemptintg to delete if (tempRawImport != null) { // Create Delegate For DataOperation ApplicationController.DataOperationMethod deleteRawImportMethod = this.AppController.DataBridge.DataOperations.RawImportMethods.DeleteRawImport; // Create parameters for this method List <PolymorphicObject> parameters = CreateRawImportParameter(tempRawImport); // Perform DataOperation PolymorphicObject returnObject = this.AppController.DataBridge.PerformDataOperation(methodName, objectName, deleteRawImportMethod, parameters); // If return object exists if (returnObject != null) { // Test For True if (returnObject.Boolean.Value == NullableBooleanEnum.True) { // Set Deleted To True deleted = true; } } } } catch (Exception error) { // If ErrorProcessor exists if (this.ErrorProcessor != null) { // Log the current error this.ErrorProcessor.LogError(methodName, objectName, error); } } // return value return(deleted); }
/// <summary> /// This method creates the parameter for a 'RawImport' data operation. /// </summary> /// <param name='rawimport'>The 'RawImport' to use as the first /// parameter (parameters[0]).</param> /// <returns>A List<PolymorphicObject> collection.</returns> private List <PolymorphicObject> CreateRawImportParameter(RawImport rawImport) { // Initial Value List <PolymorphicObject> parameters = new List <PolymorphicObject>(); // Create PolymorphicObject to hold the parameter PolymorphicObject parameter = new PolymorphicObject(); // Set parameter.ObjectValue parameter.ObjectValue = rawImport; // Add userParameter to parameters parameters.Add(parameter); // return value return(parameters); }
/// <summary> /// This method creates the sql Parameter[] array /// that holds the primary key value. /// </summary> /// <param name='rawImport'>The 'RawImport' to get the primary key of.</param> /// <returns>A SqlParameter[] array which contains the primary key value. /// to delete.</returns> internal static SqlParameter[] CreatePrimaryKeyParameter(RawImport rawImport) { // Initial Value SqlParameter[] parameters = new SqlParameter[1]; // verify user exists if (rawImport != null) { // Create PrimaryKey Parameter SqlParameter @Id = new SqlParameter("@Id", rawImport.Id); // Set parameters[0] to @Id parameters[0] = @Id; } // return value return(parameters); }
/// <summary> /// Finds a 'RawImport' object by the primary key. /// This method used the DataBridgeManager to execute the 'Find' using the /// procedure 'RawImport_Find'</param> /// </summary> /// <param name='tempRawImport'>A temporary RawImport for passing values.</param> /// <returns>A 'RawImport' object if found else a null 'RawImport'.</returns> public RawImport Find(RawImport tempRawImport) { // Initial values RawImport rawImport = null; // Get information for calling 'DataBridgeManager.PerformDataOperation' method. string methodName = "Find"; string objectName = "ApplicationLogicComponent.Controllers"; try { // If object exists if (tempRawImport != null) { // Create DataOperation ApplicationController.DataOperationMethod findMethod = this.AppController.DataBridge.DataOperations.RawImportMethods.FindRawImport; // Create parameters for this method List <PolymorphicObject> parameters = CreateRawImportParameter(tempRawImport); // Perform DataOperation PolymorphicObject returnObject = this.AppController.DataBridge.PerformDataOperation(methodName, objectName, findMethod, parameters); // If return object exists if ((returnObject != null) && (returnObject.ObjectValue as RawImport != null)) { // Get ReturnObject rawImport = (RawImport)returnObject.ObjectValue; } } } catch (Exception error) { // If ErrorProcessor exists if (this.ErrorProcessor != null) { // Log the current error this.ErrorProcessor.LogError(methodName, objectName, error); } } // return value return(rawImport); }
/// <summary> /// Insert a 'RawImport' object into the database. /// This method uses the DataBridgeManager to execute the 'Insert' using the /// procedure 'RawImport_Insert'.</param> /// </summary> /// <param name='rawImport'>The 'RawImport' object to insert.</param> /// <returns>The id (int) of the new 'RawImport' object that was inserted.</returns> public int Insert(RawImport rawImport) { // Initial values int newIdentity = -1; // Get information for calling 'DataBridgeManager.PerformDataOperation' method. string methodName = "Insert"; string objectName = "ApplicationLogicComponent.Controllers"; try { // If RawImportexists if (rawImport != null) { ApplicationController.DataOperationMethod insertMethod = this.AppController.DataBridge.DataOperations.RawImportMethods.InsertRawImport; // Create parameters for this method List <PolymorphicObject> parameters = CreateRawImportParameter(rawImport); // Perform DataOperation PolymorphicObject returnObject = this.AppController.DataBridge.PerformDataOperation(methodName, objectName, insertMethod, parameters); // If return object exists if (returnObject != null) { // Set return value newIdentity = returnObject.IntegerValue; } } } catch (Exception error) { // If ErrorProcessor exists if (this.ErrorProcessor != null) { // Log the current error this.ErrorProcessor.LogError(methodName, objectName, error); } } // return value return(newIdentity); }
/// <summary> /// This method Updates a 'RawImport' object in the database. /// This method used the DataBridgeManager to execute the 'Update' using the /// procedure 'RawImport_Update'.</param> /// </summary> /// <param name='rawImport'>The 'RawImport' object to update.</param> /// <returns>True if successful else false if not.</returns> public bool Update(RawImport rawImport) { // Initial value bool saved = false; // Get information for calling 'DataBridgeManager.PerformDataOperation' method. string methodName = "Update"; string objectName = "ApplicationLogicComponent.Controllers"; try { if (rawImport != null) { // Create Delegate ApplicationController.DataOperationMethod updateMethod = this.AppController.DataBridge.DataOperations.RawImportMethods.UpdateRawImport; // Create parameters for this method List <PolymorphicObject> parameters = CreateRawImportParameter(rawImport); // Perform DataOperation PolymorphicObject returnObject = this.AppController.DataBridge.PerformDataOperation(methodName, objectName, updateMethod, parameters); // If return object exists if ((returnObject != null) && (returnObject.Boolean != null) && (returnObject.Boolean.Value == NullableBooleanEnum.True)) { // Set saved to true saved = true; } } } catch (Exception error) { // If ErrorProcessor exists if (this.ErrorProcessor != null) { // Log the current error this.ErrorProcessor.LogError(methodName, objectName, error); } } // return value return(saved); }
/// <summary> /// This method Set Raw Import Properties /// </summary> public static void SetRawImportProperties(ref RawImport rawImport, List <Word> words) { // If the rawImport object exists and both lists exist if ((NullHelper.Exists(rawImport)) && (ListHelper.HasOneOrMoreItems(words))) { // this is a working sample built for importing the Pfilerr.csv file included in the Data folder. // To create this for your project, after you create your table and build a data-tier // with DataTier.Net, open this query and find your TableId in the DTNTable // for the table you created in Step 1 // Then Open the Query SetFieldValues and run it // set each property rawImport.Close = words[6].Text; rawImport.Date = words[2].Text; rawImport.High = words[4].Text; rawImport.Low = words[5].Text; rawImport.Open = words[3].Text; rawImport.Per = words[1].Text; rawImport.Ticker = words[0].Text; rawImport.Vol = words[7].Text; } }
/// <summary> /// This method loads a 'RawImport' object /// from the dataRow passed in. /// </summary> /// <param name='dataRow'>The 'DataRow' to load from.</param> /// <returns>A 'RawImport' DataObject.</returns> public static RawImport Load(DataRow dataRow) { // Initial Value RawImport rawImport = new RawImport(); // Create field Integers int closefield = 0; int datefield = 1; int highfield = 2; int idfield = 3; int lowfield = 4; int openfield = 5; int perfield = 6; int tickerfield = 7; int volfield = 8; try { // Load Each field rawImport.Close = DataHelper.ParseString(dataRow.ItemArray[closefield]); rawImport.Date = DataHelper.ParseString(dataRow.ItemArray[datefield]); rawImport.High = DataHelper.ParseString(dataRow.ItemArray[highfield]); rawImport.UpdateIdentity(DataHelper.ParseInteger(dataRow.ItemArray[idfield], 0)); rawImport.Low = DataHelper.ParseString(dataRow.ItemArray[lowfield]); rawImport.Open = DataHelper.ParseString(dataRow.ItemArray[openfield]); rawImport.Per = DataHelper.ParseString(dataRow.ItemArray[perfield]); rawImport.Ticker = DataHelper.ParseString(dataRow.ItemArray[tickerfield]); rawImport.Vol = DataHelper.ParseString(dataRow.ItemArray[volfield]); } catch { } // return value return(rawImport); }
/// <summary> /// This method loads a collection of 'RawImport' objects. /// from the dataTable.Rows object passed in. /// </summary> /// <param name='dataTable'>The 'DataTable.Rows' to load from.</param> /// <returns>A RawImport Collection.</returns> public static List <RawImport> LoadCollection(DataTable dataTable) { // Initial Value List <RawImport> rawImports = new List <RawImport>(); try { // Load Each row In DataTable foreach (DataRow row in dataTable.Rows) { // Create 'RawImport' from rows RawImport rawImport = Load(row); // Add this object to collection rawImports.Add(rawImport); } } catch { } // return value return(rawImports); }
/// <summary> /// This method creates an instance of an /// 'InsertRawImportStoredProcedure' object and /// creates the sql parameter[] array needed /// to execute the procedure 'RawImport_Insert'. /// </summary> /// <param name="rawImport"The 'RawImport' object to insert</param> /// <returns>An instance of a 'InsertRawImportStoredProcedure' object.</returns> public static InsertRawImportStoredProcedure CreateInsertRawImportStoredProcedure(RawImport rawImport) { // Initial Value InsertRawImportStoredProcedure insertRawImportStoredProcedure = null; // verify rawImport exists if (rawImport != null) { // Instanciate insertRawImportStoredProcedure insertRawImportStoredProcedure = new InsertRawImportStoredProcedure(); // Now create parameters for this procedure insertRawImportStoredProcedure.Parameters = CreateInsertParameters(rawImport); } // return value return(insertRawImportStoredProcedure); }
/// <summary> /// This method creates an instance of an /// 'UpdateRawImportStoredProcedure' object and /// creates the sql parameter[] array needed /// to execute the procedure 'RawImport_Update'. /// </summary> /// <param name="rawImport"The 'RawImport' object to update</param> /// <returns>An instance of a 'UpdateRawImportStoredProcedure</returns> public static UpdateRawImportStoredProcedure CreateUpdateRawImportStoredProcedure(RawImport rawImport) { // Initial Value UpdateRawImportStoredProcedure updateRawImportStoredProcedure = null; // verify rawImport exists if (rawImport != null) { // Instanciate updateRawImportStoredProcedure updateRawImportStoredProcedure = new UpdateRawImportStoredProcedure(); // Now create parameters for this procedure updateRawImportStoredProcedure.Parameters = CreateUpdateParameters(rawImport); } // return value return(updateRawImportStoredProcedure); }
/// <summary> /// This method creates an instance of a /// 'FetchAllRawImportsStoredProcedure' object and /// creates the sql parameter[] array needed /// to execute the procedure 'RawImport_FetchAll'. /// </summary> /// <returns>An instance of a(n) 'FetchAllRawImportsStoredProcedure' object.</returns> public static FetchAllRawImportsStoredProcedure CreateFetchAllRawImportsStoredProcedure(RawImport rawImport) { // Initial value FetchAllRawImportsStoredProcedure fetchAllRawImportsStoredProcedure = new FetchAllRawImportsStoredProcedure(); // return value return(fetchAllRawImportsStoredProcedure); }
/// <summary> /// This method creates an instance of an /// 'DeleteRawImport'StoredProcedure' object and /// creates the sql parameter[] array needed /// to execute the procedure 'RawImport_Delete'. /// </summary> /// <param name="rawImport">The 'RawImport' to Delete.</param> /// <returns>An instance of a 'DeleteRawImportStoredProcedure' object.</returns> public static DeleteRawImportStoredProcedure CreateDeleteRawImportStoredProcedure(RawImport rawImport) { // Initial Value DeleteRawImportStoredProcedure deleteRawImportStoredProcedure = new DeleteRawImportStoredProcedure(); // Now Create Parameters For The DeleteProc deleteRawImportStoredProcedure.Parameters = CreatePrimaryKeyParameter(rawImport); // return value return(deleteRawImportStoredProcedure); }
/// <summary> /// This method creates an instance of a /// 'FindRawImportStoredProcedure' object and /// creates the sql parameter[] array needed /// to execute the procedure 'RawImport_Find'. /// </summary> /// <param name="rawImport">The 'RawImport' to use to /// get the primary key parameter.</param> /// <returns>An instance of an FetchUserStoredProcedure</returns> public static FindRawImportStoredProcedure CreateFindRawImportStoredProcedure(RawImport rawImport) { // Initial Value FindRawImportStoredProcedure findRawImportStoredProcedure = null; // verify rawImport exists if (rawImport != null) { // Instanciate findRawImportStoredProcedure findRawImportStoredProcedure = new FindRawImportStoredProcedure(); // Now create parameters for this procedure findRawImportStoredProcedure.Parameters = CreatePrimaryKeyParameter(rawImport); } // return value return(findRawImportStoredProcedure); }
/// <summary> /// This method returns the number of items imported /// </summary> /// <param name="text">The contents to be imported.</param> /// <param name="tableName">Only used in cases where more than one import takes place.</param> /// <param name="expectedCount">Number of expected columns in the csv file</param> /// <param name="callback">The method to call to update progress</param> /// <returns></returns> public static int ImportData(string text, string tableName, int expectedCount, ImportProgressCallback callback) { // initial value int savedCount = 0; // locals char[] delimiters = { ',' }; int count = 0; int totalCount = 0; int refreshRate = 5; List <Word> words = null; RawImport rawImport = null; // if the fileExists if (TextHelper.Exists(text)) { // Create a new instance of a 'Gateway' object. Gateway gateway = new Gateway(); // set the textLines List <TextLine> textLines = WordParser.GetTextLines(text.Trim()); // If the textLines collection exists and has one or more items if (ListHelper.HasOneOrMoreItems(textLines)) { // If the callback object exists if (NullHelper.Exists(callback)) { // notify the delegate to setup the Graph callback(textLines.Count, tableName); } // change the RefreshRate if (textLines.Count > 1000) { // change this to whatever makes since for your app refreshRate = 25; } // set the totalCount totalCount = textLines.Count - 1; // Iterate the collection of TextLine objects foreach (TextLine textLine in textLines) { // Increment the value for count count++; // skip the first row if (count > 1) { // get the list of words words = WordParser.GetWords(textLine.Text, delimiters, true); // if the words collection has exactly the right amount if ((ListHelper.HasOneOrMoreItems(words)) && (words.Count == expectedCount)) { // Create a new instance of a 'RawImport' object. rawImport = new RawImport(); // Load the RawImport with the words SetRawImportProperties(ref rawImport, words); // save the rawImport object bool saved = gateway.SaveRawImport(ref rawImport); // if the value for saved is true if (saved) { // Increment the value for savedCount savedCount++; // refresh every x number of records if (savedCount % refreshRate == 0) { // update the graph (for a large project, you might want to update every 25, 50 or 100 records or so callback(savedCount, tableName); } } } } } } } // return value return(savedCount); }
/// <summary> /// This method creates the sql Parameters[] needed for /// update an existing rawImport. /// </summary> /// <param name="rawImport">The 'RawImport' to update.</param> /// <returns></returns> internal static SqlParameter[] CreateUpdateParameters(RawImport rawImport) { // Initial Values SqlParameter[] parameters = new SqlParameter[9]; SqlParameter param = null; // verify rawImportexists if (rawImport != null) { // Create parameter for [Close] param = new SqlParameter("@Close", rawImport.Close); // set parameters[0] parameters[0] = param; // Create parameter for [Date] param = new SqlParameter("@Date", rawImport.Date); // set parameters[1] parameters[1] = param; // Create parameter for [High] param = new SqlParameter("@High", rawImport.High); // set parameters[2] parameters[2] = param; // Create parameter for [Low] param = new SqlParameter("@Low", rawImport.Low); // set parameters[3] parameters[3] = param; // Create parameter for [Open] param = new SqlParameter("@Open", rawImport.Open); // set parameters[4] parameters[4] = param; // Create parameter for [Per] param = new SqlParameter("@Per", rawImport.Per); // set parameters[5] parameters[5] = param; // Create parameter for [Ticker] param = new SqlParameter("@Ticker", rawImport.Ticker); // set parameters[6] parameters[6] = param; // Create parameter for [Vol] param = new SqlParameter("@Vol", rawImport.Vol); // set parameters[7] parameters[7] = param; // Create parameter for [Id] param = new SqlParameter("@Id", rawImport.Id); parameters[8] = param; } // return value return(parameters); }
/// <summary> /// This method Set Raw Import Properties /// </summary> public static void SetRawImportProperties(ref RawImport rawImport, List <Word> words) { // If the rawImport object exists and both lists exist if ((NullHelper.Exists(rawImport)) && (ListHelper.HasOneOrMoreItems(words))) { // this is a working sample built for importing the Pfilerr.csv file included in the Data folder. // To create this for your project, after you create your table and build a data-tier // with DataTier.Net, open this query and find your TableId in the DTNTable // for the table you created in Step 1 // Then Open the Query SetFieldValues and run it // set each property rawImport.AuthorizedOfficialCredentialText = words[313].Text; rawImport.AuthorizedOfficialFirstName = words[43].Text; rawImport.AuthorizedOfficialLastName = words[42].Text; rawImport.AuthorizedOfficialMiddleName = words[44].Text; rawImport.AuthorizedOfficialNamePrefixText = words[311].Text; rawImport.AuthorizedOfficialNameSuffixText = words[312].Text; rawImport.AuthorizedOfficialTelephoneNumber = words[46].Text; rawImport.AuthorizedOfficialTitleorPosition = words[45].Text; rawImport.EmployerIdentificationNumberEIN = words[3].Text; rawImport.EntityTypeCode = words[1].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch1 = words[50].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch10 = words[86].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch11 = words[90].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch12 = words[94].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch13 = words[98].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch14 = words[102].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch15 = words[106].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch2 = words[54].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch3 = words[58].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch4 = words[62].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch5 = words[66].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch6 = words[70].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch7 = words[74].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch8 = words[78].Text; rawImport.HealthcareProviderPrimaryTaxonomySwitch9 = words[82].Text; rawImport.HealthcareProviderTaxonomyCode1 = words[47].Text; rawImport.HealthcareProviderTaxonomyCode10 = words[83].Text; rawImport.HealthcareProviderTaxonomyCode11 = words[87].Text; rawImport.HealthcareProviderTaxonomyCode12 = words[91].Text; rawImport.HealthcareProviderTaxonomyCode13 = words[95].Text; rawImport.HealthcareProviderTaxonomyCode14 = words[99].Text; rawImport.HealthcareProviderTaxonomyCode15 = words[103].Text; rawImport.HealthcareProviderTaxonomyCode2 = words[51].Text; rawImport.HealthcareProviderTaxonomyCode3 = words[55].Text; rawImport.HealthcareProviderTaxonomyCode4 = words[59].Text; rawImport.HealthcareProviderTaxonomyCode5 = words[63].Text; rawImport.HealthcareProviderTaxonomyCode6 = words[67].Text; rawImport.HealthcareProviderTaxonomyCode7 = words[71].Text; rawImport.HealthcareProviderTaxonomyCode8 = words[75].Text; rawImport.HealthcareProviderTaxonomyCode9 = words[79].Text; rawImport.HealthcareProviderTaxonomyGroup1 = words[314].Text; rawImport.HealthcareProviderTaxonomyGroup10 = words[323].Text; rawImport.HealthcareProviderTaxonomyGroup11 = words[324].Text; rawImport.HealthcareProviderTaxonomyGroup12 = words[325].Text; rawImport.HealthcareProviderTaxonomyGroup13 = words[326].Text; rawImport.HealthcareProviderTaxonomyGroup14 = words[327].Text; rawImport.HealthcareProviderTaxonomyGroup15 = words[328].Text; rawImport.HealthcareProviderTaxonomyGroup2 = words[315].Text; rawImport.HealthcareProviderTaxonomyGroup3 = words[316].Text; rawImport.HealthcareProviderTaxonomyGroup4 = words[317].Text; rawImport.HealthcareProviderTaxonomyGroup5 = words[318].Text; rawImport.HealthcareProviderTaxonomyGroup6 = words[319].Text; rawImport.HealthcareProviderTaxonomyGroup7 = words[320].Text; rawImport.HealthcareProviderTaxonomyGroup8 = words[321].Text; rawImport.HealthcareProviderTaxonomyGroup9 = words[322].Text; rawImport.IsOrganizationSubpart = words[308].Text; rawImport.IsSoleProprietor = words[307].Text; rawImport.LastUpdateDate = words[37].Text; rawImport.NPI = words[0].Text; rawImport.NPIDeactivationDate = words[39].Text; rawImport.NPIDeactivationReasonCode = words[38].Text; rawImport.NPIReactivationDate = words[40].Text; rawImport.OtherProviderIdentifier1 = words[107].Text; rawImport.OtherProviderIdentifier10 = words[143].Text; rawImport.OtherProviderIdentifier11 = words[147].Text; rawImport.OtherProviderIdentifier12 = words[151].Text; rawImport.OtherProviderIdentifier13 = words[155].Text; rawImport.OtherProviderIdentifier14 = words[159].Text; rawImport.OtherProviderIdentifier15 = words[163].Text; rawImport.OtherProviderIdentifier16 = words[167].Text; rawImport.OtherProviderIdentifier17 = words[171].Text; rawImport.OtherProviderIdentifier18 = words[175].Text; rawImport.OtherProviderIdentifier19 = words[179].Text; rawImport.OtherProviderIdentifier2 = words[111].Text; rawImport.OtherProviderIdentifier20 = words[183].Text; rawImport.OtherProviderIdentifier21 = words[187].Text; rawImport.OtherProviderIdentifier22 = words[191].Text; rawImport.OtherProviderIdentifier23 = words[195].Text; rawImport.OtherProviderIdentifier24 = words[199].Text; rawImport.OtherProviderIdentifier25 = words[203].Text; rawImport.OtherProviderIdentifier26 = words[207].Text; rawImport.OtherProviderIdentifier27 = words[211].Text; rawImport.OtherProviderIdentifier28 = words[215].Text; rawImport.OtherProviderIdentifier29 = words[219].Text; rawImport.OtherProviderIdentifier3 = words[115].Text; rawImport.OtherProviderIdentifier30 = words[223].Text; rawImport.OtherProviderIdentifier31 = words[227].Text; rawImport.OtherProviderIdentifier32 = words[231].Text; rawImport.OtherProviderIdentifier33 = words[235].Text; rawImport.OtherProviderIdentifier34 = words[239].Text; rawImport.OtherProviderIdentifier35 = words[243].Text; rawImport.OtherProviderIdentifier36 = words[247].Text; rawImport.OtherProviderIdentifier37 = words[251].Text; rawImport.OtherProviderIdentifier38 = words[255].Text; rawImport.OtherProviderIdentifier39 = words[259].Text; rawImport.OtherProviderIdentifier4 = words[119].Text; rawImport.OtherProviderIdentifier40 = words[263].Text; rawImport.OtherProviderIdentifier41 = words[267].Text; rawImport.OtherProviderIdentifier42 = words[271].Text; rawImport.OtherProviderIdentifier43 = words[275].Text; rawImport.OtherProviderIdentifier44 = words[279].Text; rawImport.OtherProviderIdentifier45 = words[283].Text; rawImport.OtherProviderIdentifier46 = words[287].Text; rawImport.OtherProviderIdentifier47 = words[291].Text; rawImport.OtherProviderIdentifier48 = words[295].Text; rawImport.OtherProviderIdentifier49 = words[299].Text; rawImport.OtherProviderIdentifier5 = words[123].Text; rawImport.OtherProviderIdentifier50 = words[303].Text; rawImport.OtherProviderIdentifier6 = words[127].Text; rawImport.OtherProviderIdentifier7 = words[131].Text; rawImport.OtherProviderIdentifier8 = words[135].Text; rawImport.OtherProviderIdentifier9 = words[139].Text; rawImport.OtherProviderIdentifierIssuer1 = words[110].Text; rawImport.OtherProviderIdentifierIssuer10 = words[146].Text; rawImport.OtherProviderIdentifierIssuer11 = words[150].Text; rawImport.OtherProviderIdentifierIssuer12 = words[154].Text; rawImport.OtherProviderIdentifierIssuer13 = words[158].Text; rawImport.OtherProviderIdentifierIssuer14 = words[162].Text; rawImport.OtherProviderIdentifierIssuer15 = words[166].Text; rawImport.OtherProviderIdentifierIssuer16 = words[170].Text; rawImport.OtherProviderIdentifierIssuer17 = words[174].Text; rawImport.OtherProviderIdentifierIssuer18 = words[178].Text; rawImport.OtherProviderIdentifierIssuer19 = words[182].Text; rawImport.OtherProviderIdentifierIssuer2 = words[114].Text; rawImport.OtherProviderIdentifierIssuer20 = words[186].Text; rawImport.OtherProviderIdentifierIssuer21 = words[190].Text; rawImport.OtherProviderIdentifierIssuer22 = words[194].Text; rawImport.OtherProviderIdentifierIssuer23 = words[198].Text; rawImport.OtherProviderIdentifierIssuer24 = words[202].Text; rawImport.OtherProviderIdentifierIssuer25 = words[206].Text; rawImport.OtherProviderIdentifierIssuer26 = words[210].Text; rawImport.OtherProviderIdentifierIssuer27 = words[214].Text; rawImport.OtherProviderIdentifierIssuer28 = words[218].Text; rawImport.OtherProviderIdentifierIssuer29 = words[222].Text; rawImport.OtherProviderIdentifierIssuer3 = words[118].Text; rawImport.OtherProviderIdentifierIssuer30 = words[226].Text; rawImport.OtherProviderIdentifierIssuer31 = words[230].Text; rawImport.OtherProviderIdentifierIssuer32 = words[234].Text; rawImport.OtherProviderIdentifierIssuer33 = words[238].Text; rawImport.OtherProviderIdentifierIssuer34 = words[242].Text; rawImport.OtherProviderIdentifierIssuer35 = words[246].Text; rawImport.OtherProviderIdentifierIssuer36 = words[250].Text; rawImport.OtherProviderIdentifierIssuer37 = words[254].Text; rawImport.OtherProviderIdentifierIssuer38 = words[258].Text; rawImport.OtherProviderIdentifierIssuer39 = words[262].Text; rawImport.OtherProviderIdentifierIssuer4 = words[122].Text; rawImport.OtherProviderIdentifierIssuer40 = words[266].Text; rawImport.OtherProviderIdentifierIssuer41 = words[270].Text; rawImport.OtherProviderIdentifierIssuer42 = words[274].Text; rawImport.OtherProviderIdentifierIssuer43 = words[278].Text; rawImport.OtherProviderIdentifierIssuer44 = words[282].Text; rawImport.OtherProviderIdentifierIssuer45 = words[286].Text; rawImport.OtherProviderIdentifierIssuer46 = words[290].Text; rawImport.OtherProviderIdentifierIssuer47 = words[294].Text; rawImport.OtherProviderIdentifierIssuer48 = words[298].Text; rawImport.OtherProviderIdentifierIssuer49 = words[302].Text; rawImport.OtherProviderIdentifierIssuer5 = words[126].Text; rawImport.OtherProviderIdentifierIssuer50 = words[306].Text; rawImport.OtherProviderIdentifierIssuer6 = words[130].Text; rawImport.OtherProviderIdentifierIssuer7 = words[134].Text; rawImport.OtherProviderIdentifierIssuer8 = words[138].Text; rawImport.OtherProviderIdentifierIssuer9 = words[142].Text; rawImport.OtherProviderIdentifierState1 = words[109].Text; rawImport.OtherProviderIdentifierState10 = words[145].Text; rawImport.OtherProviderIdentifierState11 = words[149].Text; rawImport.OtherProviderIdentifierState12 = words[153].Text; rawImport.OtherProviderIdentifierState13 = words[157].Text; rawImport.OtherProviderIdentifierState14 = words[161].Text; rawImport.OtherProviderIdentifierState15 = words[165].Text; rawImport.OtherProviderIdentifierState16 = words[169].Text; rawImport.OtherProviderIdentifierState17 = words[173].Text; rawImport.OtherProviderIdentifierState18 = words[177].Text; rawImport.OtherProviderIdentifierState19 = words[181].Text; rawImport.OtherProviderIdentifierState2 = words[113].Text; rawImport.OtherProviderIdentifierState20 = words[185].Text; rawImport.OtherProviderIdentifierState21 = words[189].Text; rawImport.OtherProviderIdentifierState22 = words[193].Text; rawImport.OtherProviderIdentifierState23 = words[197].Text; rawImport.OtherProviderIdentifierState24 = words[201].Text; rawImport.OtherProviderIdentifierState25 = words[205].Text; rawImport.OtherProviderIdentifierState26 = words[209].Text; rawImport.OtherProviderIdentifierState27 = words[213].Text; rawImport.OtherProviderIdentifierState28 = words[217].Text; rawImport.OtherProviderIdentifierState29 = words[221].Text; rawImport.OtherProviderIdentifierState3 = words[117].Text; rawImport.OtherProviderIdentifierState30 = words[225].Text; rawImport.OtherProviderIdentifierState31 = words[229].Text; rawImport.OtherProviderIdentifierState32 = words[233].Text; rawImport.OtherProviderIdentifierState33 = words[237].Text; rawImport.OtherProviderIdentifierState34 = words[241].Text; rawImport.OtherProviderIdentifierState35 = words[245].Text; rawImport.OtherProviderIdentifierState36 = words[249].Text; rawImport.OtherProviderIdentifierState37 = words[253].Text; rawImport.OtherProviderIdentifierState38 = words[257].Text; rawImport.OtherProviderIdentifierState39 = words[261].Text; rawImport.OtherProviderIdentifierState4 = words[121].Text; rawImport.OtherProviderIdentifierState40 = words[265].Text; rawImport.OtherProviderIdentifierState41 = words[269].Text; rawImport.OtherProviderIdentifierState42 = words[273].Text; rawImport.OtherProviderIdentifierState43 = words[277].Text; rawImport.OtherProviderIdentifierState44 = words[281].Text; rawImport.OtherProviderIdentifierState45 = words[285].Text; rawImport.OtherProviderIdentifierState46 = words[289].Text; rawImport.OtherProviderIdentifierState47 = words[293].Text; rawImport.OtherProviderIdentifierState48 = words[297].Text; rawImport.OtherProviderIdentifierState49 = words[301].Text; rawImport.OtherProviderIdentifierState5 = words[125].Text; rawImport.OtherProviderIdentifierState50 = words[305].Text; rawImport.OtherProviderIdentifierState6 = words[129].Text; rawImport.OtherProviderIdentifierState7 = words[133].Text; rawImport.OtherProviderIdentifierState8 = words[137].Text; rawImport.OtherProviderIdentifierState9 = words[141].Text; rawImport.OtherProviderIdentifierTypeCode1 = words[108].Text; rawImport.OtherProviderIdentifierTypeCode10 = words[144].Text; rawImport.OtherProviderIdentifierTypeCode11 = words[148].Text; rawImport.OtherProviderIdentifierTypeCode12 = words[152].Text; rawImport.OtherProviderIdentifierTypeCode13 = words[156].Text; rawImport.OtherProviderIdentifierTypeCode14 = words[160].Text; rawImport.OtherProviderIdentifierTypeCode15 = words[164].Text; rawImport.OtherProviderIdentifierTypeCode16 = words[168].Text; rawImport.OtherProviderIdentifierTypeCode17 = words[172].Text; rawImport.OtherProviderIdentifierTypeCode18 = words[176].Text; rawImport.OtherProviderIdentifierTypeCode19 = words[180].Text; rawImport.OtherProviderIdentifierTypeCode2 = words[112].Text; rawImport.OtherProviderIdentifierTypeCode20 = words[184].Text; rawImport.OtherProviderIdentifierTypeCode21 = words[188].Text; rawImport.OtherProviderIdentifierTypeCode22 = words[192].Text; rawImport.OtherProviderIdentifierTypeCode23 = words[196].Text; rawImport.OtherProviderIdentifierTypeCode24 = words[200].Text; rawImport.OtherProviderIdentifierTypeCode25 = words[204].Text; rawImport.OtherProviderIdentifierTypeCode26 = words[208].Text; rawImport.OtherProviderIdentifierTypeCode27 = words[212].Text; rawImport.OtherProviderIdentifierTypeCode28 = words[216].Text; rawImport.OtherProviderIdentifierTypeCode29 = words[220].Text; rawImport.OtherProviderIdentifierTypeCode3 = words[116].Text; rawImport.OtherProviderIdentifierTypeCode30 = words[224].Text; rawImport.OtherProviderIdentifierTypeCode31 = words[228].Text; rawImport.OtherProviderIdentifierTypeCode32 = words[232].Text; rawImport.OtherProviderIdentifierTypeCode33 = words[236].Text; rawImport.OtherProviderIdentifierTypeCode34 = words[240].Text; rawImport.OtherProviderIdentifierTypeCode35 = words[244].Text; rawImport.OtherProviderIdentifierTypeCode36 = words[248].Text; rawImport.OtherProviderIdentifierTypeCode37 = words[252].Text; rawImport.OtherProviderIdentifierTypeCode38 = words[256].Text; rawImport.OtherProviderIdentifierTypeCode39 = words[260].Text; rawImport.OtherProviderIdentifierTypeCode4 = words[120].Text; rawImport.OtherProviderIdentifierTypeCode40 = words[264].Text; rawImport.OtherProviderIdentifierTypeCode41 = words[268].Text; rawImport.OtherProviderIdentifierTypeCode42 = words[272].Text; rawImport.OtherProviderIdentifierTypeCode43 = words[276].Text; rawImport.OtherProviderIdentifierTypeCode44 = words[280].Text; rawImport.OtherProviderIdentifierTypeCode45 = words[284].Text; rawImport.OtherProviderIdentifierTypeCode46 = words[288].Text; rawImport.OtherProviderIdentifierTypeCode47 = words[292].Text; rawImport.OtherProviderIdentifierTypeCode48 = words[296].Text; rawImport.OtherProviderIdentifierTypeCode49 = words[300].Text; rawImport.OtherProviderIdentifierTypeCode5 = words[124].Text; rawImport.OtherProviderIdentifierTypeCode50 = words[304].Text; rawImport.OtherProviderIdentifierTypeCode6 = words[128].Text; rawImport.OtherProviderIdentifierTypeCode7 = words[132].Text; rawImport.OtherProviderIdentifierTypeCode8 = words[136].Text; rawImport.OtherProviderIdentifierTypeCode9 = words[140].Text; rawImport.ParentOrganizationLBN = words[309].Text; rawImport.ParentOrganizationTIN = words[310].Text; rawImport.ProviderBusinessMailingAddressCityName = words[22].Text; rawImport.ProviderBusinessMailingAddressFaxNumber = words[27].Text; rawImport.ProviderBusinessMailingAddressPostalCode = words[24].Text; rawImport.ProviderBusinessMailingAddressStateName = words[23].Text; rawImport.ProviderBusinessMailingAddressTelephoneNumber = words[26].Text; rawImport.ProviderBusinessPracticeLocationAddressCityName = words[30].Text; rawImport.ProviderBusinessPracticeLocationAddressFaxNumber = words[35].Text; rawImport.ProviderBusinessPracticeLocationAddressPostalCode = words[32].Text; rawImport.ProviderBusinessPracticeLocationAddressStateName = words[31].Text; rawImport.ProviderCredentialText = words[10].Text; rawImport.ProviderEnumerationDate = words[36].Text; rawImport.ProviderFirstLineBusinessMailingAddress = words[20].Text; rawImport.ProviderFirstLineBusinessPracticeLocationAddress = words[28].Text; rawImport.ProviderFirstName = words[6].Text; rawImport.ProviderGenderCode = words[41].Text; rawImport.ProviderLastNameLegalName = words[5].Text; rawImport.ProviderLicenseNumber1 = words[48].Text; rawImport.ProviderLicenseNumber10 = words[84].Text; rawImport.ProviderLicenseNumber11 = words[88].Text; rawImport.ProviderLicenseNumber12 = words[92].Text; rawImport.ProviderLicenseNumber13 = words[96].Text; rawImport.ProviderLicenseNumber14 = words[100].Text; rawImport.ProviderLicenseNumber15 = words[104].Text; rawImport.ProviderLicenseNumber2 = words[52].Text; rawImport.ProviderLicenseNumber3 = words[56].Text; rawImport.ProviderLicenseNumber4 = words[60].Text; rawImport.ProviderLicenseNumber5 = words[64].Text; rawImport.ProviderLicenseNumber6 = words[68].Text; rawImport.ProviderLicenseNumber7 = words[72].Text; rawImport.ProviderLicenseNumber8 = words[76].Text; rawImport.ProviderLicenseNumber9 = words[80].Text; rawImport.ProviderLicenseNumberStateCode1 = words[49].Text; rawImport.ProviderLicenseNumberStateCode10 = words[85].Text; rawImport.ProviderLicenseNumberStateCode11 = words[89].Text; rawImport.ProviderLicenseNumberStateCode12 = words[93].Text; rawImport.ProviderLicenseNumberStateCode13 = words[97].Text; rawImport.ProviderLicenseNumberStateCode14 = words[101].Text; rawImport.ProviderLicenseNumberStateCode15 = words[105].Text; rawImport.ProviderLicenseNumberStateCode2 = words[53].Text; rawImport.ProviderLicenseNumberStateCode3 = words[57].Text; rawImport.ProviderLicenseNumberStateCode4 = words[61].Text; rawImport.ProviderLicenseNumberStateCode5 = words[65].Text; rawImport.ProviderLicenseNumberStateCode6 = words[69].Text; rawImport.ProviderLicenseNumberStateCode7 = words[73].Text; rawImport.ProviderLicenseNumberStateCode8 = words[77].Text; rawImport.ProviderLicenseNumberStateCode9 = words[81].Text; rawImport.ProviderMiddleName = words[7].Text; rawImport.ProviderNamePrefixText = words[8].Text; rawImport.ProviderNameSuffixText = words[9].Text; rawImport.ProviderOrganizationNameLegalBusinessName = words[4].Text; rawImport.ProviderOtherCredentialText = words[18].Text; rawImport.ProviderOtherFirstName = words[14].Text; rawImport.ProviderOtherLastName = words[13].Text; rawImport.ProviderOtherLastNameTypeCode = words[19].Text; rawImport.ProviderOtherMiddleName = words[15].Text; rawImport.ProviderOtherNamePrefixText = words[16].Text; rawImport.ProviderOtherNameSuffixText = words[17].Text; rawImport.ProviderOtherOrganizationName = words[11].Text; rawImport.ProviderOtherOrganizationNameTypeCode = words[12].Text; rawImport.ProviderSecondLineBusinessMailingAddress = words[21].Text; rawImport.ProviderSecondLineBusinessPracticeLocationAddress = words[29].Text; rawImport.ReplacementNPI = words[2].Text; rawImport.ProviderBusinessMailingAddressCountryCodeIfoutsideUS = words[25].Text; rawImport.ProviderBusinessPracticeLocationAddressCountryCodeIfoutsideUS = words[33].Text; rawImport.ProviderBusinessPracticeLocationAddressTelephoneNumber = words[34].Text; } }