Beispiel #1
0
        private void expProcessImport_Expanded(object sender, RoutedEventArgs e)
        {
            int    intCounter;
            int    intNumberOfRecords;
            bool   blnFatalError = false;
            string strAssetLocation;
            string strAssetSite;
            string strSiteDescription;

            try
            {
                intNumberOfRecords = TheImportWaspAssetLocationsDataSet.waspassetlocations.Rows.Count;

                if (intNumberOfRecords > 0)
                {
                    for (intCounter = 0; intCounter < intNumberOfRecords; intCounter++)
                    {
                        strAssetLocation   = TheImportWaspAssetLocationsDataSet.waspassetlocations[intCounter].AssetLocation;
                        strAssetSite       = TheImportWaspAssetLocationsDataSet.waspassetlocations[intCounter].AssetSite;
                        strSiteDescription = TheImportWaspAssetLocationsDataSet.waspassetlocations[intCounter].SiteDescription;

                        blnFatalError = TheAssetClass.InsertWaspAssetLocation(strAssetLocation, strAssetSite, strSiteDescription);

                        if (blnFatalError == true)
                        {
                            throw new Exception();
                        }
                    }
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Import Wasp Asset Locations // Process Import Expander " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }