上传回路增加碳达人的上传勾选
This commit is contained in:
@@ -89,7 +89,7 @@ Public Class SetLoopInformation
|
||||
If item.Type.Equals("4") Then
|
||||
'判断名称长度是否大于2
|
||||
If item.Name.Length > 2 Then
|
||||
G_loopNameAddr.Add(item.ModalAddress, item.Name.Substring(0, 2))
|
||||
G_loopNameAddr.Add(item.ModalAddress, item.Name.Replace("服务", ""))
|
||||
Else
|
||||
G_loopNameAddr.Add(item.ModalAddress, item.Name)
|
||||
End If
|
||||
@@ -121,36 +121,37 @@ Public Class SetLoopInformation
|
||||
'初始化表格
|
||||
Private Sub initTable()
|
||||
|
||||
Grid1.Cols = 21
|
||||
Grid1.Cols = 22
|
||||
Grid1.Rows = 1
|
||||
Grid1.Column(0).Locked = True
|
||||
Grid1.Cell(0, 0).Text = "序号"
|
||||
Grid1.Cell(0, 1).Text = "启用"
|
||||
Grid1.Cell(0, 2).Text = "类型"
|
||||
Grid1.Cell(0, 3).Text = "回路地址"
|
||||
Grid1.Column(3).Locked = True
|
||||
Grid1.Cell(0, 1).Text = "服务器"
|
||||
Grid1.Cell(0, 2).Text = "碳达人"
|
||||
Grid1.Cell(0, 3).Text = "类型"
|
||||
Grid1.Cell(0, 4).Text = "回路地址"
|
||||
Grid1.Column(4).Locked = True
|
||||
Grid1.Cell(0, 4).Text = "本地回路名称"
|
||||
Grid1.Cell(0, 5).Text = "云端回路地址"
|
||||
Grid1.Cell(0, 6).Text = "云端回路名称"
|
||||
Grid1.Cell(0, 7).Text = "英文名称"
|
||||
Grid1.Cell(0, 8).Text = "繁体名称"
|
||||
Grid1.Cell(0, 9).Text = "别名"
|
||||
Grid1.Cell(0, 10).Text = "功率"
|
||||
Grid1.Cell(0, 11).Text = "低电值"
|
||||
Grid1.Cell(0, 12).Text = "显示"
|
||||
Grid1.Cell(0, 13).Text = "离线"
|
||||
Grid1.Cell(0, 14).Text = "低电"
|
||||
Grid1.Cell(0, 15).Text = "声报"
|
||||
Grid1.Cell(0, 16).Text = "异常"
|
||||
Grid1.Cell(0, 17).Text = "排序"
|
||||
Grid1.Cell(0, 18).Text = "TCL设备名"
|
||||
Grid1.Cell(0, 19).Text = "组设备编号"
|
||||
Grid1.Cell(0, 20).Text = "组设备名"
|
||||
Grid1.Column(5).Locked = True
|
||||
Grid1.Cell(0, 5).Text = "本地回路名称"
|
||||
Grid1.Cell(0, 6).Text = "云端回路地址"
|
||||
Grid1.Cell(0, 7).Text = "云端回路名称"
|
||||
Grid1.Cell(0, 8).Text = "英文名称"
|
||||
Grid1.Cell(0, 9).Text = "繁体名称"
|
||||
Grid1.Cell(0, 10).Text = "别名"
|
||||
Grid1.Cell(0, 11).Text = "功率"
|
||||
Grid1.Cell(0, 12).Text = "低电值"
|
||||
Grid1.Cell(0, 13).Text = "显示"
|
||||
Grid1.Cell(0, 14).Text = "离线"
|
||||
Grid1.Cell(0, 15).Text = "低电"
|
||||
Grid1.Cell(0, 16).Text = "声报"
|
||||
Grid1.Cell(0, 17).Text = "异常"
|
||||
Grid1.Cell(0, 18).Text = "排序"
|
||||
Grid1.Cell(0, 19).Text = "TCL设备名"
|
||||
Grid1.Cell(0, 20).Text = "组设备编号"
|
||||
Grid1.Cell(0, 21).Text = "组设备名"
|
||||
Grid1.Column(1).CellType = FlexCell.CellTypeEnum.CheckBox
|
||||
Grid1.Column(1).Width = 25
|
||||
Grid1.Column(12).CellType = FlexCell.CellTypeEnum.CheckBox
|
||||
Grid1.Column(12).Width = 45
|
||||
Grid1.Column(1).Width = 40
|
||||
Grid1.Column(2).CellType = FlexCell.CellTypeEnum.CheckBox
|
||||
Grid1.Column(2).Width = 40
|
||||
Grid1.Column(13).CellType = FlexCell.CellTypeEnum.CheckBox
|
||||
Grid1.Column(13).Width = 45
|
||||
Grid1.Column(14).CellType = FlexCell.CellTypeEnum.CheckBox
|
||||
@@ -159,8 +160,10 @@ Public Class SetLoopInformation
|
||||
Grid1.Column(15).Width = 45
|
||||
Grid1.Column(16).CellType = FlexCell.CellTypeEnum.CheckBox
|
||||
Grid1.Column(16).Width = 45
|
||||
Grid1.Column(18).CellType = FlexCell.CellTypeEnum.ComboBox
|
||||
Grid1.Column(18).Width = 45
|
||||
Grid1.Column(17).CellType = FlexCell.CellTypeEnum.CheckBox
|
||||
Grid1.Column(17).Width = 45
|
||||
Grid1.Column(19).CellType = FlexCell.CellTypeEnum.ComboBox
|
||||
Grid1.Column(19).Width = 45
|
||||
For i As Integer = 0 To 20
|
||||
Grid1.Column(i).Alignment = FlexCell.AlignmentEnum.CenterCenter
|
||||
Next
|
||||
@@ -172,10 +175,10 @@ Public Class SetLoopInformation
|
||||
Private Sub Grid1_ComboDropDown(Sender As Object, e As FlexCell.Grid.ComboDropDownEventArgs) Handles Grid1.ComboDropDown
|
||||
|
||||
If e.Row > 0 Then
|
||||
Grid1.ComboBox(18).Items.Clear()
|
||||
Grid1.ComboBox(18).Items.Add("R-红")
|
||||
Grid1.ComboBox(18).Items.Add("G-绿")
|
||||
Grid1.ComboBox(18).Items.Add("B-蓝")
|
||||
Grid1.ComboBox(19).Items.Clear()
|
||||
Grid1.ComboBox(19).Items.Add("R-红")
|
||||
Grid1.ComboBox(19).Items.Add("G-绿")
|
||||
Grid1.ComboBox(19).Items.Add("B-蓝")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -195,11 +198,11 @@ Public Class SetLoopInformation
|
||||
With Grid1
|
||||
.AddItem("")
|
||||
.Cell(.Rows - 1, 0).Text = .Rows - 1
|
||||
.Cell(.Rows - 1, 2).Text = LoopType
|
||||
For i As Integer = 3 To .Cols - 1
|
||||
.Cell(.Rows - 1, i).Text = bufarry(i - 2)
|
||||
.Cell(.Rows - 1, 3).Text = LoopType
|
||||
For i As Integer = 4 To .Cols - 1
|
||||
.Cell(.Rows - 1, i).Text = bufarry(i - 3)
|
||||
If istag Then
|
||||
.Cell(.Rows - 1, i).Tag = bufarry(i - 2)
|
||||
.Cell(.Rows - 1, i).Tag = bufarry(i - 3)
|
||||
Else
|
||||
.Range(.Rows - 1, 1, .Rows - 1, .Cols - 1).ForeColor = Color.Red
|
||||
End If
|
||||
@@ -457,43 +460,44 @@ Public Class SetLoopInformation
|
||||
For Each row As RoomDevice In login.rows
|
||||
isaddrow = True
|
||||
For i = 1 To Grid1.Rows - 1
|
||||
If row.ModalAddress.Equals(Grid1.Cell(i, 3).Text) Then
|
||||
If row.ModalAddress.Equals(Grid1.Cell(i, 4).Text) Then
|
||||
|
||||
isaddrow = False
|
||||
Name = Grid1.Cell(i, 4).Text
|
||||
Name = Grid1.Cell(i, 5).Text
|
||||
If row.Name.Equals(Name) Then
|
||||
If row.IsUploadBaoJing Then
|
||||
Grid1.Cell(i, 1).Text = 1
|
||||
Grid1.Cell(i, 2).Text = 1
|
||||
Else
|
||||
Grid1.Cell(i, 1).Text = 0
|
||||
Grid1.Cell(i, 2).Text = 0
|
||||
End If
|
||||
|
||||
Grid1.Cell(i, 5).Text = row.ModalAddress
|
||||
Grid1.Cell(i, 6).Text = row.Name
|
||||
Grid1.Cell(i, 6).ForeColor = Color.Black
|
||||
Grid1.Cell(i, 4).ForeColor = Color.Black
|
||||
Grid1.Cell(i, 6).Text = row.ModalAddress
|
||||
Grid1.Cell(i, 7).Text = row.Name
|
||||
Grid1.Cell(i, 7).ForeColor = Color.Black
|
||||
Grid1.Cell(i, 5).ForeColor = Color.Black
|
||||
|
||||
Grid1.Cell(i, 7).Text = row.EnglishName
|
||||
Grid1.Cell(i, 8).Text = row.TWName
|
||||
Grid1.Cell(i, 9).Text = row.AliasName
|
||||
Grid1.Cell(i, 10).Text = row.Power
|
||||
Grid1.Cell(i, 11).Text = row.LowPower
|
||||
Grid1.Cell(i, 12).Text = row.ActiveIndicator
|
||||
Grid1.Cell(i, 13).Text = row.OfflineDisplay
|
||||
Grid1.Cell(i, 14).Text = row.LowPowerDisplay
|
||||
Grid1.Cell(i, 15).Text = row.Beep
|
||||
Grid1.Cell(i, 16).Text = row.Abnormal
|
||||
Grid1.Cell(i, 17).Text = row.Sort
|
||||
Grid1.Cell(i, 18).Text = row.TCLDeviceName
|
||||
Grid1.Cell(i, 19).Text = row.MultipleGroupID
|
||||
Grid1.Cell(i, 20).Text = row.MultipleTCLName
|
||||
Grid1.Cell(i, 8).Text = row.EnglishName
|
||||
Grid1.Cell(i, 9).Text = row.TWName
|
||||
Grid1.Cell(i, 10).Text = row.AliasName
|
||||
Grid1.Cell(i, 11).Text = row.Power
|
||||
Grid1.Cell(i, 12).Text = row.LowPower
|
||||
Grid1.Cell(i, 13).Text = row.ActiveIndicator
|
||||
Grid1.Cell(i, 14).Text = row.OfflineDisplay
|
||||
Grid1.Cell(i, 15).Text = row.LowPowerDisplay
|
||||
Grid1.Cell(i, 16).Text = row.Beep
|
||||
Grid1.Cell(i, 17).Text = row.Abnormal
|
||||
Grid1.Cell(i, 18).Text = row.Sort
|
||||
Grid1.Cell(i, 19).Text = row.TCLDeviceName
|
||||
Grid1.Cell(i, 20).Text = row.MultipleGroupID
|
||||
Grid1.Cell(i, 21).Text = row.MultipleTCLName
|
||||
|
||||
|
||||
Else
|
||||
Console.WriteLine($"{i}——{row.Name}——{Name}")
|
||||
Grid1.Cell(i, 5).Text = row.ModalAddress
|
||||
Grid1.Cell(i, 6).Text = row.Name
|
||||
Grid1.Cell(i, 7).ForeColor = Color.Red
|
||||
Grid1.Cell(i, 3).ForeColor = Color.Red
|
||||
Grid1.Cell(i, 6).Text = row.ModalAddress
|
||||
Grid1.Cell(i, 7).Text = row.Name
|
||||
Grid1.Cell(i, 8).ForeColor = Color.Red
|
||||
Grid1.Cell(i, 4).ForeColor = Color.Red
|
||||
End If
|
||||
Exit For
|
||||
End If
|
||||
@@ -526,6 +530,22 @@ Public Class SetLoopInformation
|
||||
|
||||
Private Sub Grid1_CellChange(Sender As Object, e As FlexCell.Grid.CellChangeEventArgs) Handles Grid1.CellChange
|
||||
If e.Row = 0 OrElse e.Col = 0 Then Return
|
||||
Dim Str As String = Grid1.Cell(e.Row, e.Col).Text
|
||||
If e.Col = 2 Then
|
||||
|
||||
If Str.Equals("True") OrElse Str.Equals("1") Then
|
||||
Grid1.Cell(e.Row, 1).Text = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If e.Col = 1 Then
|
||||
If Str.Equals("True") OrElse Str.Equals("1") Then
|
||||
|
||||
Else
|
||||
Grid1.Cell(e.Row, 2).Text = False
|
||||
End If
|
||||
End If
|
||||
|
||||
If String.IsNullOrEmpty(Grid1.Cell(e.Row, e.Col).Tag) Then
|
||||
Return
|
||||
Else
|
||||
@@ -556,42 +576,46 @@ Public Class SetLoopInformation
|
||||
ToolStripButton6.Enabled = False
|
||||
Dim mSaveRoomTypeModal As SaveRoomTypeModal
|
||||
Dim mSaveRoomTypeModalList As New List(Of SaveRoomTypeModal)
|
||||
Dim str As String
|
||||
For i = 1 To Grid1.Rows - 1
|
||||
If String.IsNullOrEmpty(Grid1.Cell(i, 3).Text) Then Continue For
|
||||
|
||||
mSaveRoomTypeModal = New SaveRoomTypeModal
|
||||
mSaveRoomTypeModal.id = 0
|
||||
mSaveRoomTypeModal.roomTypeID = G_roomtypeid
|
||||
mSaveRoomTypeModal.modalAddress = Grid1.Cell(i, 3).Text
|
||||
mSaveRoomTypeModal.name = Grid1.Cell(i, 4).Text
|
||||
mSaveRoomTypeModal.englishName = Grid1.Cell(i, 7).Text
|
||||
mSaveRoomTypeModal.twName = Grid1.Cell(i, 8).Text
|
||||
mSaveRoomTypeModal.aliasName = Grid1.Cell(i, 9).Text
|
||||
mSaveRoomTypeModal.power = CInt(Grid1.Cell(i, 10).Text)
|
||||
mSaveRoomTypeModal.LowPower = CInt(Grid1.Cell(i, 11).Text)
|
||||
mSaveRoomTypeModal.ActiveIndicator = CBool(Grid1.Cell(i, 12).Text)
|
||||
mSaveRoomTypeModal.OfflineDisplay = CBool(Grid1.Cell(i, 13).Text)
|
||||
mSaveRoomTypeModal.LowPowerDisplay = CBool(Grid1.Cell(i, 14).Text)
|
||||
mSaveRoomTypeModal.Beep = CBool(Grid1.Cell(i, 15).Text)
|
||||
mSaveRoomTypeModal.Abnormal = CBool(Grid1.Cell(i, 16).Text)
|
||||
mSaveRoomTypeModal.sort = CInt(Grid1.Cell(i, 17).Text)
|
||||
mSaveRoomTypeModal.TCLDeviceName = Grid1.Cell(i, 18).Text
|
||||
mSaveRoomTypeModal.MultipleGroupID = CInt(Grid1.Cell(i, 19).Text)
|
||||
mSaveRoomTypeModal.MultipleTCLName = Grid1.Cell(i, 20).Text
|
||||
mSaveRoomTypeModal.color = GetColorFromString(mSaveRoomTypeModal.modalAddress)
|
||||
|
||||
Dim str As String = Grid1.Cell(i, 1).Text
|
||||
Console.WriteLine(str)
|
||||
If String.IsNullOrEmpty(Grid1.Cell(i, 4).Text) Then Continue For
|
||||
str = Grid1.Cell(i, 1).Text
|
||||
If str.Equals("True") OrElse str.Equals("1") Then
|
||||
mSaveRoomTypeModal.IsUploadBaoJing = True
|
||||
Else
|
||||
mSaveRoomTypeModal.IsUploadBaoJing = False
|
||||
mSaveRoomTypeModal = New SaveRoomTypeModal
|
||||
mSaveRoomTypeModal.id = 0
|
||||
mSaveRoomTypeModal.roomTypeID = G_roomtypeid
|
||||
mSaveRoomTypeModal.modalAddress = Grid1.Cell(i, 4).Text
|
||||
mSaveRoomTypeModal.name = Grid1.Cell(i, 5).Text
|
||||
mSaveRoomTypeModal.englishName = Grid1.Cell(i, 8).Text
|
||||
mSaveRoomTypeModal.twName = Grid1.Cell(i, 9).Text
|
||||
mSaveRoomTypeModal.aliasName = Grid1.Cell(i, 10).Text
|
||||
mSaveRoomTypeModal.power = CInt(Grid1.Cell(i, 11).Text)
|
||||
mSaveRoomTypeModal.LowPower = CInt(Grid1.Cell(i, 12).Text)
|
||||
mSaveRoomTypeModal.ActiveIndicator = CBool(Grid1.Cell(i, 13).Text)
|
||||
mSaveRoomTypeModal.OfflineDisplay = CBool(Grid1.Cell(i, 14).Text)
|
||||
mSaveRoomTypeModal.LowPowerDisplay = CBool(Grid1.Cell(i, 15).Text)
|
||||
mSaveRoomTypeModal.Beep = CBool(Grid1.Cell(i, 16).Text)
|
||||
mSaveRoomTypeModal.Abnormal = CBool(Grid1.Cell(i, 17).Text)
|
||||
mSaveRoomTypeModal.sort = CInt(Grid1.Cell(i, 18).Text)
|
||||
mSaveRoomTypeModal.TCLDeviceName = Grid1.Cell(i, 19).Text
|
||||
mSaveRoomTypeModal.MultipleGroupID = CInt(Grid1.Cell(i, 20).Text)
|
||||
mSaveRoomTypeModal.MultipleTCLName = Grid1.Cell(i, 21).Text
|
||||
mSaveRoomTypeModal.color = GetColorFromString(mSaveRoomTypeModal.modalAddress)
|
||||
|
||||
Str = Grid1.Cell(i, 2).Text
|
||||
Console.WriteLine(str)
|
||||
If str.Equals("True") OrElse str.Equals("1") Then
|
||||
mSaveRoomTypeModal.IsUploadBaoJing = True
|
||||
Else
|
||||
mSaveRoomTypeModal.IsUploadBaoJing = False
|
||||
End If
|
||||
|
||||
mSaveRoomTypeModal.outlet = ""
|
||||
mSaveRoomTypeModal.type = GetLoopType1(mSaveRoomTypeModal.modalAddress)
|
||||
mSaveRoomTypeModal.color = ""
|
||||
mSaveRoomTypeModalList.Add(mSaveRoomTypeModal)
|
||||
End If
|
||||
|
||||
mSaveRoomTypeModal.outlet = ""
|
||||
mSaveRoomTypeModal.type = GetLoopType1(mSaveRoomTypeModal.modalAddress)
|
||||
mSaveRoomTypeModal.color = ""
|
||||
mSaveRoomTypeModalList.Add(mSaveRoomTypeModal)
|
||||
|
||||
Next
|
||||
|
||||
@@ -730,7 +754,7 @@ Public Class SetLoopInformation
|
||||
'设置按钮文本颜色为 RoyalRed
|
||||
ToolStripButton2.ForeColor = Color.Red
|
||||
'将所有复选框选中
|
||||
For i As Integer = 0 To Grid1.Rows - 1
|
||||
For i As Integer = 1 To Grid1.Rows - 1
|
||||
Grid1.Cell(i, 1).Text = "True"
|
||||
Next
|
||||
Else
|
||||
@@ -741,7 +765,7 @@ Public Class SetLoopInformation
|
||||
|
||||
|
||||
'将所有复选框取消选中
|
||||
For i As Integer = 0 To Grid1.Rows - 1
|
||||
For i As Integer = 1 To Grid1.Rows - 1
|
||||
Grid1.Cell(i, 1).Text = "False"
|
||||
Next
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user