1646 lines
81 KiB
VB.net
1646 lines
81 KiB
VB.net
Public Class Frm_Zone
|
|
Dim isCopy As Boolean = False
|
|
Dim Init As Boolean = False '//validate가 true일경우에만 동작하도록한다. 프로그램초기화중에는 작동하지않도록
|
|
Dim SrcDrv As DataRowView
|
|
|
|
#Region "data Base 변경여부및 적용방법"
|
|
|
|
'''변경된내용을적용한다.
|
|
Public Overrides Function AcceptChanged() As Boolean
|
|
dv.EndEdit()
|
|
bs.EndEdit()
|
|
Me.Validate()
|
|
|
|
Dim drv As DataRowView = Me.bs.Current
|
|
If drv Is Nothing Then Return False
|
|
|
|
Dim dr As DS.tbl_zoneRow = drv.Row
|
|
If Not IsNumeric(dr.천장고p) OrElse Not IsNumeric(dr.면적) Then
|
|
MsgBox("다음 존의 천장고/면적 정보가 잘못되었습니다" + vbCrLf + vbCrLf + _
|
|
"존 : " + dr.설명 + vbCrLf + _
|
|
"면적 : " + dr.면적 + vbCrLf + _
|
|
"천장고 : " + dr.천장고p + vbCrLf + vbCrLf + _
|
|
"해당 값들은 숫자로 입력되어야 합니다." + vbCrLf + _
|
|
"이 값은 오류제한으로 인해 '0' 값으로 변경됩니다", MsgBoxStyle.Critical, "확인")
|
|
|
|
If Not IsNumeric(dr.천장고p) Then dr.천장고p = "0"
|
|
If Not IsNumeric(dr.면적) Then dr.면적 = "0"
|
|
End If
|
|
|
|
|
|
Dim BaseDS As DataSet = CType(bs.DataSource, DataSet)
|
|
Dim BaseDT As DataTable = BaseDS.Tables(bs.DataMember)
|
|
BaseDT.AcceptChanges()
|
|
Return True
|
|
End Function
|
|
|
|
'''변경된내용이있다면 취소한다.
|
|
Public Overrides Function RejectChanged() As Boolean
|
|
dv.EndEdit()
|
|
bs.EndEdit()
|
|
Me.Validate()
|
|
|
|
Dim BaseDS As DataSet = CType(bs.DataSource, DataSet)
|
|
Dim BaseDT As DataTable = BaseDS.Tables(bs.DataMember)
|
|
BaseDT.RejectChanges()
|
|
Return True
|
|
End Function
|
|
|
|
'''데이터에변형이있었는가?
|
|
Public Overrides Function HasChanged() As Boolean
|
|
dv.EndEdit()
|
|
bs.EndEdit()
|
|
Me.Validate()
|
|
|
|
Dim BaseDS As DataSet = CType(bs.DataSource, DataSet)
|
|
Dim BaseDT As DataTable = BaseDS.Tables(bs.DataMember)
|
|
Dim ChangeDT As DataTable = BaseDT.GetChanges
|
|
If Not ChangeDT Is Nothing Then Return True
|
|
Return False
|
|
End Function
|
|
|
|
'''기본데이터테이블을 반환합니다.
|
|
Public Function DT() As DataTable
|
|
Dim BaseDS As DataSet = CType(bs.DataSource, DataSet)
|
|
Return BaseDS.Tables(bs.DataMember)
|
|
End Function
|
|
#End Region
|
|
|
|
Public Sub New(_opentime)
|
|
|
|
' 이 호출은 디자이너에 필요합니다.
|
|
InitializeComponent()
|
|
OpenTime = _opentime
|
|
' InitializeComponent() 호출 뒤에 초기화 코드를 추가하십시오.
|
|
End Sub
|
|
|
|
Private Sub MdiMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
|
|
Me.Show()
|
|
My.Application.DoEvents()
|
|
'Work_msg_timer("잠시만 기다려주세요")
|
|
|
|
Me.Init = False
|
|
'MdiMain.Toggle_Menu_Color(MdiMain.E_MenuIdx.입력존)
|
|
'//공유데이터셋에 연결한다.
|
|
Me.bs.DataSource = DSET1
|
|
|
|
'//Zone
|
|
AddHandler DSET1.tbl_zone.TableNewRow, AddressOf tblNewRow
|
|
AddHandler DSET1.tbl_zone.ColumnChanged, AddressOf tblColumnChanged
|
|
AddHandler DSET1.tbl_zone.ColumnChanging, AddressOf tblColumnChanging
|
|
|
|
'//모든컨트롤의 cTrl_enter 를 추가합니다
|
|
BindProperty(CType(Me.SplitContainer1.Panel2.Controls, Control.ControlCollection))
|
|
|
|
'//콤보컨트롤 바인딩
|
|
Binding_Zone()
|
|
|
|
Me.bs.Filter = "code <> '0'"
|
|
If Me.Parameter <> "" Then Me.bs.Filter &= " and 그룹 ='" + Me.Parameter + "'"
|
|
Me.lb_grpname.Text = Me.Parameter
|
|
|
|
Try
|
|
Me.bs.Position = CEnergy.ARINCLASS.Read_LastPos_Frm(Me)
|
|
Catch ex As Exception
|
|
Me.bs.MoveFirst()
|
|
End Try
|
|
Me.Init = True
|
|
bs_CurrentChanged(sender, e)
|
|
Validate_Control()
|
|
ZONE_Control()
|
|
|
|
AddDebug("▲ Form Load")
|
|
End Sub
|
|
|
|
Private Sub MdiMain_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
|
|
|
|
AddDebug("▼ Form Closed")
|
|
|
|
RemoveHandler DSET1.tbl_zone.TableNewRow, AddressOf tblNewRow
|
|
RemoveHandler DSET1.tbl_zone.ColumnChanged, AddressOf tblColumnChanged
|
|
RemoveHandler DSET1.tbl_zone.ColumnChanging, AddressOf tblColumnChanging
|
|
|
|
CEnergy.ARINCLASS.SaveLoad_FrmSetting(Me, Me.bs.Position, True)
|
|
End Sub
|
|
|
|
#Region "Control_Enter"
|
|
Private Sub BindProperty(ByVal Ctl As Control.ControlCollection)
|
|
For Each C As Control In Ctl
|
|
If C.Controls.Count > 1 Then
|
|
BindProperty(C.Controls)
|
|
Else
|
|
If C.GetType.ToString.ToUpper.IndexOf("MYTB") <> -1 Then
|
|
AddHandler CType(C, MyTb).KeyDown, AddressOf TextBOx_KeyDown
|
|
ElseIf C.GetType.ToString.ToUpper.IndexOf("MYCMB") <> -1 Then
|
|
AddHandler CType(C, MyCmb).KeyDown, AddressOf Cmd_KeyDown
|
|
AddHandler CType(C, MyCmb).MouseHover, AddressOf ComboBox_MouseHover
|
|
End If
|
|
End If
|
|
Next
|
|
End Sub
|
|
|
|
|
|
Private Sub TextBOx_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
|
|
If e.KeyCode = Keys.Enter AndAlso e.Control Then
|
|
Try
|
|
Dim Field As String = (CType(sender, MyTb).DataBindings.Item("text").BindingMemberInfo.BindingField)
|
|
For Each Dr As DataRow In Dt.Select(Me.bs.Filter, "")
|
|
Dr(Field) = CType(sender, MyTb).Text
|
|
If Field = "면적" OrElse Field = "천장고p" Then
|
|
Dr("순실체적") = TOSG(Dr("면적").ToString) * TOSG(Dr("천장고p").ToString)
|
|
End If
|
|
Next
|
|
Work_msg_timer("모든값이 변경되었습니다", 25)
|
|
Show_면적존수합()
|
|
Show_순실체적()
|
|
Show_점등시간()
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
End If
|
|
End Sub
|
|
Private Sub Cmd_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
|
|
If e.KeyCode = Keys.Enter AndAlso e.Control Then
|
|
Try
|
|
Dim Field As String = (CType(sender, MyCmb).DataBindings.Item("selectedvalue").BindingMemberInfo.BindingField)
|
|
For Each Dr As DataRow In Dt.Select(Me.bs.Filter, "") 'Dt.rows
|
|
Dr(Field) = CType(sender, MyCmb).SelectedValue
|
|
Next
|
|
Work_msg_timer("모든값이 변경되었습니다", 25)
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub ComboBox_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs)
|
|
'//공백의 경우 에러가 나서 우선 막아둠.
|
|
Try
|
|
Me.ToolTip1.SetToolTip(CType(sender, ComboBox), CType(sender, ComboBox).DataBindings("selectedvalue").BindingMemberInfo.BindingMember & vbCrLf & CType(sender, ComboBox).SelectedValue.ToString)
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
End Sub
|
|
|
|
|
|
#End Region
|
|
|
|
#Region "ComboxBox Binding"
|
|
Private Sub MdiMain_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
|
|
Select Case e.KeyCode
|
|
Case Keys.F12
|
|
ShowHistory()
|
|
Case Keys.A
|
|
If e.Alt Then
|
|
bt_add.PerformClick()
|
|
End If
|
|
End Select
|
|
End Sub
|
|
Private Sub Cmb_DeleteVal(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
|
|
If e.KeyCode = Keys.Delete Then
|
|
CType(sender, ComboBox).SelectedValue = ""
|
|
End If
|
|
End Sub
|
|
Private Sub Binding_Zone()
|
|
Dim bs_cmb_profile As New BindingSource(DSET1, "tbl_profile")
|
|
bs_cmb_profile.Sort = "code"
|
|
cmb_profile.DataSource = bs_cmb_profile
|
|
cmb_profile.DisplayMember = "설명"
|
|
cmb_profile.ValueMember = "code"
|
|
Me.cmb_profile.DataBindings.Add("selectedvalue", Me.bs, "프로필")
|
|
'AddHandler cmb_profile.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_kongkub As New BindingSource(DSET1, "tbl_kongkub")
|
|
bs_cmb_kongkub.Sort = "code"
|
|
냉난방열공급시스템ComboBox.DataSource = bs_cmb_kongkub
|
|
냉난방열공급시스템ComboBox.DisplayMember = "설명"
|
|
냉난방열공급시스템ComboBox.ValueMember = "code"
|
|
Me.냉난방열공급시스템ComboBox.DataBindings.Add("selectedvalue", Me.bs, "냉난방열공급시스템")
|
|
'AddHandler 냉난방열공급시스템ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_열저장능력 As New BindingSource(DSET1, "tbl_common")
|
|
bs_cmb_열저장능력.Filter = "gubun='1023'"
|
|
bs_cmb_열저장능력.Sort = "code"
|
|
열저장능력ComboBox.DataSource = bs_cmb_열저장능력
|
|
열저장능력ComboBox.DisplayMember = "name"
|
|
열저장능력ComboBox.ValueMember = "name"
|
|
Me.열저장능력ComboBox.DataBindings.Add("selectedvalue", Me.bs, "열저장능력")
|
|
'AddHandler 열저장능력ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_열교가산치 As New BindingSource(DSET1, "tbl_common")
|
|
bs_cmb_열교가산치.Filter = "gubun='1022'"
|
|
bs_cmb_열교가산치.Sort = "code"
|
|
열교가산치ComboBox.DataSource = bs_cmb_열교가산치
|
|
열교가산치ComboBox.DisplayMember = "name"
|
|
열교가산치ComboBox.ValueMember = "name"
|
|
Me.열교가산치ComboBox.DataBindings.Add("selectedvalue", Me.bs, "열교가산치")
|
|
'AddHandler 열교가산치ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_주말운전방식 As New BindingSource(DSET1, "tbl_common")
|
|
bs_cmb_주말운전방식.Filter = "gubun='1002'"
|
|
bs_cmb_주말운전방식.Sort = "code"
|
|
주말운전방식ComboBox.DataSource = bs_cmb_주말운전방식
|
|
주말운전방식ComboBox.DisplayMember = "name"
|
|
주말운전방식ComboBox.ValueMember = "name"
|
|
Me.주말운전방식ComboBox.DataBindings.Add("selectedvalue", Me.bs, "주말운전방식")
|
|
'AddHandler 주말운전방식ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_야간운전방식 As New BindingSource(DSET1, "tbl_common")
|
|
bs_cmb_야간운전방식.Filter = "gubun='1002'"
|
|
bs_cmb_야간운전방식.Sort = "code"
|
|
야간운전방식ComboBox.DataSource = bs_cmb_야간운전방식
|
|
야간운전방식ComboBox.DisplayMember = "name"
|
|
야간운전방식ComboBox.ValueMember = "name"
|
|
Me.야간운전방식ComboBox.DataBindings.Add("selectedvalue", Me.bs, "야간운전방식")
|
|
'AddHandler 야간운전방식ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_외기처리여부 As New BindingSource(DSET1, "tbl_common")
|
|
bs_cmb_외기처리여부.Filter = "gubun='1054'"
|
|
bs_cmb_외기처리여부.Sort = "code"
|
|
외기부하처리여부ComboBox.DataSource = bs_cmb_외기처리여부
|
|
외기부하처리여부ComboBox.DisplayMember = "name"
|
|
외기부하처리여부ComboBox.ValueMember = "name"
|
|
Me.외기부하처리여부ComboBox.DataBindings.Add("selectedvalue", Me.bs, "외기부하처리여부")
|
|
'AddHandler 외기부하처리여부ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_냉난방공조 As New BindingSource(DSET1, "tbl_common")
|
|
bs_cmb_냉난방공조.Filter = "gubun='1001'"
|
|
bs_cmb_냉난방공조.Sort = "code"
|
|
냉난방공조ComboBox.DataSource = bs_cmb_냉난방공조
|
|
냉난방공조ComboBox.DisplayMember = "name"
|
|
냉난방공조ComboBox.ValueMember = "name"
|
|
Me.냉난방공조ComboBox.DataBindings.Add("selectedvalue", Me.bs, "냉난방공조")
|
|
'AddHandler 냉난방공조ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_냉난방방식 As New BindingSource(DSET1, "tbl_common")
|
|
bs_cmb_냉난방방식.Filter = "gubun='1000'"
|
|
bs_cmb_냉난방방식.Sort = "code"
|
|
cmb_냉난방방식.DataSource = bs_cmb_냉난방방식
|
|
cmb_냉난방방식.DisplayMember = "name"
|
|
cmb_냉난방방식.ValueMember = "name"
|
|
Me.cmb_냉난방방식.DataBindings.Add("selectedvalue", Me.bs, "냉난방방식")
|
|
'AddHandler cmb_냉난방방식.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
|
|
Dim bs_cmb_공조처리 As New BindingSource(DSET1, "tbl_kongjo")
|
|
bs_cmb_공조처리.Sort = "code"
|
|
냉난방공조처리시스템ComboBox.DataSource = bs_cmb_공조처리
|
|
냉난방공조처리시스템ComboBox.DisplayMember = "설명"
|
|
냉난방공조처리시스템ComboBox.ValueMember = "code"
|
|
Me.냉난방공조처리시스템ComboBox.DataBindings.Add("selectedvalue", Me.bs, "냉난방공조처리시스템")
|
|
'AddHandler 냉난방공조처리시스템ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_난방기기 As New BindingSource(DSET1, "tbl_nanbangkiki")
|
|
bs_cmb_난방기기.Sort = "code"
|
|
cmb_열생산지정1.DataSource = bs_cmb_난방기기
|
|
cmb_열생산지정1.DisplayMember = "설명"
|
|
cmb_열생산지정1.ValueMember = "code"
|
|
Me.cmb_열생산지정1.DataBindings.Add("selectedvalue", Me.bs, "열생산난방생산기기")
|
|
'AddHandler cmb_열생산지정1.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
|
|
'//공조추가 101105
|
|
Dim bs_cmb_공조난방기기 As New BindingSource(DSET1, "tbl_nanbangkiki")
|
|
bs_cmb_공조난방기기.Sort = "code"
|
|
cmb_공조난방생산.DataSource = bs_cmb_공조난방기기
|
|
cmb_공조난방생산.DisplayMember = "설명"
|
|
cmb_공조난방생산.ValueMember = "code"
|
|
Me.cmb_공조난방생산.DataBindings.Add("selectedvalue", Me.bs, "공조난방생산기기")
|
|
|
|
Dim bs_cmb_공조냉방기기 As New BindingSource(DSET1, "tbl_nangbangkiki")
|
|
bs_cmb_공조냉방기기.Sort = "code"
|
|
cmb_공조냉방생산.DataSource = bs_cmb_공조냉방기기
|
|
cmb_공조냉방생산.DisplayMember = "설명"
|
|
cmb_공조냉방생산.ValueMember = "code"
|
|
Me.cmb_공조냉방생산.DataBindings.Add("selectedvalue", Me.bs, "공조냉방생산기기")
|
|
'//공조추가 101105
|
|
|
|
Dim bs_cmb_급탕기기 As New BindingSource(DSET1, "tbl_nanbangkiki")
|
|
bs_cmb_급탕기기.Sort = "code"
|
|
cmb_열생산급탕기기.DataSource = bs_cmb_급탕기기
|
|
cmb_열생산급탕기기.DisplayMember = "설명"
|
|
cmb_열생산급탕기기.ValueMember = "code"
|
|
Me.cmb_열생산급탕기기.DataBindings.Add("selectedvalue", Me.bs, "열생산급탕생산기기")
|
|
'AddHandler cmb_열생산지정2.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_냉방기기 As New BindingSource(DSET1, "tbl_nangbangkiki")
|
|
bs_cmb_냉방기기.Sort = "code"
|
|
cmb_열생산지정3.DataSource = bs_cmb_냉방기기
|
|
cmb_열생산지정3.DisplayMember = "설명"
|
|
cmb_열생산지정3.ValueMember = "code"
|
|
Me.cmb_열생산지정3.DataBindings.Add("selectedvalue", Me.bs, "열생산냉방생산기기")
|
|
'AddHandler cmb_열생산지정3.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_가습기기 As New BindingSource(DSET1, "tbl_nanbangkiki")
|
|
bs_cmb_가습기기.Sort = "code"
|
|
cmb_공조가습생산.DataSource = bs_cmb_가습기기
|
|
cmb_공조가습생산.DisplayMember = "설명"
|
|
cmb_공조가습생산.ValueMember = "code"
|
|
Me.cmb_공조가습생산.DataBindings.Add("selectedvalue", Me.bs, "열생산가습생산기기")
|
|
'AddHandler cmb_열생산지정4.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
'Dim bs_cmb_냉방공조분배 As New BindingSource(DSET, "tbl_bunbae")
|
|
'bs_cmb_냉방공조분배.Sort = "code"
|
|
'냉난방공조분배시스템ComboBox.DataSource = bs_cmb_냉방공조분배
|
|
'냉난방공조분배시스템ComboBox.DisplayMember = "설명"
|
|
'냉난방공조분배시스템ComboBox.ValueMember = "code"
|
|
'Me.냉난방공조분배시스템ComboBox.DataBindings.Add("selectedvalue", Me.bs, "냉난방공조분배시스템")
|
|
''AddHandler 냉난방공조분배시스템ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
'Dim bs_cmb_냉방분배 As New BindingSource(DSET, "tbl_bunbae")
|
|
'bs_cmb_냉방분배.Sort = "code"
|
|
'냉난방분배시스템ComboBox.DataSource = bs_cmb_냉방분배
|
|
'냉난방분배시스템ComboBox.DisplayMember = "설명"
|
|
'냉난방분배시스템ComboBox.ValueMember = "code"
|
|
'Me.냉난방분배시스템ComboBox.DataBindings.Add("selectedvalue", Me.bs, "냉난방분배시스템")
|
|
''AddHandler 냉난방분배시스템ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_조명부하산출방법 As New BindingSource(DSET1, "tbl_common")
|
|
bs_cmb_조명부하산출방법.Sort = "code"
|
|
bs_cmb_조명부하산출방법.Filter = "gubun='1031'"
|
|
조명부하산출방법ComboBox.DataSource = bs_cmb_조명부하산출방법
|
|
조명부하산출방법ComboBox.DisplayMember = "name"
|
|
조명부하산출방법ComboBox.ValueMember = "name"
|
|
Me.조명부하산출방법ComboBox.DataBindings.Add("selectedvalue", Me.bs, "조명부하산출방법")
|
|
'AddHandler 조명부하산출방법ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_인공광원 As New BindingSource(DSET1, "tbl_common")
|
|
bs_cmb_인공광원.Sort = "code"
|
|
bs_cmb_인공광원.Filter = "gubun='1024'"
|
|
Me.인공광원ComboBox.DataSource = bs_cmb_인공광원
|
|
인공광원ComboBox.DisplayMember = "name"
|
|
인공광원ComboBox.ValueMember = "name"
|
|
Me.인공광원ComboBox.DataBindings.Add("selectedvalue", Me.bs, "인공광원")
|
|
'AddHandler 인공광원ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
Dim bs_cmb_조명방식 As New BindingSource(DSET1, "tbl_common")
|
|
bs_cmb_조명방식.Sort = "code"
|
|
bs_cmb_조명방식.Filter = "gubun='1025'"
|
|
Me.조명방식ComboBox.DataSource = bs_cmb_조명방식
|
|
조명방식ComboBox.DisplayMember = "name"
|
|
조명방식ComboBox.ValueMember = "name"
|
|
Me.조명방식ComboBox.DataBindings.Add("selectedvalue", Me.bs, "조명방식")
|
|
'AddHandler 조명방식ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
|
|
'Dim bs_cmb_그룹존 As New BindingSource(DSET, "tbl_common")
|
|
'bs_cmb_그룹존.Sort = "code"
|
|
'bs_cmb_그룹존.Filter = "gubun='1200'"
|
|
'Me.cmb_그룹_존.DataSource = bs_cmb_그룹존
|
|
'Me.cmb_그룹_존.DisplayMember = "name"
|
|
'Me.cmb_그룹_존.ValueMember = "name"
|
|
'Me.cmb_그룹_존.DataBindings.Add("selectedvalue", Me.bs, "그룹")
|
|
'AddHandler 조명방식ComboBox.KeyDown, AddressOf Cmb_DeleteVal
|
|
End Sub
|
|
|
|
'''새로운데이터가 추가될때 발생하는 이벤트
|
|
Private Sub tblNewRow(ByVal sender As Object, ByVal e As System.Data.DataTableNewRowEventArgs)
|
|
AddDebug("tblNewRow")
|
|
e.Row.Item("code") = GetMaxCode(DSET1.tbl_zone, DSET1.tbl_myoun)
|
|
e.Row.Item("조명부하산출방법") = "입력치"
|
|
e.Row.Item("설명") = "신규이름"
|
|
If Me.Parameter = "" Then
|
|
e.Row.Item("그룹") = "0"
|
|
e.Row.Item("sortkey") = GetNewSortKey(DSET1.tbl_zone)
|
|
Else
|
|
e.Row.Item("그룹") = Me.Parameter '//그룹값이있다면 기본그룹값으로처리해준다.
|
|
e.Row.Item("sortkey") = GetNewSortKey(DSET1.tbl_zone, Me.Parameter)
|
|
|
|
'//동일그룹내의 최대값을 찾는다
|
|
End If
|
|
|
|
'//위처럼 데이터를 넣어주면 기본값이 되요.. 계산치
|
|
End Sub
|
|
|
|
Private Function GetNewSortKey(ByRef dt As DS.tbl_zoneDataTable, Optional grpname As String = "") As String
|
|
If dt.Rows.Count < 1 Then Return 1
|
|
|
|
If Not String.IsNullOrWhiteSpace(grpname) Then
|
|
Dim drows() As DS.tbl_zoneRow = dt.Select("그룹='" + grpname + "' and code <> '0'", "sortkey desc")
|
|
If drows.Length < 1 Then Return 1
|
|
Dim Dr As DS.tbl_zoneRow = drows(0)
|
|
Dim maxsortkey As Integer = Dr.sortkey
|
|
Return maxsortkey + 1
|
|
Else
|
|
Dim drows() As DS.tbl_zoneRow = dt.Select("code <> '0'", "sortkey desc")
|
|
If drows.Length < 1 Then Return 1
|
|
Dim Dr As DS.tbl_zoneRow = drows(0)
|
|
Dim maxsortkey As Integer = Dr.sortkey
|
|
Return maxsortkey + 1
|
|
End If
|
|
|
|
End Function
|
|
|
|
Private Function GetMaxCode(ByRef dt As DataTable, ByRef dt_myoun As DataTable) As String
|
|
Try
|
|
Dim Dr As DataRow = dt.Select("", "code desc")(0)
|
|
Dim Dr_myoun As DataRow = dt_myoun.Select("", "존분류 desc")(0)
|
|
Dim str_zone As String = Dr("code").ToString
|
|
Dim str_myoun As String = Dr_myoun("존분류").ToString
|
|
If CInt(str_zone) >= CInt(str_myoun) Then
|
|
Return Format(CInt(str_zone) + 1, "00000")
|
|
Else
|
|
Return Format(CInt(str_myoun) + 1, "00000")
|
|
End If
|
|
Catch ex As Exception
|
|
Return "00001"
|
|
End Try
|
|
End Function
|
|
|
|
Private Sub ToolStripButton48_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_add.Click
|
|
If Not EndEdit(Me.bs) Then Return
|
|
Me.bs.AddNew()
|
|
Me.dv.Refresh()
|
|
INitRow(Me.Controls)
|
|
bs.EndEdit()
|
|
DT.AcceptChanges()
|
|
MdiMain.RefreshMenuList(TreeTag)
|
|
End Sub
|
|
|
|
Private Sub ToolStripButton49_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_Del.Click
|
|
Del_ZoneMyoun(True)
|
|
MdiMain.RefreshMenuList(TreeTag)
|
|
End Sub
|
|
|
|
Private Sub ToolStripButton51_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_cancel.Click
|
|
If Not EndEdit(Me.bs) Then Return
|
|
Data_Cancel(DSET1.tbl_profile, Nothing)
|
|
MdiMain.RefreshMenuList(TreeTag)
|
|
End Sub
|
|
|
|
Private Sub Frm_V20091231_Zone_MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseWheel
|
|
If e.Delta < 0 Then
|
|
If Me.bs.Position < Me.bs.Count Then Me.bs.Position += 1
|
|
Else
|
|
If Me.bs.Position > 0 Then Me.bs.Position -= 1
|
|
End If
|
|
Me.Validate()
|
|
My.Application.DoEvents()
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
Private Sub tblColumnChanging(ByVal sender As Object, ByVal e As System.Data.DataColumnChangeEventArgs)
|
|
Dim oval As String = e.Row(e.Column.ColumnName).ToString
|
|
Dim nval As String = e.ProposedValue.ToString
|
|
|
|
AddDebug(String.Format("♠값변경중 {0} {1}->{2}", e.Column.ColumnName, oval, nval))
|
|
|
|
If oval <> nval Then
|
|
Dim newdr As DS2.historyRow = DSHistory.history.NewhistoryRow
|
|
newdr.time = Now.ToString("yyyy-MM-dd HH:mm:ss")
|
|
newdr.tablename = "tbl_zone"
|
|
newdr.ovalue = oval
|
|
newdr.nvalue = nval
|
|
newdr.column = e.Column.ColumnName
|
|
newdr.code = e.Row("code").ToString
|
|
DSHistory.history.AddhistoryRow(newdr)
|
|
DSHistory.history.AcceptChanges()
|
|
End If
|
|
End Sub
|
|
Private Sub tblColumnChanged(ByVal sender As Object, ByVal e As System.Data.DataColumnChangeEventArgs)
|
|
'//값이바뀐다면 조명의실지수값을 재계산한다.
|
|
Dim oval As String = e.Row(e.Column.ColumnName).ToString
|
|
Dim nval As String = e.ProposedValue.ToString
|
|
|
|
AddDebug(String.Format("♠값변경됨 {0} {1}->{2}", e.Column.ColumnName, oval, nval))
|
|
|
|
Select Case e.Column.Caption.Trim
|
|
Case "면적", "천장고p" '//순실체적
|
|
Try
|
|
Me.순실체적NTb.Text = Val(e.Row("면적")) * Val(e.Row("천장고p"))
|
|
Catch ex As Exception
|
|
Me.순실체적NTb.Text = 0
|
|
'e.Row("순실체적") = 0
|
|
End Try
|
|
Me.bs.EndEdit()
|
|
Case "실깊이", "실너비", "천장고", "작업면높이"
|
|
If Me.조명부하산출방법ComboBox.Text = "계산치" Then
|
|
Try
|
|
Dim 실깊이 As Decimal = TOSG(e.Row("실깊이"))
|
|
Dim 실너비 As Decimal = TOSG(e.Row("실너비"))
|
|
Dim 천장고 As Decimal = TOSG(e.Row("천장고"))
|
|
Dim 작업면높이 As Decimal = TOSG(e.Row("작업면높이"))
|
|
e.Row("실지수") = 실깊이 * 실너비 / ((천장고 - 작업면높이) * (실깊이 + 실너비))
|
|
Catch ex As Exception
|
|
e.Row("실지수") = 0
|
|
End Try
|
|
End If
|
|
Me.bs.EndEdit()
|
|
Case "조명방식", "인공광원", "실지수"
|
|
'MsgBox("2")
|
|
If Me.조명부하산출방법ComboBox.Text = "계산치" Then
|
|
Dim 조명방식 As String = TOST(e.Row("조명방식"))
|
|
Dim 인공광원 As String = TOST(e.Row("인공광원"))
|
|
Select Case 인공광원.Trim
|
|
Case "형광등"
|
|
e.Row("조명기기효율") = 65
|
|
Case "백열등"
|
|
e.Row("조명기기효율") = 15
|
|
Case "할로겐등"
|
|
e.Row("조명기기효율") = 21
|
|
Case "고압수은등"
|
|
e.Row("조명기기효율") = 52
|
|
Case "메탈할라이드등"
|
|
e.Row("조명기기효율") = 72
|
|
Case "고압나트륨등"
|
|
e.Row("조명기기효율") = 108
|
|
Case Else
|
|
e.Row("조명기기효율") = 0
|
|
End Select
|
|
Try
|
|
If e.Row("실지수").ToString <> "" AndAlso e.Row("실지수").ToString <> "NaN" Then
|
|
Dim 실지수 As Decimal = TOSG(e.Row("실지수"))
|
|
If 조명방식 = "직접" Then '//직접
|
|
e.Row("조명률") = TOSG(IIf(인공광원 = "백열등", TOSG(78 - 32 / (실지수 + 0.47)), TOSG(70 - 38 / (실지수 + 0.35)))) * 0.01
|
|
Else '//간접
|
|
e.Row("조명률") = (52 - 60 / (실지수 + 1.02)) * 0.01
|
|
End If
|
|
Else
|
|
e.Row("조명률") = 0
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
e.Row("조명률") = 0
|
|
End Try
|
|
|
|
End If
|
|
Me.bs.EndEdit()
|
|
Case "보수율", "조명기기효율", "조명률", "요구조도"
|
|
If Me.조명부하산출방법ComboBox.Text = "계산치" Then
|
|
Try
|
|
Dim 보수율 As Decimal = TOSG(e.Row("보수율"))
|
|
Dim 효율 As Decimal = TOSG(e.Row("조명기기효율"))
|
|
Dim 조명률 As Decimal = TOSG(e.Row("조명률"))
|
|
Dim 요구조도 As Decimal = TOSG(e.Row("요구조도"))
|
|
e.Row("조명에너지부하율계산치") = 요구조도 / (조명률 * 보수율 * 효율)
|
|
Catch ex As Exception
|
|
e.Row("조명에너지부하율계산치") = 0
|
|
End Try
|
|
End If
|
|
Me.bs.EndEdit()
|
|
End Select
|
|
|
|
|
|
End Sub
|
|
|
|
Private Sub 조명부하산출방법ComboBox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles 조명부하산출방법ComboBox.KeyDown
|
|
If e.KeyCode = Keys.V And e.Control Then
|
|
|
|
e.Handled = True
|
|
e.SuppressKeyPress = False
|
|
'//클립보드붙여넣기
|
|
Dim CB() As String = My.Computer.Clipboard.GetText.Split(CChar(vbCrLf))
|
|
'MsgBox(CB.GetUpperBound(0))
|
|
If CB.GetUpperBound(0) <> 19 Then
|
|
MsgBox("붙여넣기가 호환되는 데이터가 아닙니다.", MsgBoxStyle.Information, "확인")
|
|
Return
|
|
End If
|
|
|
|
For ii As Integer = 0 To CType(CB(0).Split(CChar(vbTab)), String()).GetUpperBound(0)
|
|
'If Me.bs.Count = 0 OrElse ii > 0 Then Me.bt_Add.PerformClick() '//한줄추가
|
|
|
|
Dim Cnt As Short = 0
|
|
For i As Integer = 0 To CB.GetUpperBound(0)
|
|
Select Case i
|
|
Case 0 '///조명은 신규기록하지않으므로.. 쓰지않게한다.
|
|
'CType(bs.Current, DataRowView)("설명") = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 0 + 2
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
Me.조명부하산출방법ComboBox.SelectedIndex = 0
|
|
Else
|
|
Me.조명부하산출방법ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
'Me.조명부하산출방법ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 1 + 2
|
|
Me.요구조도NTb1.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 2 + 2
|
|
Me.천장고NTB1.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 3 + 2
|
|
Me.작업면높이NTb1.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 4 + 2
|
|
Me.실깊이NTb.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 5 + 2
|
|
Me.실너비NTb.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 6 '//실지수넘어감
|
|
Case 7 + 2
|
|
Case 8 + 2
|
|
Case 9 + 2
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
Me.조명방식ComboBox.SelectedIndex = 0
|
|
Else
|
|
Me.조명방식ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
' Me.조명방식ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 10 + 2
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
Me.인공광원ComboBox.SelectedIndex = 0
|
|
Else
|
|
Me.인공광원ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
'Me.인공광원ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 11 + 2
|
|
Me.보수율NTb.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 12 + 2
|
|
Me.tb_점등시간.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 13 + 2
|
|
' Me.조명기기효율NTb.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 14 + 2
|
|
'Me.조명률NTb.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 15 + 2
|
|
'me.조명에너지부하율계산치NTb.Text= CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 16 + 2
|
|
Me.tb_조명입력치.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End Select
|
|
Next
|
|
If bs.Position < bs.Count Then bs.Position += 1 '//위치이동
|
|
Next
|
|
Me.bs.EndEdit()
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub 조명부하산출방법ComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 조명부하산출방법ComboBox.SelectedIndexChanged
|
|
Validate_Control()
|
|
End Sub
|
|
|
|
Private Sub Validate_Control()
|
|
If Not Init Then Return
|
|
If isCopy Then Return
|
|
'=============================================================2012.07.08 추가
|
|
Try
|
|
If Me.입력존의수NTb.Text = "" Then
|
|
Me.입력존의수NTb.Text = "1"
|
|
End If
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
|
|
'=============================================================2012.07.08 추가
|
|
|
|
' If Me.TabControl2.SelectedIndex = 1 Then '//조명부하의경우 탭컨트롤이 1일때 행한다.
|
|
Try
|
|
If Me.조명부하산출방법ComboBox.Text = "계산치" Then '//계산치
|
|
Me.요구조도NTb1.Enabled = True
|
|
Me.천장고NTB1.Enabled = True
|
|
Me.작업면높이NTb1.Enabled = True
|
|
Me.실깊이NTb.Enabled = True
|
|
Me.실너비NTb.Enabled = True
|
|
Me.실지수NTb1.Enabled = True
|
|
Me.조명방식ComboBox.Enabled = True
|
|
Me.인공광원ComboBox.Enabled = True
|
|
Me.보수율NTb.Enabled = True
|
|
'Me.점등시간NTb.Enabled = False
|
|
Me.조명기기효율NTb.Enabled = True
|
|
Me.tb_조명률.Enabled = True
|
|
Me.tb_조명계산치.Enabled = True
|
|
Me.tb_조명입력치.Enabled = False
|
|
Else
|
|
Me.요구조도NTb1.Enabled = False
|
|
Me.천장고NTB1.Enabled = False
|
|
Me.작업면높이NTb1.Enabled = False
|
|
Me.실깊이NTb.Enabled = False
|
|
Me.실너비NTb.Enabled = False
|
|
Me.실지수NTb1.Enabled = False
|
|
|
|
Me.조명방식ComboBox.SelectedIndex = 0
|
|
Me.인공광원ComboBox.SelectedIndex = 0
|
|
Me.조명방식ComboBox.Enabled = False
|
|
Me.인공광원ComboBox.Enabled = False
|
|
|
|
Me.보수율NTb.Enabled = False
|
|
'Me.점등시간NTb.Enabled = False
|
|
Me.조명기기효율NTb.Enabled = False
|
|
Me.tb_조명률.Enabled = False
|
|
Me.tb_조명계산치.Enabled = False
|
|
Me.tb_조명입력치.Enabled = True
|
|
'Me.점등시간TextBox.Enabled = True
|
|
End If
|
|
|
|
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
Try
|
|
|
|
If Not Me.cmb_profile.SelectedItem Is Nothing Then
|
|
|
|
Dim 프로파일일일급탕 As String = CType(Me.cmb_profile.SelectedItem, DataRowView)("일일급탕요구량").ToString()
|
|
If 프로파일일일급탕 = "0" Then
|
|
Me.cmb_열생산급탕기기.SelectedIndex = 0
|
|
Me.cmb_열생산급탕기기.Enabled = False
|
|
Else
|
|
Me.cmb_열생산급탕기기.Enabled = True
|
|
End If
|
|
End If
|
|
|
|
|
|
'Select Case Me.cmb_profile.SelectedIndex
|
|
' Case 0, 7, 9, 10, 12
|
|
' Me.cmb_열생산급탕기기.SelectedIndex = 0
|
|
' Me.cmb_열생산급탕기기.Enabled = False
|
|
' Case Else
|
|
' Me.cmb_열생산급탕기기.Enabled = True
|
|
'End Select
|
|
|
|
Catch ex As Exception
|
|
' MsgBox(ex.Message.ToString, MsgBoxStyle.Critical)
|
|
End Try
|
|
|
|
' End If
|
|
Show_점등시간()
|
|
Me.bs.EndEdit()
|
|
End Sub
|
|
|
|
Private Sub 인공광원ComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 인공광원ComboBox.SelectedIndexChanged
|
|
Try
|
|
Me.조명기기효율NTb.Text = CStr(CType(Me.인공광원ComboBox.SelectedItem, DataRowView)("valn1"))
|
|
Me.bs.EndEdit()
|
|
Catch ex As Exception
|
|
Me.조명기기효율NTb.Text = "0.0"
|
|
End Try
|
|
|
|
End Sub
|
|
|
|
Private Sub 조명방식ComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 조명방식ComboBox.SelectedIndexChanged
|
|
Me.bs.EndEdit()
|
|
End Sub
|
|
|
|
Private Sub cmb_profile_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles cmb_profile.KeyDown
|
|
If e.KeyCode = Keys.V And e.Control Then
|
|
isCopy = True
|
|
e.Handled = True
|
|
e.SuppressKeyPress = False
|
|
'//클립보드붙여넣기
|
|
Dim CB() As String = My.Computer.Clipboard.GetText.Split(CChar(vbCrLf))
|
|
If CB.GetUpperBound(0) <> 35 Then
|
|
MsgBox("정상적인 데이터가 아닙니다")
|
|
Return
|
|
End If
|
|
For ii As Integer = 0 To CType(CB(0).Split(CChar(vbTab)), String()).GetUpperBound(0)
|
|
If Me.bs.Count = 0 OrElse ii > 0 Then Me.bt_Add.PerformClick() '//한줄추가
|
|
|
|
Dim Cnt As Short = 0
|
|
For i As Integer = 0 To CB.GetUpperBound(0)
|
|
Select Case i
|
|
Case 0
|
|
CType(bs.Current, DataRowView)("설명") = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 0 + 3 '//사용프로필 앞에 두개를 숫자4자리로변환
|
|
Me.cmb_profile.Text = CStr(IIf(CB(i).Split(CChar(vbTab))(ii).Trim = "", "0", CB(i).Split(CChar(vbTab))(ii).Trim))
|
|
Case 1 + 3 '//공란
|
|
Case 2 + 3 '//면적
|
|
Me.면적NTb.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 3 + 3
|
|
Me.천장고NTb.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 4 + 3
|
|
'Me.순실체적NTb.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 5 + 3
|
|
'If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then Me.열저장능력ComboBox.SelectedIndex = -1
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
Me.열저장능력ComboBox.SelectedIndex = 0
|
|
Else
|
|
Me.열저장능력ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
|
|
Case 6 + 3
|
|
' If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then Me.열교가산치ComboBox.SelectedIndex = -1
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
Me.열교가산치ComboBox.SelectedIndex = 0
|
|
Else
|
|
Me.열교가산치ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
'Me.열교가산치ComboBox.Text = CStr(IIf( CB(i).Split(CChar(vbTab))(ii).Trim = "", "0", CB(i).Split(CChar(vbTab))(ii).Trim))
|
|
Case 7 + 3
|
|
Me.침기율NTb.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 8 + 3
|
|
'If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then Me.cmb_냉난방방식.SelectedIndex = -1
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
Me.cmb_냉난방방식.SelectedIndex = 0
|
|
Else
|
|
Me.cmb_냉난방방식.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
'Me.cmb_냉난방방식.Text = CStr(IIf( CB(i).Split(CChar(vbTab))(ii).Trim = "", "0", CB(i).Split(CChar(vbTab))(ii).Trim))
|
|
Case 9 + 3
|
|
'If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then Me.냉난방공조ComboBox.SelectedIndex = -1
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
Me.냉난방공조ComboBox.SelectedIndex = 0
|
|
Else
|
|
Me.냉난방공조ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
'Me.냉난방공조ComboBox.Text = CStr(IIf( CB(i).Split(CChar(vbTab))(ii).Trim = "", "0", CB(i).Split(CChar(vbTab))(ii).Trim))
|
|
Case 10 + 3
|
|
' If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then Me.외기부하처리여부ComboBox.SelectedIndex = -1
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
Me.외기부하처리여부ComboBox.SelectedIndex = 0
|
|
Else
|
|
Me.외기부하처리여부ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
'Me.외기부하처리여부ComboBox.Text = CStr(IIf( CB(i).Split(CChar(vbTab))(ii).Trim = "", "0", CB(i).Split(CChar(vbTab))(ii).Trim))
|
|
Case 11 + 3 '//지역사용안함
|
|
Case 12 + 3 '//야간운전방식
|
|
'If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then Me.야간운전방식ComboBox.SelectedIndex = -1
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
Me.야간운전방식ComboBox.SelectedIndex = 0
|
|
Else
|
|
Me.야간운전방식ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
'Me.야간운전방식ComboBox.Text = CStr(IIf( CB(i).Split(CChar(vbTab))(ii).Trim = "", "0", CB(i).Split(CChar(vbTab))(ii).Trim))
|
|
Case 13 + 3 '//주말운전방식
|
|
' If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then Me.주말운전방식ComboBox.SelectedIndex = -1
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
Me.주말운전방식ComboBox.SelectedIndex = 0
|
|
Else
|
|
Me.주말운전방식ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
'Me.주말운전방식ComboBox.Text = CStr(IIf( CB(i).Split(CChar(vbTab))(ii).Trim = "", "0", CB(i).Split(CChar(vbTab))(ii).Trim))
|
|
Case 16 + 3 '//일급탕요구량
|
|
'Me.급탕요구량NTb.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 17 + 3
|
|
Case 18 + 3
|
|
Case 19 + 3 '//난방공급시스템-1
|
|
' Me.TabControl10.SelectedIndex = 0
|
|
' If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then Me.냉난방열공급시스템ComboBox.SelectedIndex = -1
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
Me.냉난방열공급시스템ComboBox.SelectedIndex = 0
|
|
Else
|
|
Me.냉난방열공급시스템ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
|
|
|
|
Case 20 + 3 '//
|
|
Me.냉난방열공급시스템수NTb.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 21 + 3
|
|
' If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then Me.냉난방공조처리시스템ComboBox.SelectedIndex = -1
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
Me.냉난방공조처리시스템ComboBox.SelectedIndex = 0
|
|
Else
|
|
Me.냉난방공조처리시스템ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
'Me.냉난방공조처리시스템ComboBox.Text = CStr(IIf( CB(i).Split(CChar(vbTab))(ii).Trim = "", "0", CB(i).Split(CChar(vbTab))(ii).Trim))
|
|
Case 24 + 3 '//열생산지정
|
|
' Me.TabControl10.SelectedIndex = 1
|
|
Me.cmb_열생산지정1.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 25 + 3
|
|
Me.cmb_열생산급탕기기.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 26 + 3
|
|
Me.cmb_열생산지정3.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 27 + 3
|
|
Me.cmb_공조가습생산.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
Case 30 + 3
|
|
'Me.TabControl10.SelectedIndex = 2
|
|
'If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then Me.냉난방공조분배시스템ComboBox.SelectedIndex = -1
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
'Me.냉난방공조분배시스템ComboBox.SelectedIndex = 0
|
|
Else
|
|
'Me.냉난방공조분배시스템ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
' Me.냉난방공조분배시스템ComboBox.Text = CStr(IIf( CB(i).Split(CChar(vbTab))(ii).Trim = "", "0", CB(i).Split(CChar(vbTab))(ii).Trim))
|
|
Case 31 + 3
|
|
'If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then Me.냉난방분배시스템ComboBox.SelectedIndex = -1
|
|
If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
|
|
'Me.냉난방분배시스템ComboBox.SelectedIndex = 0
|
|
Else
|
|
'Me.냉난방분배시스템ComboBox.Text = CB(i).Split(CChar(vbTab))(ii).Trim
|
|
End If
|
|
'Me.냉난방분배시스템ComboBox.Text = CStr(IIf(CB(i).Trim = "", "0", CB(i).Trim))
|
|
End Select
|
|
Next
|
|
Next
|
|
|
|
Me.bs.EndEdit()
|
|
isCopy = False
|
|
Me.Validate_Control()
|
|
' AddNewDataRow_Zone_Changed(Nothing, Nothing)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Show_점등시간()
|
|
Try
|
|
If cmb_profile.SelectedIndex > 0 Then '//뭔가선택되면
|
|
Dim Drv As DataRowView = CType(Me.bs.Current, DataRowView)
|
|
|
|
Dim 프로필코드 As String = cmb_profile.SelectedValue.ToString() ' 160326 - 최초 존 생성시 값이 설정되기전에 코드가 작동함(오류) Drv("프로필").ToString
|
|
Dim DRProf As DS.tbl_profileRow = CType(DSET1.tbl_profile.Select("code='" & 프로필코드 & "'")(0), DS.tbl_profileRow)
|
|
Me.tb_점등시간.Text = DRProf.일일사용시간
|
|
'MsgBox("선택프로필코드=" & Drv("프로필").ToString, MsgBoxStyle.Information, DRProf.일일사용시간)
|
|
Else
|
|
Me.tb_점등시간.Text = "없음"
|
|
End If
|
|
Catch ex As Exception
|
|
Me.tb_점등시간.Text = ex.Message.ToString
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub cmb_profile_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles cmb_profile.MouseUp
|
|
If Me.cmb_profile.SelectedIndex < 0 Then Return
|
|
If e.Button = Windows.Forms.MouseButtons.Right Then
|
|
'//냉난방공조처리시스템
|
|
Me.bs.Filter = "프로필='" & cmb_profile.SelectedValue.ToString & "'"
|
|
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub cmb_profile_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_profile.SelectedIndexChanged
|
|
Me.Validate_Control()
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub bt_Del_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles bt_Del.MouseDown
|
|
If e.Button = Windows.Forms.MouseButtons.Right Then
|
|
If MsgBox("전체삭제를 하시겠습니까?", MsgBoxStyle.Information Or MsgBoxStyle.OkCancel, "확인") = MsgBoxResult.Ok Then
|
|
'DSET1.tbl_zone.Clear()
|
|
Dim dR() As DataRow = DSET1.tbl_zone.Select(Me.bs.Filter, "")
|
|
For i As Integer = dR.GetUpperBound(0) To 0 Step -1
|
|
dR(i).Delete()
|
|
Next
|
|
DSET1.tbl_zone.AcceptChanges()
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Show_면적존수합()
|
|
'//현재 존의 면적의 합(?)
|
|
Dim 면적합 As Decimal = 0
|
|
Dim 존수합 As Integer = 0
|
|
Dim 면적 As Decimal = 0
|
|
|
|
For Each dr존 As DS.tbl_zoneRow In DSET1.tbl_zone.Select("code <> '0'")
|
|
Dim 존수 As Integer = 0
|
|
If IsNumeric(dr존.입력존의수) Then
|
|
존수 = CInt(dr존.입력존의수)
|
|
Else
|
|
존수 = 1
|
|
End If
|
|
|
|
존수합 += 존수
|
|
If IsNumeric(dr존.면적) Then
|
|
면적 = dr존.면적 * 존수
|
|
Else
|
|
면적 = 0
|
|
End If
|
|
|
|
면적합 = 면적합 + 면적
|
|
|
|
Next
|
|
Me.lb_면적합.Text = Format(면적합, "##,###,###.#####").ToString
|
|
Me.lb_전체존수.Text = Format(존수합, "#,###,###").ToString
|
|
End Sub
|
|
Private Sub bs_CurrentChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bs.CurrentChanged
|
|
|
|
'//이존이 어떠한 면들한테 쓰엿는지 그거죠?'/종류가 몇가지요? 내벽 외벽 같은거
|
|
'//입력면은 존분류값이 존이죠? ? 외벽, 외부창, 내벽, 내부창, 간벽 5가지
|
|
|
|
If Not Init Then Return
|
|
Dim Drv As DataRowView = CType(bs.Current, DataRowView)
|
|
If Drv Is Nothing Then Return
|
|
|
|
|
|
Dim Zonecode As String = Drv("code")
|
|
If Zonecode = "0" Then Return
|
|
|
|
Show_점등시간()
|
|
|
|
Dim cnt1, cnt2, cnt3, cnt4, cnt5 As Integer
|
|
cnt1 = 0 : cnt2 = 0 : cnt3 = 0 : cnt4 = 0 : cnt5 = 0
|
|
|
|
|
|
Dim DR() As DataRow = DSET1.tbl_myoun.Select("code <> '0' and 존분류='" & Drv("code").ToString & "' and 건축부위방식='외벽'")
|
|
If DR.GetUpperBound(0) <> -1 Then cnt1 = (DR.GetUpperBound(0) + 1)
|
|
|
|
DR = DSET1.tbl_myoun.Select("code <> '0' and 존분류='" & Drv("code").ToString & "' and 건축부위방식='외부창'")
|
|
If DR.GetUpperBound(0) <> -1 Then cnt2 = (DR.GetUpperBound(0) + 1)
|
|
|
|
DR = DSET1.tbl_myoun.Select("code <> '0' and 존분류='" & Drv("code").ToString & "' and 건축부위방식='내벽'")
|
|
If DR.GetUpperBound(0) <> -1 Then cnt3 = (DR.GetUpperBound(0) + 1)
|
|
|
|
DR = DSET1.tbl_myoun.Select("code <> '0' and 존분류='" & Drv("code").ToString & "' and 건축부위방식='내부창'")
|
|
If DR.GetUpperBound(0) <> -1 Then cnt4 = (DR.GetUpperBound(0) + 1)
|
|
|
|
DR = DSET1.tbl_myoun.Select("code <> '0' and 존분류='" & Drv("code").ToString & "' and 건축부위방식='간벽'")
|
|
If DR.GetUpperBound(0) <> -1 Then cnt5 = (DR.GetUpperBound(0) + 1)
|
|
|
|
'//현재 존의 면적의 합(?)
|
|
Show_면적존수합()
|
|
|
|
'//각각순서대로 변수에 해당값이 들어갓어요
|
|
'//화면에 표시할 컨트롤 만드시다음에 컨트롤.text = cnt1 식으로 연결만 해주시면됩니다.
|
|
Me.lb_외벽.Text = cnt1.ToString
|
|
If cnt1 > 0 Then
|
|
Me.ToolStripLabel2.ForeColor = Color.Purple
|
|
Me.lb_외벽.ForeColor = Color.Purple
|
|
Else
|
|
Me.ToolStripLabel2.ForeColor = Color.LightGray
|
|
Me.lb_외벽.ForeColor = Color.LightGray
|
|
End If
|
|
|
|
Me.lb_내벽.Text = cnt3.ToString
|
|
If cnt3 > 0 Then
|
|
Me.ToolStripLabel4.ForeColor = Color.Purple
|
|
Me.lb_내벽.ForeColor = Color.Purple
|
|
Else
|
|
Me.ToolStripLabel4.ForeColor = Color.LightGray
|
|
Me.lb_내벽.ForeColor = Color.LightGray
|
|
End If
|
|
|
|
Me.lb_외부창.Text = cnt2.ToString
|
|
If cnt2 > 0 Then
|
|
Me.ToolStripLabel6.ForeColor = Color.Purple
|
|
Me.lb_외부창.ForeColor = Color.Purple
|
|
Else
|
|
Me.ToolStripLabel6.ForeColor = Color.LightGray
|
|
Me.lb_외부창.ForeColor = Color.LightGray
|
|
End If
|
|
|
|
Me.lb_내부창.Text = cnt4.ToString
|
|
If cnt4 > 0 Then
|
|
Me.ToolStripLabel8.ForeColor = Color.Purple
|
|
Me.lb_내부창.ForeColor = Color.Purple
|
|
Else
|
|
Me.ToolStripLabel8.ForeColor = Color.LightGray
|
|
Me.lb_내부창.ForeColor = Color.LightGray
|
|
End If
|
|
|
|
Me.lb_간벽.Text = cnt5.ToString
|
|
If cnt5 > 0 Then
|
|
Me.ToolStripLabel10.ForeColor = Color.Purple
|
|
Me.lb_간벽.ForeColor = Color.Purple
|
|
Else
|
|
Me.ToolStripLabel10.ForeColor = Color.LightGray
|
|
Me.lb_간벽.ForeColor = Color.LightGray
|
|
End If
|
|
|
|
Me.Validate_Control()
|
|
|
|
Me.bs.EndEdit()
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub 냉난방공조처리시스템ComboBox_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 냉난방공조처리시스템ComboBox.MouseUp
|
|
If e.Button = Windows.Forms.MouseButtons.Right Then
|
|
'//냉난방공조처리시스템
|
|
Me.bs.Filter = "냉난방공조처리시스템='" & 냉난방공조처리시스템ComboBox.SelectedValue.ToString & "'"
|
|
|
|
|
|
End If
|
|
End Sub
|
|
|
|
|
|
Private Sub 냉난방공조ComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 냉난방공조ComboBox.SelectedIndexChanged
|
|
ZONE_Control()
|
|
End Sub
|
|
|
|
Private Sub ZONE_Control() '//건기연 추가(2010.04.07)
|
|
If Me.Init = False Then Return
|
|
Try
|
|
If Me.냉난방공조ComboBox.SelectedIndex = 4 Then
|
|
외기부하처리여부ComboBox.Enabled = True
|
|
냉난방공조처리시스템ComboBox.Enabled = True
|
|
Else
|
|
외기부하처리여부ComboBox.Enabled = False
|
|
If Me.냉난방공조ComboBox.SelectedIndex = 0 Then
|
|
냉난방공조처리시스템ComboBox.Enabled = False
|
|
냉난방공조처리시스템ComboBox.SelectedIndex = 0
|
|
Else
|
|
냉난방공조처리시스템ComboBox.Enabled = True
|
|
End If
|
|
End If
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
Try
|
|
Select Case Me.냉난방공조ComboBox.SelectedIndex
|
|
Case 0, 4
|
|
If Me.냉난방공조ComboBox.SelectedIndex = 4 AndAlso Me.외기부하처리여부ComboBox.Enabled AndAlso Me.외기부하처리여부ComboBox.Text = "예" Then
|
|
Me.cmb_공조난방생산.Enabled = True
|
|
Me.cmb_공조가습생산.Enabled = True
|
|
Me.cmb_공조냉방생산.Enabled = True
|
|
'Me.cmb_공조난방생산.BackColor = Nothing
|
|
'Me.cmb_공조냉방생산.BackColor = Nothing
|
|
'Me.cmb_공조가습생산.BackColor = Nothing
|
|
'Me.cmb_공조난방생산.ForeColor = Nothing
|
|
'Me.cmb_공조냉방생산.ForeColor = Nothing
|
|
'Me.cmb_공조가습생산.ForeColor = Nothing
|
|
'Me.cmb_공조난방생산.Font = New Font(Me.cmb_공조난방생산.Font, FontStyle.Regular)
|
|
'Me.cmb_공조냉방생산.Font = New Font(Me.cmb_공조난방생산.Font, FontStyle.Regular)
|
|
'Me.cmb_공조가습생산.Font = New Font(Me.cmb_공조난방생산.Font, FontStyle.Regular)
|
|
|
|
Else
|
|
Me.cmb_공조난방생산.Enabled = False
|
|
Me.cmb_공조가습생산.Enabled = False
|
|
Me.cmb_공조냉방생산.Enabled = False
|
|
'Me.cmb_공조난방생산.BackColor = Color.LightGray
|
|
'Me.cmb_공조냉방생산.BackColor = Color.LightGray
|
|
'Me.cmb_공조가습생산.BackColor = Color.LightGray
|
|
'If Me.cmb_공조난방생산.SelectedIndex <> 0 Then
|
|
' Me.cmb_공조난방생산.ForeColor = Color.Red
|
|
' Me.cmb_공조난방생산.Font = New Font(Me.cmb_공조난방생산.Font, FontStyle.Strikeout)
|
|
'End If
|
|
'If Me.cmb_공조가습생산.SelectedIndex <> 0 Then
|
|
' Me.cmb_공조가습생산.ForeColor = Color.Red
|
|
' Me.cmb_공조가습생산.Font = New Font(Me.cmb_공조난방생산.Font, FontStyle.Strikeout)
|
|
'End If
|
|
'If Me.cmb_공조냉방생산.SelectedIndex <> 0 Then
|
|
' Me.cmb_공조냉방생산.ForeColor = Color.Red
|
|
' Me.cmb_공조냉방생산.Font = New Font(Me.cmb_공조난방생산.Font, FontStyle.Strikeout)
|
|
'End If
|
|
|
|
End If
|
|
Me.cmb_냉난방방식.ForeColor = Nothing
|
|
'Me.cmb_냉난방방식.Font = New Font(Me.cmb_냉난방방식.Font, FontStyle.Regular)
|
|
Me.ErrProvider.SetError(Me.cmb_냉난방방식, "")
|
|
Case 1
|
|
If Me.외기부하처리여부ComboBox.Enabled AndAlso Me.외기부하처리여부ComboBox.Text = "예" Then
|
|
Me.cmb_공조난방생산.Enabled = True
|
|
Me.cmb_공조가습생산.Enabled = True
|
|
Else
|
|
Me.cmb_공조난방생산.Enabled = False
|
|
Me.cmb_공조가습생산.Enabled = False
|
|
End If
|
|
Me.cmb_공조냉방생산.Enabled = True
|
|
If Me.cmb_냉난방방식.SelectedIndex = 0 OrElse Me.cmb_냉난방방식.SelectedIndex = 2 Then
|
|
Me.cmb_냉난방방식.ForeColor = Nothing
|
|
'Me.cmb_냉난방방식.Font = New Font(Me.cmb_냉난방방식.Font, FontStyle.Regular)
|
|
Me.ErrProvider.SetError(Me.cmb_냉난방방식, "")
|
|
Else
|
|
Me.cmb_냉난방방식.ForeColor = Color.Red
|
|
'Me.cmb_냉난방방식.Font = New Font(Me.cmb_냉난방방식.Font, FontStyle.Strikeout)
|
|
Me.ErrProvider.SetError(Me.cmb_냉난방방식, "이건 안된다구요")
|
|
End If
|
|
Case 2
|
|
If Me.외기부하처리여부ComboBox.Enabled AndAlso Me.외기부하처리여부ComboBox.Text = "예" Then
|
|
Me.cmb_공조냉방생산.Enabled = True
|
|
Else
|
|
Me.cmb_공조냉방생산.Enabled = False
|
|
End If
|
|
Me.cmb_공조난방생산.Enabled = True
|
|
Me.cmb_공조가습생산.Enabled = True
|
|
If Me.cmb_냉난방방식.SelectedIndex = 0 OrElse Me.cmb_냉난방방식.SelectedIndex = 1 Then
|
|
Me.cmb_냉난방방식.ForeColor = Nothing
|
|
'Me.cmb_냉난방방식.Font = New Font(Me.cmb_냉난방방식.Font, FontStyle.Regular)
|
|
Me.ErrProvider.SetError(Me.cmb_냉난방방식, "")
|
|
Else
|
|
Me.cmb_냉난방방식.ForeColor = Color.Red
|
|
'Me.cmb_냉난방방식.Font = New Font(Me.cmb_냉난방방식.Font, FontStyle.Strikeout)
|
|
Me.ErrProvider.SetError(Me.cmb_냉난방방식, "이건 안된다구요")
|
|
End If
|
|
Case 3
|
|
Me.cmb_공조난방생산.Enabled = True
|
|
Me.cmb_공조가습생산.Enabled = True
|
|
Me.cmb_공조냉방생산.Enabled = True
|
|
If Me.cmb_냉난방방식.SelectedIndex = 0 Then
|
|
Me.cmb_냉난방방식.ForeColor = Nothing
|
|
'Me.cmb_냉난방방식.Font = New Font(Me.cmb_냉난방방식.Font, FontStyle.Regular)
|
|
Me.ErrProvider.SetError(Me.cmb_냉난방방식, "")
|
|
Else
|
|
Me.cmb_냉난방방식.ForeColor = Color.Red
|
|
'Me.cmb_냉난방방식.Font = New Font(Me.cmb_냉난방방식.Font, FontStyle.Strikeout)
|
|
Me.ErrProvider.SetError(Me.cmb_냉난방방식, "이건 안된다구요")
|
|
End If
|
|
|
|
Case Else
|
|
|
|
End Select
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
Try
|
|
Select Case Me.cmb_냉난방방식.SelectedIndex
|
|
Case 0
|
|
Me.냉난방공조ComboBox.ForeColor = Nothing
|
|
Me.ErrProvider.SetError(Me.냉난방공조ComboBox, "")
|
|
Me.cmb_열생산지정1.Enabled = False
|
|
Me.cmb_열생산지정3.Enabled = False
|
|
Case 1
|
|
Me.cmb_열생산지정1.Enabled = False
|
|
Me.cmb_열생산지정3.Enabled = True
|
|
If Me.냉난방공조ComboBox.SelectedIndex = 0 OrElse Me.냉난방공조ComboBox.SelectedIndex = 2 OrElse Me.냉난방공조ComboBox.SelectedIndex = 4 Then
|
|
Me.냉난방공조ComboBox.ForeColor = Nothing
|
|
Me.ErrProvider.SetError(Me.냉난방공조ComboBox, "")
|
|
Else
|
|
Me.냉난방공조ComboBox.ForeColor = Color.Red
|
|
Me.ErrProvider.SetError(Me.냉난방공조ComboBox, "이건 안된다구요")
|
|
End If
|
|
Case 2
|
|
Me.cmb_열생산지정1.Enabled = True
|
|
Me.cmb_열생산지정3.Enabled = False
|
|
If Me.냉난방공조ComboBox.SelectedIndex = 0 OrElse Me.냉난방공조ComboBox.SelectedIndex = 1 OrElse Me.냉난방공조ComboBox.SelectedIndex = 4 Then
|
|
Me.냉난방공조ComboBox.ForeColor = Nothing
|
|
Me.ErrProvider.SetError(Me.냉난방공조ComboBox, "")
|
|
Else
|
|
Me.냉난방공조ComboBox.ForeColor = Color.Red
|
|
Me.ErrProvider.SetError(Me.냉난방공조ComboBox, "이건 안된다구요")
|
|
End If
|
|
Case 3
|
|
Me.cmb_열생산지정1.Enabled = True
|
|
Me.cmb_열생산지정3.Enabled = True
|
|
If Me.냉난방공조ComboBox.SelectedIndex = 0 OrElse Me.냉난방공조ComboBox.SelectedIndex = 4 Then
|
|
Me.냉난방공조ComboBox.ForeColor = Nothing
|
|
Me.ErrProvider.SetError(Me.냉난방공조ComboBox, "")
|
|
Else
|
|
Me.냉난방공조ComboBox.ForeColor = Color.Red
|
|
Me.ErrProvider.SetError(Me.냉난방공조ComboBox, "이건 안된다구요")
|
|
End If
|
|
|
|
Case Else
|
|
|
|
End Select
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
Try
|
|
If Me.cmb_냉난방방식.SelectedIndex = 0 Then
|
|
Me.냉난방열공급시스템ComboBox.Enabled = False
|
|
Me.냉난방열공급시스템수NTb.Enabled = False
|
|
'냉난방분배시스템ComboBox.SelectedIndex = 0
|
|
'Me.냉난방열공급시스템수NTb.Text = "0" '// 2010.11.29 수정
|
|
Else
|
|
Me.냉난방열공급시스템ComboBox.Enabled = True
|
|
Me.냉난방열공급시스템수NTb.Enabled = True
|
|
|
|
End If
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
bs.EndEdit()
|
|
End Sub
|
|
|
|
Private Sub cmb_냉난방방식_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_냉난방방식.SelectedIndexChanged
|
|
ZONE_Control()
|
|
End Sub
|
|
|
|
Private Sub 면적NTb_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles 면적NTb.KeyUp
|
|
Me.Validate()
|
|
Me.bs.EndEdit()
|
|
Show_면적존수합()
|
|
End Sub
|
|
|
|
Private Sub Show_순실체적()
|
|
'//160326 개선(오토포커스 제거)
|
|
If IsNumeric(면적NTb.Text) = False Then
|
|
면적NTb.BackColor = Color.HotPink
|
|
Else
|
|
면적NTb.BackColor = Color.White
|
|
End If
|
|
|
|
If IsNumeric(천장고NTb.Text) = False Then
|
|
천장고NTb.BackColor = Color.HotPink
|
|
Else
|
|
천장고NTb.BackColor = Color.White
|
|
End If
|
|
|
|
|
|
If Not IsNumeric(면적NTb.Text) OrElse Not IsNumeric(천장고NTb.Text) Then
|
|
If 순실체적NTb.Text <> "--" Then 순실체적NTb.Text = "--"
|
|
Else
|
|
Dim newval As String = TOST(TOSG(면적NTb.Text) * TOSG(천장고NTb.Text))
|
|
If 순실체적NTb.Text <> newval Then 순실체적NTb.Text = newval
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub 면적NTb_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles 면적NTb.TextChanged
|
|
Show_순실체적()
|
|
End Sub
|
|
|
|
Private Sub 천장고NTb_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles 천장고NTb.TextChanged
|
|
Show_순실체적()
|
|
End Sub
|
|
|
|
Private Sub 순실체적NTb_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles 순실체적NTb.MouseHover
|
|
Show_순실체적()
|
|
End Sub
|
|
|
|
Private Sub dv_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles dv.KeyDown
|
|
'//여기보시면 alt+d 누르면 한줄을 경고없이(falsE)삭제하도록 햇어요.. 사실원래 밋alt +d 인데.. ㅎㅎ 잘못해서 ctrl 됫다는
|
|
If Prj.UserAuthType = "ADMIN" OrElse Prj.UserAuthType = "BOTH" OrElse Prj.UserAuthType = "BOTH2" OrElse Prj.UserAuthType = "BOTH1" OrElse Prj.UserAuthType = "BOTH0" Then '//2011.03.08 추가
|
|
Select Case e.KeyCode
|
|
Case Keys.D
|
|
If e.Alt Then
|
|
Del_ZoneMyoun(False)
|
|
'Dbbase.DelCrow(Me.bs, False)
|
|
End If
|
|
|
|
End Select
|
|
|
|
|
|
End If
|
|
End Sub
|
|
|
|
'''면의새로운코드값을계산할때사용한다.
|
|
Private Function GetMyounMaxCode(ByVal dt As DataTable) As String
|
|
If dt.Rows.Count < 1 Then
|
|
Return "00001"
|
|
Else
|
|
Dim Dr As DataRow = dt.Select("", "CODE desc")(0)
|
|
Dim CODE As String = Dr("CODE").ToString()
|
|
If IsNumeric(CODE) Then
|
|
Return (CInt(CODE) + 1).ToString("00000")
|
|
Else
|
|
MsgBox("비숫자형 코드값이 tbl_myoun에 존재합니다", MsgBoxStyle.Critical, "확인")
|
|
Return "00001"
|
|
End If
|
|
End If
|
|
|
|
End Function
|
|
|
|
Private Sub dv_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles dv.MouseUp
|
|
If Prj.UserAuthType = "ADMIN" OrElse Prj.UserAuthType = "BOTH" OrElse Prj.UserAuthType = "BOTH2" OrElse Prj.UserAuthType = "BOTH1" Then '//2011.03.08 추가
|
|
If e.Button = Windows.Forms.MouseButtons.Right Then
|
|
Dim Frm_FilterA As New Frm_Filter
|
|
Frm_FilterA.ColumTitle = getColCaption(Me.Dt)
|
|
Frm_FilterA.ColumList = getColName(Me.Dt)
|
|
Frm_FilterA.Colorlist = "프로필,냉난방열공급시스템,냉난방공조처리시스템,열생산난방생산기기,열생산급탕생산기기,열생산냉방생산기기," & _
|
|
"공조가습생산기기,공조냉방생산기기,공조난방생산기기"
|
|
Frm_FilterA.Numfield = "" '//20100618 Color 리스트처럼 , 구분해서 필드들을 모두 넣으세요.(=, >= 등을 사용하기 위해서는 해당 항목을 추가 요망)
|
|
Frm_FilterA.Default_Filter = "code <> '0'"
|
|
If Frm_FilterA.ShowDialog <> Windows.Forms.DialogResult.OK Then Return '//창떳을떄 확인아ㅣ고 취소눌르면 다음을 수행하지않는다는거에요.
|
|
Dim Filter As String = Frm_FilterA.tb_filter.Text '//값은 아까 그 텍박에 잇구요.
|
|
Try
|
|
Me.bs.Filter = Filter
|
|
|
|
'//바꾸기값이 있으면 변경 20100618
|
|
If Frm_FilterA.cmb_fieldc.SelectedIndex >= 0 AndAlso Frm_FilterA.cmb_fieldc.Text.ToLower <> "code" AndAlso _
|
|
Frm_FilterA.tb_valuec.Text <> "" Then
|
|
Dim Drow() As DataRow = Me.Dt.Select(Filter)
|
|
For Each Dr As DataRow In Drow
|
|
Dr(Frm_FilterA.cmb_fieldc.Text) = Frm_FilterA.tb_valuec.Text
|
|
Next
|
|
MsgBox("바꾸기 완료", MsgBoxStyle.Information, "확인")
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
Me.bs.Filter = ""
|
|
End Try
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
|
|
'Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
|
' CType(Me.bs.Current, DataRowView)("공조난방생산기기") = DBNull.Value
|
|
' CType(Me.bs.Current, DataRowView)("공조냉방생산기기") = DBNull.Value
|
|
' If MsgBox("sdf", MsgBoxStyle.OkCancel) = MsgBoxResult.Ok Then
|
|
' Me.bs.EndEdit()
|
|
' Me.bsmain.EndEdit()
|
|
' End If
|
|
'End Sub
|
|
|
|
Private Sub 외기부하처리여부ComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 외기부하처리여부ComboBox.SelectedIndexChanged
|
|
ZONE_Control()
|
|
End Sub
|
|
Private Sub Del_ZoneMyoun(ByVal prompt As Boolean)
|
|
If prompt Then
|
|
If MsgBox("선택된 줄을 삭제하시겠습니까?", MsgBoxStyle.OkCancel Or MsgBoxStyle.Information, "삭제확인") <> MsgBoxResult.Ok Then Return
|
|
End If
|
|
Dim Drv As DataRowView = CType(bs.Current, DataRowView)
|
|
If Drv Is Nothing Then Return
|
|
Dim DR() As DataRow = DSET1.tbl_myoun.Select("code <> '0' and 존분류='" & Drv("code").ToString & "'")
|
|
If DR.GetUpperBound(0) <> -1 Then
|
|
For i As Integer = DR.GetUpperBound(0) To 0 Step -1
|
|
DR(i).Delete()
|
|
Next
|
|
End If
|
|
Me.bs.RemoveCurrent()
|
|
End Sub
|
|
|
|
Private Sub bt_copy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_copy.Click
|
|
If Me.bs.Current Is Nothing Then Return
|
|
Me.SrcDrv = Me.bs.Current
|
|
Me.bt_add.PerformClick() '//신규추가
|
|
Dim NewDrv As DataRowView = Me.bs.Current
|
|
|
|
For Each C As DataColumn In Me.DT.Columns
|
|
If C.ColumnName.ToUpper = "CODE" Then
|
|
ElseIf C.ColumnName.ToUpper = "그룹설명" Then
|
|
ElseIf C.ColumnName.ToUpper = "설명" Then
|
|
NewDrv(C.ColumnName) = SrcDrv(C.ColumnName) & "#1"
|
|
Else
|
|
NewDrv(C.ColumnName) = SrcDrv(C.ColumnName)
|
|
End If
|
|
Next
|
|
|
|
'//이입력존을 사용하는 입력면을 복제해서 연결해준다.
|
|
Dim 사용입력면() As DS.tbl_myounRow = DSET1.tbl_myoun.Select("존분류='" + SrcDrv("code").ToString + "'")
|
|
For Each 기존입력면 As DS.tbl_myounRow In 사용입력면
|
|
Dim 신규입력면 As DS.tbl_myounRow = DSET1.tbl_myoun.Newtbl_myounRow
|
|
For Each 기존컬럼 As DataColumn In DSET1.tbl_myoun.Columns
|
|
If 기존컬럼.ColumnName.ToUpper = "CODE" Then
|
|
신규입력면.code = GetMyounMaxCode(DSET1.tbl_myoun)
|
|
Else
|
|
신규입력면(기존컬럼.ColumnName) = 기존입력면(기존컬럼.ColumnName)
|
|
End If
|
|
Next
|
|
신규입력면.존분류 = NewDrv("code").ToString
|
|
DSET1.tbl_myoun.Rows.Add(신규입력면)
|
|
DSET1.tbl_myoun.AcceptChanges()
|
|
Next
|
|
|
|
Me.bs.EndEdit()
|
|
MdiMain.RefreshMenuList(TreeTag)
|
|
End Sub
|
|
|
|
|
|
Private Sub dv_CellContentClick(sender As System.Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dv.CellContentClick
|
|
|
|
End Sub
|
|
|
|
Private Sub 입력존의수NTb_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles 입력존의수NTb.KeyUp
|
|
Me.Validate()
|
|
Me.bs.EndEdit()
|
|
Show_면적존수합()
|
|
End Sub
|
|
|
|
Private Sub 입력존의수NTb_TextChanged(sender As System.Object, e As System.EventArgs) Handles 입력존의수NTb.TextChanged
|
|
|
|
End Sub
|
|
|
|
Private Sub ShowHistory()
|
|
Dim drv As DataRowView = Me.bs.Current
|
|
Dim f As New Frm_History("tbl_zone", drv("code").ToString)
|
|
If f.ShowDialog = DialogResult.OK Then
|
|
drv(f.colname) = f.val
|
|
Me.Validate()
|
|
Me.bs.EndEdit()
|
|
My.Application.DoEvents()
|
|
MsgBox("값이 변경되었습니다", MsgBoxStyle.Information, "확인")
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Frm_Zone_InputLanguageChanging(sender As System.Object, e As System.Windows.Forms.InputLanguageChangingEventArgs) Handles MyBase.InputLanguageChanging
|
|
|
|
End Sub
|
|
|
|
Private Sub dv_DataError(sender As System.Object, e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles dv.DataError
|
|
Dim ermsg As String = String.Format("입력값에 오류가 있습니다" + vbCrLf + vbCrLf + "줄번호:{0},열번호{1}" + vbCrLf + _
|
|
"메세지:{2}", e.RowIndex, e.ColumnIndex, e.Exception.Message)
|
|
|
|
Select Case e.ColumnIndex
|
|
Case 0
|
|
ermsg += vbCrLf + vbCrLf + "숫자만 입력하세요"
|
|
End Select
|
|
MsgBox(ermsg, MsgBoxStyle.Critical, "Error")
|
|
End Sub
|
|
|
|
Private Sub dv_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles dv.KeyUp
|
|
If Prj.UserAuthType = "ADMIN" OrElse Prj.UserAuthType = "BOTH" OrElse Prj.UserAuthType = "BOTH2" OrElse Prj.UserAuthType = "BOTH1" OrElse Prj.UserAuthType = "BOTH0" Then '//2011.03.08 추가
|
|
Select Case e.KeyCode
|
|
|
|
Case Keys.C
|
|
If e.Control Then
|
|
|
|
'//160327
|
|
Dim drv As DataRowView = Me.bs.Current
|
|
If drv Is Nothing Then
|
|
MsgBox("선택된 자료가 없습니다", MsgBoxStyle.Critical, "확인")
|
|
Return
|
|
End If
|
|
|
|
'//선택된 자료를 복제하여 신규테이블에 담고 클립보드에 넣는다
|
|
Dim newdt As New DS.tbl_zoneDataTable
|
|
Dim newdr As DS.tbl_zoneRow = newdt.Newtbl_zoneRow
|
|
For Each C As DataColumn In DSET1.tbl_zone.Columns
|
|
newdr(C.ColumnName) = drv.Row(C.ColumnName)
|
|
Next
|
|
newdr.EndEdit()
|
|
newdt.Addtbl_zoneRow(newdr)
|
|
My.Computer.Clipboard.SetData("srcdt", newdt)
|
|
|
|
'Dim cdt As DS.tbl_zoneDataTable = My.Computer.Clipboard.GetData("aa")
|
|
'If cdt Is Nothing Then
|
|
' MsgBox("클립보드로부터 자료를 확인하지 못했습니다", MsgBoxStyle.Critical, "확인")
|
|
' Return
|
|
'End If
|
|
|
|
|
|
'Me.SrcDrv = Me.bs.Current
|
|
'If Me.SrcDrv Is Nothing Then
|
|
' MsgBox("저장할 ROW가 없습니다", MsgBoxStyle.Information, "확인")
|
|
' Return
|
|
'End If
|
|
'' My.Computer.Clipboard.SetData("ZDATA", Drv)
|
|
End If
|
|
Case Keys.V
|
|
If e.Control Then
|
|
|
|
'//160327 (클립보드용으로 변경)
|
|
If My.Computer.Clipboard.ContainsData("srcdt") Then
|
|
Dim list As DS.tbl_zoneDataTable = My.Computer.Clipboard.GetData("srcdt")
|
|
If list Is Nothing Then
|
|
MsgBox("클립보드로부터 자료를 확인하지 못했습니다", MsgBoxStyle.Critical, "확인")
|
|
Return
|
|
End If
|
|
|
|
For Each dr As DS.tbl_zoneRow In list
|
|
Dim newdr As DS.tbl_zoneRow = DSET1.tbl_zone.Newtbl_zoneRow
|
|
|
|
'//기존정보와 동일한 자료를 생성한다(코드는제외)
|
|
For Each C As DataColumn In DSET1.tbl_zone.Columns
|
|
If C.ReadOnly Then Continue For
|
|
If C.ColumnName.ToUpper = "CODE" Then
|
|
ElseIf C.ColumnName.ToUpper = "설명" Then
|
|
Dim newname As String = dr(C.ColumnName) & "#Copy"
|
|
|
|
For i As Integer = 1 To 999 '//160327복제시 뒷부분을 자동 계산하도록 수정
|
|
Dim newname2 As String = dr(C.ColumnName) & "#" & i.ToString()
|
|
If DSET1.tbl_zone.Select("설명='" + newname2 + "'").Length < 1 Then
|
|
newdr.설명 = newname2
|
|
Exit For
|
|
End If
|
|
Next
|
|
' ElseIf C.ColumnName.ToUpper = "SORTKEY" Then
|
|
'newdr.sortkey = dr(C.ColumnName) 'GetNewSortKey(DSET1.tbl_zone, NewDrv("그룹").ToString())
|
|
ElseIf C.ColumnName = "그룹설명" Then
|
|
|
|
Else
|
|
newdr(C.ColumnName) = dr(C.ColumnName)
|
|
End If
|
|
Next
|
|
|
|
'//이입력존을 사용하는 입력면을 복제해서 연결해준다.
|
|
Dim 사용입력면() As DS.tbl_myounRow = DSET1.tbl_myoun.Select("존분류='" + dr.code + "'")
|
|
For Each 기존입력면 As DS.tbl_myounRow In 사용입력면
|
|
Dim 신규입력면 As DS.tbl_myounRow = DSET1.tbl_myoun.Newtbl_myounRow
|
|
For Each 기존컬럼 As DataColumn In DSET1.tbl_myoun.Columns
|
|
If 기존컬럼.ColumnName.ToUpper = "CODE" Then
|
|
신규입력면.code = GetMyounMaxCode(DSET1.tbl_myoun)
|
|
Else
|
|
신규입력면(기존컬럼.ColumnName) = 기존입력면(기존컬럼.ColumnName)
|
|
End If
|
|
Next
|
|
신규입력면.존분류 = newdr.code ' NewDrv("code").ToString
|
|
신규입력면.EndEdit()
|
|
DSET1.tbl_myoun.Rows.Add(신규입력면)
|
|
Next
|
|
DSET1.tbl_myoun.AcceptChanges()
|
|
newdr.EndEdit()
|
|
DSET1.tbl_zone.Addtbl_zoneRow(newdr)
|
|
Next
|
|
DSET1.tbl_zone.AcceptChanges()
|
|
End If
|
|
|
|
'If SrcDrv Is Nothing Then Return
|
|
'Me.bt_add.PerformClick() '//신규추가
|
|
|
|
''//새로추가함
|
|
'Dim NewDrv As DataRowView = Me.bs.Current
|
|
'If NewDrv("그룹") Is DBNull.Value Then NewDrv("그룹") = ""
|
|
'For Each C As DataColumn In Me.DT.Columns
|
|
' If C.ColumnName.ToUpper = "CODE" Then
|
|
' ElseIf C.ColumnName.ToUpper = "설명" Then
|
|
|
|
' Dim newname As String = SrcDrv(C.ColumnName) & "#Copy"
|
|
|
|
' For i As Integer = 1 To 999 '//160327복제시 뒷부분을 자동 계산하도록 수정
|
|
' Dim newname2 As String = SrcDrv(C.ColumnName) & "#" & i.ToString()
|
|
' If DSET1.tbl_zone.Select("설명='" + newname2 + "'").Length < 1 Then
|
|
' NewDrv(C.ColumnName) = newname2
|
|
' Exit For
|
|
' End If
|
|
' Next
|
|
' ElseIf C.ColumnName.ToUpper = "SORTKEY" Then
|
|
' NewDrv(C.ColumnName) = SrcDrv(C.ColumnName) 'GetNewSortKey(DSET1.tbl_zone, NewDrv("그룹").ToString())
|
|
|
|
' ElseIf C.ColumnName = "그룹설명" Then
|
|
|
|
' Else
|
|
' NewDrv(C.ColumnName) = SrcDrv(C.ColumnName)
|
|
' End If
|
|
'Next
|
|
|
|
''//이입력존을 사용하는 입력면을 복제해서 연결해준다.
|
|
'Dim 사용입력면() As DS.tbl_myounRow = DSET1.tbl_myoun.Select("존분류='" + SrcDrv("code").ToString + "'")
|
|
'For Each 기존입력면 As DS.tbl_myounRow In 사용입력면
|
|
' Dim 신규입력면 As DS.tbl_myounRow = DSET1.tbl_myoun.Newtbl_myounRow
|
|
' For Each 기존컬럼 As DataColumn In DSET1.tbl_myoun.Columns
|
|
' If 기존컬럼.ColumnName.ToUpper = "CODE" Then
|
|
' 신규입력면.code = GetMyounMaxCode(DSET1.tbl_myoun)
|
|
' Else
|
|
' 신규입력면(기존컬럼.ColumnName) = 기존입력면(기존컬럼.ColumnName)
|
|
' End If
|
|
' Next
|
|
' 신규입력면.존분류 = NewDrv("code").ToString
|
|
' DSET1.tbl_myoun.Rows.Add(신규입력면)
|
|
' DSET1.tbl_myoun.AcceptChanges()
|
|
'Next
|
|
|
|
|
|
Me.bs.EndEdit()
|
|
'bs.MoveLast()
|
|
End If
|
|
End Select
|
|
|
|
|
|
End If
|
|
End Sub
|
|
End Class |