Programming/.NET

.NET연동 DataWindow Modify하기~

초록깨비 2021. 5. 3. 13:36
728x90

   [ 프린트 스크립트 ] 

 

    Protected Overrides Sub DoPrintEvent()

        WinMethod.WaitMessage("조회중.....프린트")

        Dim parmDw As New SiS.Framework.Data.DBParameterCollection()


        parmDw.Add("P_EXPENSE_DATE_F", CDate(Me.dfteTerm.FromDate.Date).ToString("yyyyMMdd"))
        parmDw.Add("P_EXPENSE_DATE_T", CDate(Me.dfteTerm.ToDate.Date).ToString("yyyyMMdd"))
        parmDw.Add("P_CUST_CODE", Func.NVL(cteCust.CodeEditValue, ""))
        parmDw.Add("P_SLIP_NO", rgAccGb.EditValue)
        parmDw.Add("P_EXPENSE_GB", rgLocalGb.EditValue)
        parmDw.Add("P_IMP_LC_NO", Func.NVL(txtLcNum.EditValue, ""))

        Dim strEmpNo As String = AppInfoBag.User.ID

        Dim pblName As String = "TM015.PBL"
        Dim dwName As String = "d_tm015r03"

        Dim dts As New Sybase.DataWindow.DataStore
        dts.SetFullState(CMUX.DataWindowProvider.GetDWFullState(pblName, dwName, parmDw))

 

        'IP Address
        Dim host As System.Net.IPHostEntry
        host = System.Net.Dns.GetHostEntry("")
        Dim ip_address As String = host.AddressList(0).ToString()

       

        Dim strCust As String = Nothing
        Dim strCustNm As String = Nothing

       

       If Me.cteCust.CodeEditValue = "" Then
            strCust = "%"
            strCustNm = "전체"
        Else
            strCust = Me.cteCust.CodeEditValue
            strCustNm = Me.cteCust.DisplayEdit.EditValue
        End If

 

        Dim strAccGb As String
        If (rgAccGb.EditValue = "1") Then
            strAccGb = "전표발행"
        ElseIf (rgAccGb.EditValue = "3") Then
            strAccGb = "전표미발행"
        Else
            strAccGb = "전체"
        End If

 

        Dim strLocalGb As String = Nothing
        If (rgLocalGb.EditValue = "1") Then
            strLocalGb = "포함"
        Else
            strLocalGb = "미포함"
        End If

 

        Dim strLcNum As String = Nothing
        If (txtLcNum.EditValue = "") Then
            strLcNum = "%"
        Else
            strLcNum = txtLcNum.EditValue
        End If

 

        Dim strModify As String = "st_user_id.Text     = " + "'" + strEmpNo + "'" & _
                                  "st_ip_address.Text  = " + "'" + ip_address + "'" & _
                                  "st_cust.Text        = " + "'" + strCust + "'" & _
                                  "st_cust_nm.Text     = " + "'" + strCustNm + "'" & _
                                  "st_accgb.Text       = " + "'" + strAccGb + "'" & _
                                  "st_localgb.Text     = " + "'" + strLocalGb + "'" & _
                                  "st_lcnum.Text       = " + "'" + strLcNum + "'"

        dts.Modify(strModify)


        Dim rowcnt As Integer = dts.RowCount()

        If rowcnt = 0 Then
            Win.WinMethod.MsgBox("출력할 데이타가 없습니다", "알림")
        Else
            dts.Print()  ' print
        End If

        dts.Dispose()

        WinMethod.HideMessage()

    End Sub

 

 

 


    [ 미리보기 스크립트 ] 


    Protected Overrides Sub DoPrintPriviewEvent()

        WinMethod.WaitMessage("조회중.....미리보기")

        Dim parmDw As New SiS.Framework.Data.DBParameterCollection()
       

       parmDw.Add("P_EXPENSE_DATE_F", CDate(Me.dfteTerm.FromDate.Date).ToString("yyyyMMdd"))
        parmDw.Add("P_EXPENSE_DATE_T", CDate(Me.dfteTerm.ToDate.Date).ToString("yyyyMMdd"))
        parmDw.Add("P_CUST_CODE", Func.NVL(cteCust.CodeEditValue, ""))
        parmDw.Add("P_SLIP_NO", rgAccGb.EditValue)
        parmDw.Add("P_EXPENSE_GB", rgLocalGb.EditValue)
        parmDw.Add("P_IMP_LC_NO", Func.NVL(txtLcNum.EditValue, ""))

       

        Dim strEmpNo As String = AppInfoBag.User.ID

        Dim pblName As String = "TM015.PBL"
        Dim dwName As String = "d_tm015r03"

        Dim dts As New Sybase.DataWindow.DataStore
        dts.SetFullState(CMUX.DataWindowProvider.GetDWFullState(pblName, dwName, parmDw)) ' 조회

       

        'IP Address
        Dim host As System.Net.IPHostEntry
        host = System.Net.Dns.GetHostEntry("")
        Dim ip_address As String = host.AddressList(0).ToString()

       

        Dim strCust As String = Nothing
        Dim strCustNm As String = Nothing

 

        If Me.cteCust.CodeEditValue = "" Then
            strCust = "%"
            strCustNm = "전체"
        Else
            strCust = Me.cteCust.CodeEditValue
            strCustNm = Me.cteCust.DisplayEdit.EditValue
        End If

 

        Dim strAccGb As String
        If (rgAccGb.EditValue = "1") Then
            strAccGb = "전표발행"
        ElseIf (rgAccGb.EditValue = "3") Then
            strAccGb = "전표미발행"
        Else
            strAccGb = "전체"
        End If

 

        Dim strLocalGb As String = Nothing
        If (rgLocalGb.EditValue = "1") Then
            strLocalGb = "포함"
        Else
            strLocalGb = "미포함"
        End If

 

        Dim strLcNum As String = Nothing
        If (txtLcNum.EditValue = "") Then
            strLcNum = "%"
        Else
            strLcNum = txtLcNum.EditValue
        End If

 

        Dim strModify As String = "st_user_id.Text     = " + "'" + strEmpNo + "'" & _
                                  "st_ip_address.Text  = " + "'" + ip_address + "'" & _
                                  "st_cust.Text        = " + "'" + strCust + "'" & _
                                  "st_cust_nm.Text     = " + "'" + strCustNm + "'" & _
                                  "st_accgb.Text       = " + "'" + strAccGb + "'" & _
                                  "st_localgb.Text     = " + "'" + strLocalGb + "'" & _
                                  "st_lcnum.Text       = " + "'" + strLcNum + "'"

        dts.Modify(strModify)


        Dim rowcnt As Integer = dts.RowCount()

        If rowcnt = 0 Then
            Win.WinMethod.MsgBox("데이타가 없습니다", "알림")
        Else
            WinMethod.HideMessage()
            CMUX.DataWindowProvider.PrintPreivewDialog(dts)  ' dialog에조회  
        End If

        dts.Dispose()

    End Sub

728x90