Expand|Select|Wrap|Line Numbers
- Private Sub ListImos()
- On Error GoTo ErrorHandler
- Dim lCount As Long
- Dim sPict As String
- Dim objMouse As New CMouse
- Dim lvwItem As ListItem
- objMouse.SetHourglass
- If m_objBookedUnit Is Nothing Then Set m_objBookedUnit = New CBookedUnit
- With lvwIMO
- .ListItems.Clear
- .Icons = objApp.ClassPictures(lPictureSize:=FW_BOICONVIEW_LARGE)
- .SmallIcons = objApp.ClassPictures(lPictureSize:=FW_BOICONVIEW_SMALL)
- .View = lvwReport
- For lCount = 1 To m_objBookedUnit.IMOs.Count
- If m_objBookedUnit.IMOs.Item(lCount).sUpdateState = FW_BOSTATE_LOADED Or _
- m_objBookedUnit.IMOs.Item(lCount).sUpdateState = FW_BOSTATE_NEW Then
- If m_objBookedUnit.IMOs.Item(lCount).sUpdateState = FW_BOSTATE_LOADED Then
- sPict = "IMO"
- ElseIf m_objBookedUnit.IMOs.Item(lCount).sUpdateState = FW_BOSTATE_NEW Or _
- m_objBookedUnit.IMOs.Item(lCount).sUpdateState = FW_BOSTATE_EMPTY Then
- sPict = "NEWIMO"
- End If
- Set lvwItem = .ListItems.Add _
- (, , m_objBookedUnit.IMOs.Item(lCount).sTechnicalName)
- With lvwItem
- .Icon = sPict
- .SmallIcon = sPict
- .Tag = lCount
- .SubItems(1) = m_objBookedUnit.IMOs.Item(lCount).dNetWeight
- .SubItems(2) = m_objBookedUnit.IMOs.Item(lCount).sIMOClass
- End With
- End If
- Next lCount
- End With
- Set CurrentItem = Nothing
- Set m_OldItem = Nothing
- Exit Sub
- ErrorHandler:
- objApp.objAppError.BackTraceError TypeName(Me), "ListIMOs"
- Err.Raise Err
- End Sub
Its Green code is
Expand|Select|Wrap|Line Numbers
- Private Sub listImos()
- Try
- Dim spict As String = ""
- Dim objmouse As New CMouse
- Dim lvwitem As ListViewItem
- objmouse.SetHourglass()
- If m_objBookedUnit Is Nothing Then m_objBookedUnit = New PhxBL.CBookedUnit()
- With LvwIMO
- .Items.Clear()
- 'UPGRADE_WARNING: (1037) Couldn't resolve default property of object LvwIMO.Icons. More Information: http://www.vbtonet.com/ewis/ewi1037.aspx
- .LargeImageList = ObjApp.ClassPictures(FW_BOICONVIEW_LARGE)
- 'UPGRADE_WARNING: (1037) Couldn't resolve default property of object LvwIMO.SmallIcons. More Information: http://www.vbtonet.com/ewis/ewi1037.aspx
- .SmallImageList = ObjApp.ClassPictures(FW_BOICONVIEW_SMALL)
- .View = View.Details
- For lCount As Integer = 1 To m_objBookedUnit.IMOs.Count()
- If m_objBookedUnit.IMOs.Item(lcount).SUpdateState = FW_BOSTATE_LOADED Or m_objBookedUnit.IMOs.Item(lcount).SUpdateState = FW_BOSTATE_NEW Then
- If m_objBookedUnit.IMOs.Item(lcount).SUpdateState = FW_BOSTATE_LOADED Then
- spict = "IMO"
- ElseIf m_objBookedUnit.IMOs.Item(lcount).SUpdateState = FW_BOSTATE_NEW Or m_objBookedUnit.IMOs.Item(lcount).SUpdateState = FW_BOSTATE_EMPTY Then
- spict = "NEWIMO"
- End If
- lvwitem = .Items.Add(m_objBookedUnit.IMOs.Item(lcount).STechnicalName)
- With lvwitem
- 'UPGRADE_ISSUE: (2064) MSComctlLib.ListItem property lvwItem.Icon was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
- UpgradeStubs.MSComctlLib_IListItem.setIcon(lvwitem, spict)
- 'UPGRADE_ISSUE: (2064) MSComctlLib.ListItem property lvwItem.SmallIcon was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
- UpgradeStubs.MSComctlLib_IListItem.setSmallIcon(lvwitem, spict)
- 'UPGRADE_WARNING: (1037) Couldn't resolve default property of object lvwItem.Tag. More Information: http://www.vbtonet.com/ewis/ewi1037.aspx
- .Tag = CStr(lcount)
- ListViewHelper.GetListViewSubItem(lvwitem, 1).Text = CStr(m_objBookedUnit.IMOs.Item(lcount).DNetWeight)
- ListViewHelper.GetListViewSubItem(lvwitem, 2).Text = m_objBookedUnit.IMOs.Item(lcount).SIMOClass
- End With
- End If
- Next lcount
- End With
- CurrentItem = Nothing
- m_OldItem = Nothing
- Catch
- ObjApp.ObjAppError.BackTraceError(Me.GetType().Name, "ListIMOs")
- Throw New System.Exception(Information.Err().Number.ToString())
- End Try
- End Sub