private void LoadOfficeITAssets(string strOffice) { int intCounter; int intNumberOfRecords; TheFindCurrentITAssetsByOfficeDataSet = TheITAssetsClass.FindCurrentITAssetsByOffice(strOffice); TheReportedITAssetsDataSet.itassets.Rows.Clear(); intNumberOfRecords = TheFindCurrentITAssetsByOfficeDataSet.FindCurrentITAssetsByOffice.Rows.Count - 1; if (intNumberOfRecords > -1) { for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++) { ReportedITAssetsDataSet.itassetsRow NewAssetRow = TheReportedITAssetsDataSet.itassets.NewitassetsRow(); NewAssetRow.Item = TheFindCurrentITAssetsByOfficeDataSet.FindCurrentITAssetsByOffice[intCounter].Item; NewAssetRow.ItemID = TheFindCurrentITAssetsByOfficeDataSet.FindCurrentITAssetsByOffice[intCounter].ItemID; NewAssetRow.ItemQuantity = TheFindCurrentITAssetsByOfficeDataSet.FindCurrentITAssetsByOffice[intCounter].ItemQuantity; NewAssetRow.Manufacturer = TheFindCurrentITAssetsByOfficeDataSet.FindCurrentITAssetsByOffice[intCounter].Manufacturer; NewAssetRow.Model = TheFindCurrentITAssetsByOfficeDataSet.FindCurrentITAssetsByOffice[intCounter].Model; NewAssetRow.Office = strOffice; NewAssetRow.SerialNumber = TheFindCurrentITAssetsByOfficeDataSet.FindCurrentITAssetsByOffice[intCounter].SerialNumber; TheReportedITAssetsDataSet.itassets.Rows.Add(NewAssetRow); } } dgrResults.ItemsSource = TheReportedITAssetsDataSet.itassets; }
private void LoadAllAssets() { int intCounter; int intNumberOfRecords; try { TheReportedITAssetsDataSet.itassets.Rows.Clear(); TheFindActiveITAssetsDataSet = TheITAssetsClass.FindActiveITAssets(); intNumberOfRecords = TheFindActiveITAssetsDataSet.FindActiveITAssets.Rows.Count - 1; if (intNumberOfRecords > -1) { for (intCounter = 0; intCounter <= intNumberOfRecords; intCounter++) { ReportedITAssetsDataSet.itassetsRow NewAssetRow = TheReportedITAssetsDataSet.itassets.NewitassetsRow(); NewAssetRow.Item = TheFindActiveITAssetsDataSet.FindActiveITAssets[intCounter].Item; NewAssetRow.ItemID = TheFindActiveITAssetsDataSet.FindActiveITAssets[intCounter].ItemID; NewAssetRow.ItemQuantity = TheFindActiveITAssetsDataSet.FindActiveITAssets[intCounter].ItemQuantity; NewAssetRow.Manufacturer = TheFindActiveITAssetsDataSet.FindActiveITAssets[intCounter].Manufacturer; NewAssetRow.Model = TheFindActiveITAssetsDataSet.FindActiveITAssets[intCounter].Model; NewAssetRow.Office = TheFindActiveITAssetsDataSet.FindActiveITAssets[intCounter].FirstName; NewAssetRow.SerialNumber = TheFindActiveITAssetsDataSet.FindActiveITAssets[intCounter].SerialNumber; TheReportedITAssetsDataSet.itassets.Rows.Add(NewAssetRow); } } dgrResults.ItemsSource = TheReportedITAssetsDataSet.itassets; } catch (Exception Ex) { TheEventLogClass.InsertEventLogEntry(DateTime.Now, "Blue Jay ERP // Current IT Assets // Load All Assets " + Ex.Message); TheMessagesClass.ErrorMessage(Ex.ToString()); } }