Public Class Frm_kongjo

    Dim Init As Boolean = False
    Dim SrcDrv As DataRowView

#Region "data Base 변경여부및 적용방법"

    '''변경된내용을적용한다.
    Public Overrides Function AcceptChanged() As Boolean
        bs.EndEdit()
        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
        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
        bs.EndEdit()
        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


    Private Sub MdiMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'MdiMain.Toggle_Menu_Color(MdiMain.E_MenuIdx.공조처리)
        Me.bs.DataSource = DSET
        '//공조처리
        AddHandler DSET.tbl_kongjo.TableNewRow, AddressOf AddNewDataRow_kongjo

        '//콤보컨트롤 바인딩
        Binding_Zone()

        '//모든컨트롤의 cTrl_enter 를 추가합니다
        BindProperty(CType(Me.SplitContainer1.Panel2.Controls, Control.ControlCollection))

        Me.bs.Filter = "code <> '0' and 공조방식 = '" + Me.Parameter + "'"
        Me.lb_grpname.Text = Me.Parameter

        ' Binding_Zone()
        Me.Init = True

        Try
            Me.bs.Position = CEnergy.ARINCLASS.Read_LastPos_Frm(Me)
        Catch ex As Exception
            Me.bs.MoveFirst()
        End Try

        bs_CurrentChanged(sender, e)
        Validate_Control()


    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
                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
                Next
                Work_msg_timer("모든값이 변경되었습니다", 25)
            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, "")
                    Dr(Field) = CType(sender, MyCmb).SelectedValue
                Next
                Work_msg_timer("모든값이 변경되었습니다", 25)
            Catch ex As Exception

            End Try
        End If
    End Sub
#End Region


#Region "공조처리시스템"

    Private Function GetMaxCode(ByVal dt As DataTable) As String
        Try
            Dim Dr As DataRow = dt.Select("", "code desc")(0)
            Return Format(CInt(Dr("code")) + 1, "0000")
        Catch ex As Exception
            Return "0001"
        End Try
    End Function

    Private Sub MdiMain_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        CEnergy.ARINCLASS.SaveLoad_FrmSetting(Me, Me.bs.Position, True)
    End Sub

    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
        End Select
    End Sub
    Private Sub AddNewDataRow_kongjo(ByVal sender As Object, ByVal e As System.Data.DataTableNewRowEventArgs)
        e.Row.Item("code") = GetMaxCode(DSET.tbl_kongjo)
        e.Row.Item("팬효율산출방식") = "계산치"
    End Sub
    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()
        INitRow(Me.Controls)
    End Sub

    Private Sub ToolStripButton49_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_Del.Click
        Dbbase.DelCrow(Me.bs, True)
    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(DSET.tbl_profile, Nothing)
    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_공조방식 As New BindingSource(DSET, "tbl_common")
        bs_cmb_공조방식.Filter = "gubun='1026'"
        bs_cmb_공조방식.Sort = "code"
        Me.공조방식NCMB.DataSource = bs_cmb_공조방식
        공조방식NCMB.DisplayMember = "name"
        공조방식NCMB.ValueMember = "name"
        Me.공조방식NCMB.DataBindings.Add("selectedvalue", Me.bs, "공조방식")
        AddHandler 공조방식NCMB.KeyDown, AddressOf Cmb_DeleteVal

        Dim bs_cmb_리턴공기혼합여부ComboBox As New BindingSource(DSET, "tbl_common")
        bs_cmb_리턴공기혼합여부ComboBox.Filter = "gubun='1054'"
        bs_cmb_리턴공기혼합여부ComboBox.Sort = "code"
        Me.리턴공기혼합여부ComboBox.DataSource = bs_cmb_리턴공기혼합여부ComboBox
        리턴공기혼합여부ComboBox.DisplayMember = "name"
        리턴공기혼합여부ComboBox.ValueMember = "name"
        Me.리턴공기혼합여부ComboBox.DataBindings.Add("selectedvalue", Me.bs, "리턴공기혼합여부")
        AddHandler 리턴공기혼합여부ComboBox.KeyDown, AddressOf Cmb_DeleteVal

        Dim bs_가습기유형ComboBox As New BindingSource(DSET, "tbl_common")
        bs_가습기유형ComboBox.Filter = "gubun='1015'"
        bs_가습기유형ComboBox.Sort = "code"
        Me.가습기유형ComboBox.DataSource = bs_가습기유형ComboBox
        가습기유형ComboBox.DisplayMember = "name"
        가습기유형ComboBox.ValueMember = "name"
        Me.가습기유형ComboBox.DataBindings.Add("selectedvalue", Me.bs, "가습기유형")
        AddHandler 가습기유형ComboBox.KeyDown, AddressOf Cmb_DeleteVal

        Dim bs_외기냉방제어유무ComboBox As New BindingSource(DSET, "tbl_common")
        bs_외기냉방제어유무ComboBox.Filter = "gubun='1032'"
        bs_외기냉방제어유무ComboBox.Sort = "code"
        Me.외기냉방제어유무ComboBox.DataSource = bs_외기냉방제어유무ComboBox
        외기냉방제어유무ComboBox.DisplayMember = "name"
        외기냉방제어유무ComboBox.ValueMember = "name"
        Me.외기냉방제어유무ComboBox.DataBindings.Add("selectedvalue", Me.bs, "외기냉방제어유무")
        AddHandler 외기냉방제어유무ComboBox.KeyDown, AddressOf Cmb_DeleteVal

        Dim bs_열교환기유형ComboBox As New BindingSource(DSET, "tbl_common")
        bs_열교환기유형ComboBox.Filter = "gubun='1016'"
        bs_열교환기유형ComboBox.Sort = "code"
        Me.열교환기유형ComboBox.DataSource = bs_열교환기유형ComboBox
        열교환기유형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='1031'"
        Cmb_팬효율산출방식.DataSource = bs_Cmb_팬효율산출방식
        Cmb_팬효율산출방식.DisplayMember = "name"
        Cmb_팬효율산출방식.ValueMember = "name"
        Me.Cmb_팬효율산출방식.DataBindings.Add("selectedvalue", Me.bs, "팬효율산출방식")

    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 열교환기유형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
        Try
            If Me.열교환기유형ComboBox.SelectedIndex = 0 Or Me.열교환기유형ComboBox.SelectedIndex = 1 Then '//사용안함 
                Me.tb_08.Enabled = False
                Me.tb_13.Enabled = False
            Else
                Me.tb_08.Enabled = True
                Me.tb_13.Enabled = True
            End If
            bs.EndEdit()
        Catch ex As Exception

        End Try
        Try
            If Me.Cmb_팬효율산출방식.SelectedIndex = 0 Then
                Me.Tb_급기풍량.Enabled = True
                Me.Tb_배기풍량.Enabled = True
                Me.Tb_급기팬동력.Enabled = True
                Me.Tb_배기팬동력.Enabled = True
            Else
                Me.Tb_급기풍량.Enabled = False
                Me.Tb_배기풍량.Enabled = False
                Me.Tb_급기팬동력.Enabled = False
                Me.Tb_배기팬동력.Enabled = False
            End If
        Catch ex As Exception

        End Try

    End Sub

    Private Sub bs_CurrentChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bs.CurrentChanged
        '//존에 적용된수를 구한다ㅏ.(존수만 구했으니깐 단순히 해당 데이터의 배열갯수만 보여줬습니다. 면적을 구하려면
        If Not Init Then Return
        Try
            Dim Drv As DataRowView = CType(bs.Current, DataRowView)
            Dim DR() As DS.tbl_zoneRow = DSET.tbl_zone.Select("냉난방공조처리시스템='" & Drv("code").ToString & "'")
            If DR.GetUpperBound(0) = -1 Then   '//해당되는 데이터가없을경우
                Me.tb_zone_cnt.Text = "0"
                Me.TextBox1.Text = "0"
            Else
                Me.tb_zone_cnt.Text = CStr(DR.GetUpperBound(0) + 1)
                Dim 면적 As Decimal = 0
                For Each drow As DS.tbl_zoneRow In DR
                    Try
                        면적 += TOSG(drow.면적)
                    Catch ex As Exception

                    End Try
                Next
                Me.TextBox1.Text = TOST(면적)
            End If

        Catch ex As Exception

        End Try

        Me.bs.EndEdit()

        '// 며면적에 들어왓어요 표시하고싶으신곳에하세요


    End Sub

    Private Sub 공조방식NCMB_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles 공조방식NCMB.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))
            If CB.GetUpperBound(0) <> 17 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(Me.bs.Current, DataRowView)("설명") = CB(i).Split(CChar(vbTab))(ii).Trim
                        Case 0 + 3  '//사용프로필 앞에 두개를 숫자4자리로변환
                            If CB(i).Split(CChar(vbTab))(ii).Trim = "" Then
                                Me.공조방식NCMB.SelectedIndex = 0
                            Else
                                Me.공조방식NCMB.Text = CB(i).Split(CChar(vbTab))(ii).Trim
                            End If
                            'Me.공조방식NCMB.Text = CB(i).Split(CChar(vbTab))(ii).Trim 
                        Case 1 + 3  '//공란
                            Me.tb_01.Text = CB(i).Split(CChar(vbTab))(ii).Trim
                        Case 2 + 3  '//면적
                            Me.tb_02.Text = CB(i).Split(CChar(vbTab))(ii).Trim
                        Case 3 + 3
                            Me.tb_03.Text = CB(i).Split(CChar(vbTab))(ii).Trim
                        Case 4 + 3
                            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 5 + 3
                            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 6 + 3
                            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
                            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 8 + 3
                            Me.tb_08.Text = CB(i).Split(CChar(vbTab))(ii).Trim
                        Case 8 + 3 + 1
                            Me.tb_13.Text = CB(i).Split(CChar(vbTab))(ii).Trim
                        Case 9 + 3 + 1
                            Me.Tb_급기팬압력손실.Text = CB(i).Split(CChar(vbTab))(ii).Trim
                        Case 10 + 3 + 1
                            Me.Tb_배기팬압력손실.Text = CB(i).Split(CChar(vbTab))(ii).Trim
                        Case 11 + 3 + 1
                            Me.Tb_급기팬효율.Text = CB(i).Split(CChar(vbTab))(ii).Trim
                        Case 12 + 3 + 1
                            Me.Tb_배기팬효율.Text = CB(i).Split(CChar(vbTab))(ii).Trim
                    End Select
                Next
            Next

            Me.bs.EndEdit()
        End If
    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
                Dim dR() As DataRow = DSET.tbl_kongjo.Select(Me.bs.Filter, "")
                For i As Integer = dR.GetUpperBound(0) To 0 Step -1
                    dR(i).Delete()
                Next
                DSET.tbl_kongjo.AcceptChanges()
            End If
        End If
    End Sub


    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 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" Then  '//2011.03.08 추가
            Select Case e.KeyCode
                Case Keys.D
                    If e.Alt Then
                        Dbbase.DelCrow(Me.bs, False)
                    End If
                Case Keys.C
                    If e.Control Then
                        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
                        If Me.SrcDrv Is Nothing Then Return
                        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
                                NewDrv(C.ColumnName) = SrcDrv(C.ColumnName) & "#1"
                            Else
                                NewDrv(C.ColumnName) = SrcDrv(C.ColumnName)
                            End If
                        Next
                        Me.bs.EndEdit()
                        bs.MoveLast()
                    End If
            End Select
        End If
    End Sub

    Private Sub Cmb_팬효율산출방식_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cmb_팬효율산출방식.SelectedIndexChanged
        Validate_Control()
    End Sub

    Private Sub Tb_급기풍량_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tb_급기풍량.TextChanged, Tb_급기팬압력손실.TextChanged, Tb_급기팬동력.TextChanged
        If Me.Cmb_팬효율산출방식.Text = "계산치" AndAlso Me.Tb_급기팬동력.Text <> "" AndAlso Me.Tb_급기팬동력.Text <> "0" AndAlso Me.Tb_급기팬동력.Text <> "0." Then
            Dim 효율 As Decimal
            Try
                효율 = Math.Round(TOSG(Tb_급기풍량.Text) * (TOSG(Tb_급기팬압력손실.Text) / 9.8) / (TOSG(Tb_급기팬동력.Text) * 102 * 3600), 3)
                Me.Tb_급기팬효율.Text = TOSG(효율).ToString
            Catch ex As Exception

            End Try
        End If
    End Sub

    Private Sub Tb_배기풍량_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tb_배기풍량.TextChanged, Tb_배기팬압력손실.TextChanged, Tb_배기팬동력.TextChanged
        If Me.Cmb_팬효율산출방식.Text = "계산치" AndAlso Me.Tb_배기팬동력.Text <> "" AndAlso Me.Tb_배기팬동력.Text <> "0" AndAlso Me.Tb_배기팬동력.Text <> "0." Then
            Dim 효율 As Decimal
            Try
                효율 = Math.Round(TOSG(Tb_배기풍량.Text) * (TOSG(Tb_배기팬압력손실.Text) / 9.8) / (TOSG(Tb_배기팬동력.Text) * 102 * 3600), 3)
                Me.Tb_배기팬효율.Text = TOSG(효율).ToString
            Catch ex As Exception

            End Try
        End If
    End Sub


End Class