初始化项目
This commit is contained in:
98
BLV_Studio/frm_ProjectSync.vb
Normal file
98
BLV_Studio/frm_ProjectSync.vb
Normal file
@@ -0,0 +1,98 @@
|
||||
Imports BLV_Studio
|
||||
|
||||
Public Class frm_ProjectSync
|
||||
Public _project As ProjectInfo
|
||||
Private Enum EnumGridCols
|
||||
No
|
||||
RoomType_ID
|
||||
RoomType_Name
|
||||
Site
|
||||
FileName
|
||||
FileSize
|
||||
FileModifiedDateTime
|
||||
SyncDirection
|
||||
MAX
|
||||
End Enum
|
||||
|
||||
Private Sub frm_ProjectSync_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
lab_CurrentHotelGroup.Text = _project.VerdorName
|
||||
lab_CurrentHotel.Text = _project.HotelCode & " - " & _project.HotelName
|
||||
Grd_init()
|
||||
End Sub
|
||||
|
||||
Private Sub Grd_init()
|
||||
grd_Project_Sync.AutoRedraw = False
|
||||
|
||||
'序号 房型ID 房型名称 配置文件 文件大小 修改日期 修改方向 本地文件修改日期 文件大小 备注
|
||||
|
||||
Dim roomCount As Integer
|
||||
If _project.RoomType Is Nothing Then
|
||||
roomCount = 0
|
||||
Else
|
||||
roomCount = _project.RoomType.Length
|
||||
End If
|
||||
|
||||
With grd_Project_Sync
|
||||
.Rows = roomCount * 2 + 1
|
||||
.Cols = EnumGridCols.MAX
|
||||
.DefaultRowHeight = 18
|
||||
.DefaultRowHeight = 30
|
||||
.Column(EnumGridCols.No).Width = 30
|
||||
.Column(EnumGridCols.RoomType_ID).Width = 40
|
||||
.Column(EnumGridCols.RoomType_Name).Width = 80
|
||||
.Column(EnumGridCols.Site).Width = 40
|
||||
.Column(EnumGridCols.FileName).Width = 400
|
||||
.Column(EnumGridCols.FileSize).Width = 60
|
||||
.Column(EnumGridCols.FileModifiedDateTime).Width = 80
|
||||
.Column(EnumGridCols.SyncDirection).Width = 20
|
||||
|
||||
.Cell(0, EnumGridCols.No).Text = "No."
|
||||
.Cell(0, EnumGridCols.RoomType_ID).Text = "ID"
|
||||
.Cell(0, EnumGridCols.RoomType_Name).Text = "房型"
|
||||
.Cell(0, EnumGridCols.FileName).Text = "文件名"
|
||||
.Cell(0, EnumGridCols.FileSize).Text = "文件大小"
|
||||
.Cell(0, EnumGridCols.FileModifiedDateTime).Text = "修改日期"
|
||||
.Cell(0, EnumGridCols.SyncDirection).Text = "同步方向"
|
||||
|
||||
.Column(EnumGridCols.No).Alignment = FlexCell.AlignmentEnum.CenterCenter
|
||||
.Column(EnumGridCols.RoomType_ID).Alignment = FlexCell.AlignmentEnum.CenterCenter
|
||||
.Column(EnumGridCols.RoomType_Name).Alignment = FlexCell.AlignmentEnum.CenterCenter
|
||||
.Column(EnumGridCols.Site).Alignment = FlexCell.AlignmentEnum.CenterCenter
|
||||
.Column(EnumGridCols.FileName).Alignment = FlexCell.AlignmentEnum.LeftCenter
|
||||
.Column(EnumGridCols.FileSize).Alignment = FlexCell.AlignmentEnum.CenterCenter
|
||||
.Column(EnumGridCols.FileModifiedDateTime).Alignment = FlexCell.AlignmentEnum.CenterCenter
|
||||
.Column(EnumGridCols.SyncDirection).Alignment = FlexCell.AlignmentEnum.CenterCenter
|
||||
.Cell(0, EnumGridCols.FileName).Alignment = FlexCell.AlignmentEnum.CenterCenter
|
||||
|
||||
.Range(0, 0, .Rows - 1, .Cols - 1).WrapText = True '自动换行
|
||||
.Font = New Font("Arial", 9, FontStyle.Bold) '字体’
|
||||
.AllowUserResizing = FlexCell.ResizeEnum.None '用户不可调节单元格大小’
|
||||
.ExtendLastCol = True
|
||||
End With
|
||||
|
||||
For i = 0 To roomCount - 1
|
||||
Dim tmpRowIdx As Integer = i * 2 + 1
|
||||
grd_Project_Sync.Range(tmpRowIdx, EnumGridCols.No, tmpRowIdx + 1, EnumGridCols.No).Merge()
|
||||
grd_Project_Sync.Range(tmpRowIdx, EnumGridCols.RoomType_ID, tmpRowIdx + 1, EnumGridCols.RoomType_ID).Merge()
|
||||
grd_Project_Sync.Range(tmpRowIdx, EnumGridCols.RoomType_Name, tmpRowIdx + 1, EnumGridCols.RoomType_Name).Merge()
|
||||
grd_Project_Sync.Range(tmpRowIdx, EnumGridCols.SyncDirection, tmpRowIdx + 1, EnumGridCols.SyncDirection).Merge()
|
||||
|
||||
grd_Project_Sync.Cell(tmpRowIdx, EnumGridCols.Site).Text = "云端"
|
||||
grd_Project_Sync.Cell(tmpRowIdx + 1, EnumGridCols.Site).Text = "本地"
|
||||
|
||||
grd_Project_Sync.Cell(tmpRowIdx, EnumGridCols.No).Text = i + 1
|
||||
grd_Project_Sync.Cell(tmpRowIdx, EnumGridCols.RoomType_ID).Text = _project.RoomType(i).structRoomType_ID
|
||||
grd_Project_Sync.Cell(tmpRowIdx, EnumGridCols.RoomType_Name).Text = _project.RoomType(i).structRoomType_Name
|
||||
grd_Project_Sync.Cell(tmpRowIdx, EnumGridCols.FileName).Text = _project.RoomType(i).structRoomType_XML_Filename
|
||||
|
||||
grd_Project_Sync.Range(tmpRowIdx, EnumGridCols.Site, tmpRowIdx, EnumGridCols.FileModifiedDateTime).ForeColor = Color.ForestGreen
|
||||
grd_Project_Sync.Range(tmpRowIdx + 1, EnumGridCols.Site, tmpRowIdx + 1, EnumGridCols.FileModifiedDateTime).ForeColor = Color.Blue
|
||||
|
||||
Next
|
||||
|
||||
grd_Project_Sync.Refresh()
|
||||
grd_Project_Sync.AutoRedraw = True
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user