1084 lines
46 KiB
VB.net
1084 lines
46 KiB
VB.net
Imports iMESExceptionManager
|
|
|
|
Imports Infragistics.Win
|
|
Imports Infragistics.Win.UltraWinGrid
|
|
Public Class frmENTStuBasis
|
|
|
|
Inherits COM_Kit.frmBasisTemplat
|
|
|
|
Public PrivFunNo As String = defString
|
|
|
|
'//WS相關變數
|
|
' 2016 YF, Dim wsENT As New wsENT.wsENT '宣告Web Service物件?
|
|
Dim tmpStringReader As System.IO.StringReader '將字串轉換成可讀入DataSet的物件
|
|
Dim XmlData As String '儲存取回之資料
|
|
Dim XmlSchema As String '儲存取回之資料結構
|
|
Dim InXml As String '儲存呼叫Web Service的傳入參數(Request字串)
|
|
Dim OutXml As String '儲存Web Service的傳回值(Response字串)
|
|
Dim strIdentity As String '儲存Identity XML字串?
|
|
Dim strParameter As String '儲存Parameter XML字串
|
|
|
|
'//資料表相關變數
|
|
|
|
Dim dsENT As New DataSet '資料集:儲存取回之資料?
|
|
|
|
Dim tblENTStuBasis As String '儲存取回資料表的名稱(master)?
|
|
Dim tblENTStuBasisCont As String '明細資料表名稱(detail)
|
|
Dim strFilter As String 'Filter string及列印的過濾條件
|
|
|
|
'//其他共用變數
|
|
Dim StuBasisNo As String 'for Gird to Focus
|
|
Dim ContactorName As String 'for DetailGrid to Focus
|
|
Dim ugrRow As Infragistics.Win.UltraWinGrid.UltraGridRow
|
|
Friend WithEvents btnAdd As Misc.UltraButton
|
|
Friend WithEvents btnEdit As Misc.UltraButton
|
|
Friend WithEvents btnDel As Misc.UltraButton
|
|
Friend WithEvents btnCopy As Misc.UltraButton
|
|
Friend WithEvents btnApprove As Misc.UltraButton
|
|
Friend WithEvents iugStuBasis As iMESUltraGrid.iMESUltraGridControl
|
|
Friend WithEvents UltraControlContainerEditor1 As UltraWinEditors.UltraControlContainerEditor
|
|
Dim i As Integer
|
|
|
|
#Region " Windows Form Designer generated code "
|
|
|
|
Public Sub New()
|
|
MyBase.New()
|
|
|
|
'This call is required by the Windows Form Designer.
|
|
InitializeComponent()
|
|
|
|
'Add any initialization after the InitializeComponent() call
|
|
|
|
End Sub
|
|
|
|
'Form overrides dispose to clean up the component list.
|
|
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
|
|
If disposing Then
|
|
If Not (components Is Nothing) Then
|
|
components.Dispose()
|
|
End If
|
|
End If
|
|
MyBase.Dispose(disposing)
|
|
End Sub
|
|
|
|
Private components As System.ComponentModel.IContainer
|
|
Friend WithEvents iugDetail As iMESUltraGrid.iMESUltraGridControl
|
|
Friend WithEvents btnClose As Infragistics.Win.Misc.UltraButton
|
|
Friend WithEvents btnEMail As Infragistics.Win.Misc.UltraButton
|
|
Friend WithEvents btnDCopy As Infragistics.Win.Misc.UltraButton
|
|
Friend WithEvents btnDDel As Infragistics.Win.Misc.UltraButton
|
|
Friend WithEvents btnDEdit As Infragistics.Win.Misc.UltraButton
|
|
Friend WithEvents btnDAdd As Infragistics.Win.Misc.UltraButton
|
|
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
|
Me.components = New System.ComponentModel.Container()
|
|
Me.btnClose = New Infragistics.Win.Misc.UltraButton()
|
|
Me.btnEMail = New Infragistics.Win.Misc.UltraButton()
|
|
Me.btnDCopy = New Infragistics.Win.Misc.UltraButton()
|
|
Me.btnDDel = New Infragistics.Win.Misc.UltraButton()
|
|
Me.btnDEdit = New Infragistics.Win.Misc.UltraButton()
|
|
Me.btnDAdd = New Infragistics.Win.Misc.UltraButton()
|
|
Me.iugDetail = New iMESUltraGrid.iMESUltraGridControl()
|
|
Me.btnAdd = New Infragistics.Win.Misc.UltraButton()
|
|
Me.btnEdit = New Infragistics.Win.Misc.UltraButton()
|
|
Me.btnDel = New Infragistics.Win.Misc.UltraButton()
|
|
Me.btnCopy = New Infragistics.Win.Misc.UltraButton()
|
|
Me.btnApprove = New Infragistics.Win.Misc.UltraButton()
|
|
Me.iugStuBasis = New iMESUltraGrid.iMESUltraGridControl()
|
|
Me.UltraControlContainerEditor1 = New Infragistics.Win.UltraWinEditors.UltraControlContainerEditor(Me.components)
|
|
CType(Me.UltraControlContainerEditor1, System.ComponentModel.ISupportInitialize).BeginInit()
|
|
Me.SuspendLayout()
|
|
'
|
|
'btnClose
|
|
'
|
|
Me.btnClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
|
Me.btnClose.Location = New System.Drawing.Point(912, 552)
|
|
Me.btnClose.Name = "btnClose"
|
|
Me.btnClose.Size = New System.Drawing.Size(88, 32)
|
|
Me.btnClose.TabIndex = 18
|
|
Me.btnClose.Text = "Close (&X)"
|
|
'
|
|
'btnEMail
|
|
'
|
|
Me.btnEMail.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
|
Me.btnEMail.Location = New System.Drawing.Point(912, 429)
|
|
Me.btnEMail.Name = "btnEMail"
|
|
Me.btnEMail.Size = New System.Drawing.Size(88, 32)
|
|
Me.btnEMail.TabIndex = 17
|
|
Me.btnEMail.Text = "Mail"
|
|
'
|
|
'btnDCopy
|
|
'
|
|
Me.btnDCopy.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
|
Me.btnDCopy.Location = New System.Drawing.Point(912, 389)
|
|
Me.btnDCopy.Name = "btnDCopy"
|
|
Me.btnDCopy.Size = New System.Drawing.Size(88, 32)
|
|
Me.btnDCopy.TabIndex = 16
|
|
Me.btnDCopy.Text = "Copy"
|
|
'
|
|
'btnDDel
|
|
'
|
|
Me.btnDDel.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
|
Me.btnDDel.Location = New System.Drawing.Point(912, 349)
|
|
Me.btnDDel.Name = "btnDDel"
|
|
Me.btnDDel.Size = New System.Drawing.Size(88, 32)
|
|
Me.btnDDel.TabIndex = 15
|
|
Me.btnDDel.Text = "DEL"
|
|
'
|
|
'btnDEdit
|
|
'
|
|
Me.btnDEdit.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
|
Me.btnDEdit.Location = New System.Drawing.Point(912, 309)
|
|
Me.btnDEdit.Name = "btnDEdit"
|
|
Me.btnDEdit.Size = New System.Drawing.Size(88, 32)
|
|
Me.btnDEdit.TabIndex = 14
|
|
Me.btnDEdit.Text = "EDIT"
|
|
'
|
|
'btnDAdd
|
|
'
|
|
Me.btnDAdd.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
|
Me.btnDAdd.Location = New System.Drawing.Point(912, 269)
|
|
Me.btnDAdd.Name = "btnDAdd"
|
|
Me.btnDAdd.Size = New System.Drawing.Size(88, 32)
|
|
Me.btnDAdd.TabIndex = 13
|
|
Me.btnDAdd.Text = "ADD"
|
|
'
|
|
'iugDetail
|
|
'
|
|
Me.iugDetail.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
|
Or System.Windows.Forms.AnchorStyles.Left) _
|
|
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
|
Me.iugDetail.EnterDirection = iMESUltraGrid.iMESUltraGridControl.EnterDirectionEnum.Down
|
|
Me.iugDetail.GroupBoxPromptText = "Drag a column header here to group by that column."
|
|
Me.iugDetail.GroupBoxTextForeColor = System.Drawing.Color.Red
|
|
Me.iugDetail.Identity = "IMes"
|
|
Me.iugDetail.IdentityForm = ""
|
|
Me.iugDetail.LayOutFilePath = ""
|
|
Me.iugDetail.Location = New System.Drawing.Point(12, 270)
|
|
Me.iugDetail.Name = "iugDetail"
|
|
Me.iugDetail.PrintFitWidthToPages = 0
|
|
Me.iugDetail.PrintLandscape = True
|
|
Me.iugDetail.PrintPageFooter = ""
|
|
Me.iugDetail.PrintPageFooterHAlign = Infragistics.Win.HAlign.[Default]
|
|
Me.iugDetail.PrintPageFooterHeight = 20
|
|
Me.iugDetail.PrintPageHeader = ""
|
|
Me.iugDetail.PrintPageHeaderHAlign = Infragistics.Win.HAlign.[Default]
|
|
Me.iugDetail.PrintPageHeaderHeight = 20
|
|
Me.iugDetail.PrintZoom = 1.0R
|
|
Me.iugDetail.Size = New System.Drawing.Size(894, 314)
|
|
Me.iugDetail.TabIndex = 12
|
|
Me.iugDetail.UserNo = "IMes"
|
|
'
|
|
'btnAdd
|
|
'
|
|
Me.btnAdd.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
|
Me.btnAdd.Location = New System.Drawing.Point(912, 53)
|
|
Me.btnAdd.Name = "btnAdd"
|
|
Me.btnAdd.Size = New System.Drawing.Size(88, 32)
|
|
Me.btnAdd.TabIndex = 20
|
|
Me.btnAdd.Text = "Add(&A)"
|
|
'
|
|
'btnEdit
|
|
'
|
|
Me.btnEdit.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
|
Me.btnEdit.Location = New System.Drawing.Point(912, 93)
|
|
Me.btnEdit.Name = "btnEdit"
|
|
Me.btnEdit.Size = New System.Drawing.Size(88, 32)
|
|
Me.btnEdit.TabIndex = 21
|
|
Me.btnEdit.Text = "Edit(&E)"
|
|
'
|
|
'btnDel
|
|
'
|
|
Me.btnDel.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
|
Me.btnDel.Location = New System.Drawing.Point(912, 133)
|
|
Me.btnDel.Name = "btnDel"
|
|
Me.btnDel.Size = New System.Drawing.Size(88, 32)
|
|
Me.btnDel.TabIndex = 22
|
|
Me.btnDel.Text = "Del(&D)"
|
|
'
|
|
'btnCopy
|
|
'
|
|
Me.btnCopy.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
|
Me.btnCopy.Location = New System.Drawing.Point(912, 173)
|
|
Me.btnCopy.Name = "btnCopy"
|
|
Me.btnCopy.Size = New System.Drawing.Size(88, 32)
|
|
Me.btnCopy.TabIndex = 23
|
|
Me.btnCopy.Text = "Copy(&C)"
|
|
'
|
|
'btnApprove
|
|
'
|
|
Me.btnApprove.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
|
Me.btnApprove.Location = New System.Drawing.Point(912, 213)
|
|
Me.btnApprove.Name = "btnApprove"
|
|
Me.btnApprove.Size = New System.Drawing.Size(88, 32)
|
|
Me.btnApprove.TabIndex = 24
|
|
Me.btnApprove.Text = "Approve(&Y)"
|
|
'
|
|
'iugStuBasis
|
|
'
|
|
Me.iugStuBasis.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
|
Or System.Windows.Forms.AnchorStyles.Left) _
|
|
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
|
Me.iugStuBasis.EnterDirection = iMESUltraGrid.iMESUltraGridControl.EnterDirectionEnum.Down
|
|
Me.iugStuBasis.GroupBoxPromptText = "Drag a column header here to group by that column."
|
|
Me.iugStuBasis.GroupBoxTextForeColor = System.Drawing.Color.Red
|
|
Me.iugStuBasis.Identity = "IMes"
|
|
Me.iugStuBasis.IdentityForm = ""
|
|
Me.iugStuBasis.LayOutFilePath = ""
|
|
Me.iugStuBasis.Location = New System.Drawing.Point(12, 53)
|
|
Me.iugStuBasis.Name = "iugStuBasis"
|
|
Me.iugStuBasis.PrintFitWidthToPages = 0
|
|
Me.iugStuBasis.PrintLandscape = True
|
|
Me.iugStuBasis.PrintPageFooter = ""
|
|
Me.iugStuBasis.PrintPageFooterHAlign = Infragistics.Win.HAlign.[Default]
|
|
Me.iugStuBasis.PrintPageFooterHeight = 20
|
|
Me.iugStuBasis.PrintPageHeader = ""
|
|
Me.iugStuBasis.PrintPageHeaderHAlign = Infragistics.Win.HAlign.[Default]
|
|
Me.iugStuBasis.PrintPageHeaderHeight = 20
|
|
Me.iugStuBasis.PrintZoom = 1.0R
|
|
Me.iugStuBasis.Size = New System.Drawing.Size(894, 192)
|
|
Me.iugStuBasis.TabIndex = 25
|
|
Me.iugStuBasis.UserNo = "IMes"
|
|
'
|
|
'UltraControlContainerEditor1
|
|
'
|
|
Me.UltraControlContainerEditor1.ContainingControl = Me
|
|
Me.UltraControlContainerEditor1.Name = "UltraControlContainerEditor1"
|
|
'
|
|
'frmENTStuBasis
|
|
'
|
|
Me.ClientSize = New System.Drawing.Size(1008, 591)
|
|
Me.Controls.Add(Me.btnClose)
|
|
Me.Controls.Add(Me.btnApprove)
|
|
Me.Controls.Add(Me.btnEMail)
|
|
Me.Controls.Add(Me.btnDCopy)
|
|
Me.Controls.Add(Me.btnCopy)
|
|
Me.Controls.Add(Me.btnDDel)
|
|
Me.Controls.Add(Me.iugStuBasis)
|
|
Me.Controls.Add(Me.btnDEdit)
|
|
Me.Controls.Add(Me.btnAdd)
|
|
Me.Controls.Add(Me.btnDAdd)
|
|
Me.Controls.Add(Me.btnDel)
|
|
Me.Controls.Add(Me.iugDetail)
|
|
Me.Controls.Add(Me.btnEdit)
|
|
Me.Font = New System.Drawing.Font("Times New Roman", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
|
Me.Name = "frmENTStuBasis"
|
|
Me.Text = "ENT StuBasis & Contactor"
|
|
Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
|
|
Me.Controls.SetChildIndex(Me.btnEdit, 0)
|
|
Me.Controls.SetChildIndex(Me.iugDetail, 0)
|
|
Me.Controls.SetChildIndex(Me.btnDel, 0)
|
|
Me.Controls.SetChildIndex(Me.btnDAdd, 0)
|
|
Me.Controls.SetChildIndex(Me.btnAdd, 0)
|
|
Me.Controls.SetChildIndex(Me.btnDEdit, 0)
|
|
Me.Controls.SetChildIndex(Me.iugStuBasis, 0)
|
|
Me.Controls.SetChildIndex(Me.btnDDel, 0)
|
|
Me.Controls.SetChildIndex(Me.btnCopy, 0)
|
|
Me.Controls.SetChildIndex(Me.btnDCopy, 0)
|
|
Me.Controls.SetChildIndex(Me.btnEMail, 0)
|
|
Me.Controls.SetChildIndex(Me.btnApprove, 0)
|
|
Me.Controls.SetChildIndex(Me.btnClose, 0)
|
|
CType(Me.UltraControlContainerEditor1, System.ComponentModel.ISupportInitialize).EndInit()
|
|
Me.ResumeLayout(False)
|
|
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
Private Sub frmStuBasis_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
|
|
Cursor.Current = Cursors.WaitCursor
|
|
|
|
' 2016 YF, wsENT.Url = LocalizeWebService(wsENT.Url.ToString)
|
|
' 2016 YF, wsENT.EnableDecompression = True
|
|
|
|
Call funiMESUltraGridIni() 'Grid初始設定
|
|
|
|
'//取出資料
|
|
Call funLoadStuBasis()
|
|
|
|
SetIssueState(Issue.Unfrozen) '預設在Unforzen上
|
|
SetSearchFieldName(New String() {"StuBasisNo", "StuBasisName"}) '設置搜尋欄位
|
|
|
|
|
|
'語系切換
|
|
Call ExeChangeResource(Me, gLanguageMode)
|
|
ExeGroupControlPriv(Me, PrivFunNo)
|
|
|
|
Cursor.Current = Cursors.Default
|
|
|
|
End Sub
|
|
|
|
Private Sub frmStuBasis_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
|
|
If Not dsENT Is Nothing Then dsENT.Dispose()
|
|
' 2016 YF, If Not wsENT Is Nothing Then wsENT.Dispose()
|
|
End Sub
|
|
|
|
Protected Overrides Sub rdoIssue_CheckedChanged(sender As Object, e As EventArgs)
|
|
If IsNothing(dsENT) Then Exit Sub
|
|
|
|
Select Case GetIssueState()
|
|
Case Issue.Unfrozen
|
|
dsENT.Tables(tblENTStuBasis).DefaultView.RowFilter = "IssueState=0"
|
|
Case Issue.Pending
|
|
dsENT.Tables(tblENTStuBasis).DefaultView.RowFilter = "IssueState=1"
|
|
Case Issue.Active
|
|
dsENT.Tables(tblENTStuBasis).DefaultView.RowFilter = "IssueState=2"
|
|
Case Issue.Unused
|
|
dsENT.Tables(tblENTStuBasis).DefaultView.RowFilter = "IssueState=-1"
|
|
End Select
|
|
Me.iugStuBasis.iMESUltraGrid.DataSource = dsENT.Tables(tblENTStuBasis).DefaultView
|
|
Call funShowActiveDetail()
|
|
End Sub
|
|
|
|
Protected Overrides Sub Finalize()
|
|
MyBase.Finalize()
|
|
End Sub
|
|
|
|
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
|
|
|
|
Dim fStuBasisDef As New frmStuBasisDef
|
|
|
|
fStuBasisDef.DefMode = 0
|
|
fStuBasisDef.ShowDialog(Me)
|
|
fStuBasisDef.Dispose()
|
|
|
|
If gReturnKeyValue = "" Then Exit Sub
|
|
|
|
StuBasisNo = gReturnKeyValue
|
|
|
|
'重新取出資料
|
|
Call funLoadStuBasis()
|
|
|
|
If GetIssueState() = Issue.Unfrozen Then
|
|
ugrRow = FindRecordPosition(iugStuBasis, "StuBasisNo", StuBasisNo)
|
|
If Not ugrRow Is Nothing Then
|
|
Me.iugStuBasis.iMESUltraGrid.ActiveRow = ugrRow
|
|
Me.iugStuBasis.iMESUltraGrid.ActiveRow.Selected = True
|
|
End If
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub btnEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEdit.Click
|
|
|
|
|
|
|
|
If Not Me.iugStuBasis.iMESUltraGrid.ActiveRow Is Nothing Then
|
|
'IsGroupByRow不做任何處理
|
|
If iugStuBasis.iMESUltraGrid.ActiveRow.IsGroupByRow Then
|
|
Exit Sub
|
|
End If
|
|
Dim Rows As DataRow()
|
|
|
|
'找出DataSet中在目前游標列的資料列(DataRow)
|
|
Rows = dsENT.Tables(tblENTStuBasis).Select("StuBasisNo = '" _
|
|
& Replace(Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString, "'", "''") & "'")
|
|
|
|
'核准狀態為"Unfrozen"者才可修改
|
|
|
|
If Rows(0).Item("IssueState") <> 0 Then
|
|
iMESExceptionManager.ExceptionManager.iMESMsgBoxShowDialog(ChgTranslateName_Msg("0000-202202", "[%NOT ALLOWED TO EDIT%]"), MsgBoxStyle.Exclamation, Me.Text)
|
|
Exit Sub
|
|
End If
|
|
|
|
Dim fStuBasisDef As New frmStuBasisDef
|
|
fStuBasisDef.DefMode = 1
|
|
fStuBasisDef.EditDataRow = Rows(0)
|
|
fStuBasisDef.ShowDialog(Me)
|
|
fStuBasisDef.Dispose()
|
|
|
|
If gReturnKeyValue = "" Then
|
|
Exit Sub
|
|
End If
|
|
|
|
StuBasisNo = gReturnKeyValue
|
|
|
|
'重新取出資料
|
|
Call funLoadStuBasis()
|
|
|
|
If GetIssueState() = Issue.Unfrozen Then
|
|
ugrRow = FindRecordPosition(iugStuBasis, "StuBasisNo", StuBasisNo)
|
|
If Not ugrRow Is Nothing Then
|
|
Me.iugStuBasis.iMESUltraGrid.ActiveRow = ugrRow
|
|
Me.iugStuBasis.iMESUltraGrid.ActiveRow.Selected = True
|
|
End If
|
|
End If
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub btnDel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDel.Click
|
|
|
|
|
|
|
|
'1.先檢查是否為單筆,是:將其Selecte
|
|
If Me.iugStuBasis.iMESUltraGrid.ActiveRow Is Nothing Then Exit Sub
|
|
If iugStuBasis.iMESUltraGrid.ActiveRow.IsGroupByRow Then Exit Sub
|
|
Cursor.Current = Cursors.WaitCursor
|
|
If Not Me.iugStuBasis.iMESUltraGrid.ActiveRow.Selected Then
|
|
Me.iugStuBasis.iMESUltraGrid.ActiveRow.Selected = True
|
|
End If
|
|
|
|
'2.Multi
|
|
If Me.iugStuBasis.iMESUltraGrid.Selected.Rows.Count > 0 Then
|
|
If Me.iugStuBasis.iMESUltraGrid.Selected.Rows.Item(0).IsGroupByRow Then
|
|
Exit Sub 'Selected.Rows,不會包含GroupRow & 一般的Row在一起,故若是GroupRow不做任何處理
|
|
End If
|
|
If iMESExceptionManager.ExceptionManager.iMESMsgBoxShowDialog(ChgTranslateName_Msg("0000-100001", "[%ARE YOU SURE TO DELETE ALL SELECTED RECORDS%]"), MsgBoxStyle.OkCancel + MsgBoxStyle.Question + MsgBoxStyle.DefaultButton2, Me.Text) = MsgBoxResult.Cancel Then
|
|
Exit Sub
|
|
End If
|
|
|
|
'共用資料
|
|
Dim XmlDoc As New XmlDocument
|
|
Dim blnReLoad As Boolean = False
|
|
Dim intIssueState As Integer
|
|
|
|
strIdentity = CombineXMLIdentity(gComputerName, gUserNo, GetNow())
|
|
For i = 0 To Me.iugStuBasis.iMESUltraGrid.Selected.Rows.Count - 1
|
|
intIssueState = Me.iugStuBasis.iMESUltraGrid.Selected.Rows(i).Cells("IssueState").Value
|
|
If intIssueState = 0 Or intIssueState = -1 Or intIssueState = 2 Then '狀態為Unforzen或Unused時直接刪除
|
|
|
|
strParameter = CombineXMLParameter("StuBasisNo", "StuBasisNo", "String", CInput(Me.iugStuBasis.iMESUltraGrid.Selected.Rows(i).Cells("StuBasisNo").Value.ToString), "")
|
|
strParameter = strParameter & CombineXMLParameter("issuestate", "IssueState", "String", CInput(intIssueState), "")
|
|
strParameter = strParameter & CombineXMLParameter("datastamp", "DataStamp", "Integer", iugStuBasis.iMESUltraGrid.Selected.Rows(i).Cells("DataStamp").Value, "")
|
|
InXml = CombineXMLRequest(strIdentity, strParameter)
|
|
Try
|
|
' 2016 YF, OutXml = wsENT.DelStuBasis(InXml)
|
|
'OutXml = InvokeSrv("wsENT.DelStuBasis", InXml)
|
|
OutXml = InvokeSrv("SXS.ws_21685.DelStuBasis", InXml)
|
|
|
|
XmlDoc.LoadXml(OutXml)
|
|
If ChkExecutionSuccess(XmlDoc) Then
|
|
If Not blnReLoad Then blnReLoad = True
|
|
Else
|
|
'找出Exception訊並顯示出來
|
|
ExceptionManager.iMESShowDialog(GetExceptionCode(XmlDoc), GetExceptionSysMsg(XmlDoc), GetExceptionStack(XmlDoc))
|
|
Exit For
|
|
End If
|
|
Catch ex As Exception
|
|
'MsgBox("Unexpected Error. Delete failed," & e1.Message, MsgBoxStyle.Exclamation)
|
|
ExceptionManager.iMESShowDialog(defWinErrCode, ex.Message, ex.StackTrace)
|
|
Exit For
|
|
End Try
|
|
Else
|
|
iMESExceptionManager.ExceptionManager.iMESMsgBoxShowDialog(ChgTranslateName_Msg("0000-200021", "[%NOT ALLOWED TO delete%]"), MsgBoxStyle.Exclamation, Me.Text)
|
|
End If
|
|
Next
|
|
|
|
XmlDoc = Nothing
|
|
|
|
If blnReLoad Then
|
|
|
|
Call funLoadStuBasis()
|
|
|
|
Call funShowActiveDetail()
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
Cursor.Current = Cursors.Default
|
|
|
|
End Sub
|
|
|
|
Private Sub btnCopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopy.Click
|
|
|
|
|
|
|
|
If Not Me.iugStuBasis.iMESUltraGrid.ActiveRow Is Nothing Then
|
|
'IsGroupByRow不做任何處理
|
|
If iugStuBasis.iMESUltraGrid.ActiveRow.IsGroupByRow Then
|
|
Exit Sub
|
|
End If
|
|
Dim Rows As DataRow()
|
|
|
|
'找出DataSet中在目前游標列的資料列(DataRow)
|
|
Rows = dsENT.Tables(tblENTStuBasis).Select("StuBasisNo = '" _
|
|
& Replace(Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString, "'", "''") & "'")
|
|
|
|
Dim fStuBasisDef As New frmStuBasisDef
|
|
fStuBasisDef.DefMode = 2
|
|
fStuBasisDef.EditDataRow = Rows(0)
|
|
fStuBasisDef.ShowDialog(Me)
|
|
|
|
If gReturnKeyValue = "" Then Exit Sub
|
|
|
|
StuBasisNo = gReturnKeyValue
|
|
|
|
'重新取出資料
|
|
Call funLoadStuBasis()
|
|
|
|
If GetIssueState() = Issue.Unfrozen Then
|
|
ugrRow = FindRecordPosition(iugStuBasis, "StuBasisNo", StuBasisNo)
|
|
If Not ugrRow Is Nothing Then
|
|
Me.iugStuBasis.iMESUltraGrid.ActiveRow = ugrRow
|
|
Me.iugStuBasis.iMESUltraGrid.ActiveRow.Selected = True
|
|
End If
|
|
End If
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub btnApprove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnApprove.Click
|
|
|
|
|
|
|
|
'1.先檢查是否為單筆,是:將其Selecte
|
|
If Me.iugStuBasis.iMESUltraGrid.ActiveRow Is Nothing Then Exit Sub
|
|
If iugStuBasis.iMESUltraGrid.ActiveRow.IsGroupByRow Then Exit Sub
|
|
Cursor.Current = Cursors.WaitCursor
|
|
If Not Me.iugStuBasis.iMESUltraGrid.ActiveRow.Selected Then
|
|
Me.iugStuBasis.iMESUltraGrid.ActiveRow.Selected = True
|
|
End If
|
|
|
|
'2.Multi
|
|
If Me.iugStuBasis.iMESUltraGrid.Selected.Rows.Count > 0 Then
|
|
If Me.iugStuBasis.iMESUltraGrid.Selected.Rows.Item(0).IsGroupByRow Then
|
|
Exit Sub 'Selected.Rows,不會包含GroupRow & 一般的Row在一起,故若是GroupRow不做任何處理
|
|
End If
|
|
If iMESExceptionManager.ExceptionManager.iMESMsgBoxShowDialog(ChgTranslateName_Msg("0000-100002", "[%ARE YOU SURE TO APPROVE ALL SELECTED RECORDS%]"), MsgBoxStyle.OkCancel + MsgBoxStyle.Question + MsgBoxStyle.DefaultButton2, Me.Text) = MsgBoxResult.Cancel Then
|
|
Exit Sub
|
|
End If
|
|
|
|
'共用資料
|
|
Dim XmlDoc As New XmlDocument
|
|
Dim blnReLoad As Boolean = False
|
|
Dim intIssueState As Integer
|
|
|
|
strIdentity = CombineXMLIdentity(gComputerName, gUserNo, GetNow())
|
|
For i = 0 To Me.iugStuBasis.iMESUltraGrid.Selected.Rows.Count - 1
|
|
intIssueState = Me.iugStuBasis.iMESUltraGrid.Selected.Rows(i).Cells("IssueState").Value
|
|
If intIssueState = 0 Then
|
|
strParameter = CombineXMLParameter("StuBasisNo", "StuBasisNo", "String", CInput(Me.iugStuBasis.iMESUltraGrid.Selected.Rows(i).Cells("StuBasisNo").Value.ToString), "")
|
|
strParameter += CombineXMLParameter("issuestate", "IssueState", "String", intIssueState, "")
|
|
strParameter += CombineXMLParameter("creator", "Creator", "String", gUserNo, "")
|
|
strParameter = strParameter & CombineXMLParameter("datastamp", "DataStamp", "Integer", iugStuBasis.iMESUltraGrid.Selected.Rows(i).Cells("DataStamp").Value, "")
|
|
InXml = CombineXMLRequest(strIdentity, strParameter)
|
|
Try
|
|
' 2016 YF, OutXml = wsENT.ApproveStuBasis(InXml)
|
|
'OutXml = InvokeSrv("wsENT.ApproveStuBasis", InXml)
|
|
OutXml = InvokeSrv("SXS.wsENT.ApproveStuBasis", InXml)
|
|
|
|
XmlDoc.LoadXml(OutXml)
|
|
If ChkExecutionSuccess(XmlDoc) Then
|
|
If Not blnReLoad Then blnReLoad = True
|
|
Else
|
|
'找出Exception訊並顯示出來
|
|
ExceptionManager.iMESShowDialog(GetExceptionCode(XmlDoc), GetExceptionSysMsg(XmlDoc), GetExceptionStack(XmlDoc))
|
|
Exit For
|
|
End If
|
|
Catch ex As Exception
|
|
'MsgBox("Unexpected Error. Approve failed," & e1.Message, MsgBoxStyle.Exclamation)
|
|
ExceptionManager.iMESShowDialog(defWinErrCode, ex.Message, ex.StackTrace)
|
|
Exit For
|
|
End Try
|
|
Else
|
|
iMESExceptionManager.ExceptionManager.iMESMsgBoxShowDialog(ChgTranslateName_Msg("0000-200021", "[%NOT ALLOW TO APPROVE%]"), MsgBoxStyle.Exclamation, Me.Text)
|
|
End If
|
|
Next
|
|
|
|
XmlDoc = Nothing
|
|
|
|
If blnReLoad Then
|
|
|
|
Call funLoadStuBasis()
|
|
|
|
Call funShowActiveDetail()
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
Cursor.Current = Cursors.Default
|
|
|
|
End Sub
|
|
|
|
Private Sub btnDAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDAdd.Click
|
|
|
|
If Not Me.iugStuBasis.iMESUltraGrid.ActiveRow Is Nothing Then
|
|
|
|
'Dim Rows As DataRow()
|
|
Dim fStuBasisContDef As New frmStuBasisContDef
|
|
|
|
fStuBasisContDef.DefMode = 0
|
|
fStuBasisContDef.StuBasisNo = Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString
|
|
fStuBasisContDef.ShowDialog(Me)
|
|
|
|
If gReturnKeyValue = "" Then Exit Sub
|
|
|
|
ContactorName = gReturnKeyValue
|
|
|
|
'重新取出資料
|
|
Call funLoadStuBasisCont(Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString)
|
|
|
|
ugrRow = FindRecordPosition(iugDetail, "ContactorName", ContactorName)
|
|
If Not ugrRow Is Nothing Then
|
|
Me.iugDetail.iMESUltraGrid.ActiveRow = ugrRow
|
|
Me.iugDetail.iMESUltraGrid.ActiveRow.Selected = True
|
|
End If
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub btnDEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDEdit.Click
|
|
|
|
If Not Me.iugStuBasis.iMESUltraGrid.ActiveRow Is Nothing And Not Me.iugDetail.iMESUltraGrid.ActiveRow Is Nothing Then
|
|
If iugStuBasis.iMESUltraGrid.ActiveRow.IsGroupByRow OrElse iugDetail.iMESUltraGrid.ActiveRow.IsGroupByRow Then Exit Sub
|
|
Dim Rows As DataRow()
|
|
|
|
'找出DataSet中在目前游標列的資料列(DataRow)
|
|
Rows = dsENT.Tables(tblENTStuBasisCont).Select("StuBasisNo = '" _
|
|
& Replace(Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString, "'", "''") & "'" _
|
|
& " And ContactorName = '" & Replace(Me.iugDetail.iMESUltraGrid.ActiveRow.Cells("ContactorName").Value.ToString, "'", "''") & "'")
|
|
|
|
Dim fStuBasisContDef As New frmStuBasisContDef
|
|
fStuBasisContDef.DefMode = 1
|
|
fStuBasisContDef.EditDataRow = Rows(0)
|
|
fStuBasisContDef.StuBasisNo = Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString
|
|
fStuBasisContDef.ShowDialog(Me)
|
|
|
|
If gReturnKeyValue = "" Then Exit Sub
|
|
|
|
ContactorName = gReturnKeyValue
|
|
|
|
'重新取出資料
|
|
Call funLoadStuBasisCont(Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString)
|
|
|
|
ugrRow = FindRecordPosition(iugDetail, "ContactorName", ContactorName)
|
|
If Not ugrRow Is Nothing Then
|
|
Me.iugDetail.iMESUltraGrid.ActiveRow = ugrRow
|
|
Me.iugDetail.iMESUltraGrid.ActiveRow.Selected = True
|
|
End If
|
|
Else
|
|
|
|
Exit Sub
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub btnDDel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDDel.Click
|
|
|
|
|
|
'1.先檢查是否為單筆,是:將其Selecte
|
|
If Me.iugDetail.iMESUltraGrid.ActiveRow Is Nothing Then Exit Sub
|
|
If iugDetail.iMESUltraGrid.ActiveRow.IsGroupByRow Then Exit Sub
|
|
|
|
Cursor.Current = Cursors.WaitCursor
|
|
|
|
If Not Me.iugDetail.iMESUltraGrid.ActiveRow.Selected Then
|
|
Me.iugDetail.iMESUltraGrid.ActiveRow.Selected = True
|
|
End If
|
|
|
|
'2.Multi
|
|
If Me.iugDetail.iMESUltraGrid.Selected.Rows.Count > 0 Then
|
|
If Me.iugDetail.iMESUltraGrid.Selected.Rows.Item(0).IsGroupByRow Then
|
|
Exit Sub 'Selected.Rows,不會包含GroupRow & 一般的Row在一起,故若是GroupRow不做任何處理
|
|
End If
|
|
If iMESExceptionManager.ExceptionManager.iMESMsgBoxShowDialog(ChgTranslateName_Msg("0000-100001", "[%ARE YOU SURE TO DELETE ALL SELECTED RECORDS%]"), MsgBoxStyle.OkCancel + MsgBoxStyle.Question + MsgBoxStyle.DefaultButton2, Me.Text) = MsgBoxResult.Cancel Then
|
|
Exit Sub
|
|
End If
|
|
|
|
'共用資料
|
|
Dim XmlDoc As New XmlDocument
|
|
Dim blnReLoad As Boolean = False
|
|
Dim intIssueState As Integer
|
|
|
|
strIdentity = CombineXMLIdentity(gComputerName, gUserNo, GetNow())
|
|
For i = 0 To Me.iugDetail.iMESUltraGrid.Selected.Rows.Count - 1
|
|
strParameter = CombineXMLParameter("StuBasisNo", "StuBasisNo", "String", CInput(Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString), "")
|
|
strParameter = strParameter & CombineXMLParameter("ContactorName", "ContactorName", "String", CInput(Me.iugDetail.iMESUltraGrid.Selected.Rows(i).Cells("ContactorName").Value.ToString), "")
|
|
InXml = CombineXMLRequest(strIdentity, strParameter)
|
|
Try
|
|
' 2016 YF, OutXml = wsENT.DelStuBasisCont(InXml)
|
|
'OutXml = InvokeSrv("wsENT.DelStuBasisCont", InXml)
|
|
OutXml = InvokeSrv("SXS.wsENT.DelStuBasisCont", InXml)
|
|
|
|
XmlDoc.LoadXml(OutXml)
|
|
If ChkExecutionSuccess(XmlDoc) Then
|
|
If Not blnReLoad Then blnReLoad = True
|
|
Else
|
|
'找出Exception訊並顯示出來
|
|
ExceptionManager.iMESShowDialog(GetExceptionCode(XmlDoc), GetExceptionSysMsg(XmlDoc), GetExceptionStack(XmlDoc))
|
|
Exit For
|
|
End If
|
|
Catch ex As Exception
|
|
'MsgBox("Unexpected Error. Delete failed," & e1.Message, MsgBoxStyle.Exclamation)
|
|
ExceptionManager.iMESShowDialog(defWinErrCode, ex.Message, ex.StackTrace)
|
|
Exit For
|
|
End Try
|
|
|
|
Next
|
|
|
|
XmlDoc = Nothing
|
|
|
|
If blnReLoad Then Call funLoadStuBasisCont(Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString)
|
|
|
|
End If
|
|
|
|
Cursor.Current = Cursors.Default
|
|
|
|
End Sub
|
|
|
|
Private Sub btnDCopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDCopy.Click
|
|
|
|
If Not Me.iugStuBasis.iMESUltraGrid.ActiveRow Is Nothing And Not Me.iugDetail.iMESUltraGrid.ActiveRow Is Nothing Then
|
|
If iugStuBasis.iMESUltraGrid.ActiveRow.IsGroupByRow OrElse iugDetail.iMESUltraGrid.ActiveRow.IsGroupByRow Then Exit Sub
|
|
Dim Rows As DataRow()
|
|
|
|
'找出DataSet中在目前游標列的資料列(DataRow)
|
|
Rows = dsENT.Tables(tblENTStuBasisCont).Select("StuBasisNo = '" _
|
|
& Replace(Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString, "'", "''") & "'" _
|
|
& " And ContactorName = '" & Replace(Me.iugDetail.iMESUltraGrid.ActiveRow.Cells("ContactorName").Value.ToString, "'", "''") & "'")
|
|
|
|
Dim fStuBasisContDef As New frmStuBasisContDef
|
|
fStuBasisContDef.DefMode = 2
|
|
fStuBasisContDef.EditDataRow = Rows(0)
|
|
fStuBasisContDef.StuBasisNo = Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString
|
|
fStuBasisContDef.ShowDialog(Me)
|
|
|
|
If gReturnKeyValue = "" Then Exit Sub
|
|
|
|
ContactorName = gReturnKeyValue
|
|
|
|
'重新取出資料
|
|
Call funLoadStuBasisCont(Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString)
|
|
|
|
ugrRow = FindRecordPosition(iugDetail, "ContactorName", ContactorName)
|
|
If Not ugrRow Is Nothing Then
|
|
Me.iugDetail.iMESUltraGrid.ActiveRow = ugrRow
|
|
Me.iugDetail.iMESUltraGrid.ActiveRow.Selected = True
|
|
End If
|
|
Else
|
|
|
|
Exit Sub
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub btnEMail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEMail.Click
|
|
|
|
If Not Me.iugDetail.iMESUltraGrid.ActiveRow Is Nothing Then
|
|
If iugDetail.iMESUltraGrid.ActiveRow.IsGroupByRow Then Exit Sub
|
|
Dim Rows As DataRow()
|
|
Dim proMail As New System.Diagnostics.Process
|
|
Dim strAccount As String
|
|
|
|
Rows = dsENT.Tables(tblENTStuBasisCont).Select("StuBasisNo = '" _
|
|
& Replace(Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString, "'", "''") & "'" _
|
|
& " And ContactorName = '" & Replace(Me.iugDetail.iMESUltraGrid.ActiveRow.Cells("ContactorName").Value.ToString, "'", "''") & "'")
|
|
|
|
strAccount = "mailto:" & Rows(0).Item("EMail").ToString
|
|
proMail.Start(strAccount)
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
|
|
Me.Close()
|
|
End Sub
|
|
|
|
Protected Overrides Sub btnQuery_Click(sender As Object, e As EventArgs)
|
|
Cursor.Current = Cursors.WaitCursor
|
|
|
|
funLoadStuBasis()
|
|
|
|
Cursor.Current = Cursors.Default
|
|
End Sub
|
|
|
|
#Region "Ultra Grid"
|
|
|
|
Private Sub iugStuBasis_iMESUltraGrid_InitializeLayOut(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles iugStuBasis.iMESUltraGrid_InitializeLayOut
|
|
|
|
With e.Layout
|
|
With .Bands(0).Columns("StuBasisNo")
|
|
.Header.Caption = "StuBasisNo"
|
|
.Width = 110
|
|
.Hidden = False
|
|
.Header.VisiblePosition = 0
|
|
End With
|
|
With .Bands(0).Columns("StuBasisName")
|
|
.Header.Caption = "StuBasisName"
|
|
.Width = 110
|
|
.Hidden = False
|
|
.CellMultiLine = DefaultableBoolean.True
|
|
.Header.VisiblePosition = 1
|
|
End With
|
|
With .Bands(0).Columns("Sex")
|
|
.Header.Caption = "Sex"
|
|
.Width = 110
|
|
.Hidden = False
|
|
.CellMultiLine = DefaultableBoolean.True
|
|
.Header.VisiblePosition = 2
|
|
End With
|
|
|
|
End With
|
|
|
|
'語系切換
|
|
Call ExeChangeResource(Me, gLanguageMode)
|
|
End Sub
|
|
|
|
Private Sub iugStuBasis_iMESUltraGrid_AfterRowActivate(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles iugStuBasis.iMESUltraGrid_AfterRowActivate
|
|
|
|
'IsGroupByRow不做任何處理
|
|
'If Not iugStuBasis.iMESUltraGrid.ActiveRow.IsGroupByRow Then
|
|
'Call funLoadStuBasisCont(Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString)
|
|
'Else
|
|
'Exit Sub
|
|
'End If
|
|
|
|
End Sub
|
|
|
|
Private Sub iugDetail_iMESUltraGrid_InitializeLayOut(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles iugDetail.iMESUltraGrid_InitializeLayOut
|
|
|
|
With e.Layout
|
|
With .Bands(0).Columns("StuBasisNo")
|
|
.Header.Caption = "StuBasisNo"
|
|
.Width = 110
|
|
.Hidden = False
|
|
.Header.VisiblePosition = 0
|
|
End With
|
|
With .Bands(0).Columns("TeacherName")
|
|
.Header.Caption = "TeacherName"
|
|
.Width = 110
|
|
.Hidden = False
|
|
.Header.VisiblePosition = 1
|
|
End With
|
|
With .Bands(0).Columns("TelNo")
|
|
.Header.Caption = "TelNo"
|
|
.Width = 110
|
|
.Hidden = False
|
|
.Header.VisiblePosition = 2
|
|
End With
|
|
With .Bands(0).Columns("Description")
|
|
.Header.Caption = "Description"
|
|
.Width = 200
|
|
.Hidden = False
|
|
.CellMultiLine = DefaultableBoolean.True
|
|
.Header.VisiblePosition = 3
|
|
End With
|
|
With .Bands(0).Columns("Creator")
|
|
.Header.Caption = "Creator"
|
|
.Width = 80
|
|
.Hidden = False
|
|
.Header.VisiblePosition = 4
|
|
End With
|
|
With .Bands(0).Columns("CreateDate")
|
|
.Header.Caption = "CreateDate"
|
|
.Width = 150
|
|
.Format = "yyyy/MM/dd HH:mm:ss"
|
|
.Hidden = False
|
|
.Header.VisiblePosition = 5
|
|
End With
|
|
With .Bands(0).Columns("Reviser")
|
|
.Header.Caption = "Reviser"
|
|
.Width = 80
|
|
.Hidden = False
|
|
.Header.VisiblePosition = 6
|
|
End With
|
|
With .Bands(0).Columns("ReviseDate")
|
|
.Header.Caption = "ReviseDate"
|
|
.Width = 150
|
|
.Format = "yyyy/MM/dd HH:mm:ss"
|
|
.Hidden = False
|
|
.Header.VisiblePosition = 7
|
|
End With
|
|
With e.Layout.Bands(0).Columns("DataStamp")
|
|
.Hidden = True
|
|
End With
|
|
End With
|
|
|
|
'語系切換
|
|
Call ExeChangeResource(Me, gLanguageMode)
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "Load Function"
|
|
|
|
'//取出tblENTStuBasis 外包商資料
|
|
|
|
Private Sub funLoadStuBasis()
|
|
|
|
'先判斷是否dataset中已有ENTStuBasis之datatable,若有,需先remove否則會有錯誤
|
|
If Not IsNothing(dsENT.Tables(tblENTStuBasis)) Then
|
|
dsENT.Tables.Remove(tblENTStuBasis)
|
|
End If
|
|
|
|
'組InXml的字串
|
|
strIdentity = CombineXMLIdentity(gComputerName, gUserNo, GetNow())
|
|
'加上IssueState要求取出所有資料
|
|
strParameter = CombineXMLParameter("issuestate", "IssueState", "Integer", defInteger, "")
|
|
'加上查詢條件 cboSearchFieldName,txtSearchFieldValue
|
|
strParameter += CombineXMLQueryCondition()
|
|
InXml = CombineXMLRequest(strIdentity, strParameter)
|
|
|
|
Try
|
|
' 2016 YF, OutXml = wsENT.LoadStuBasis(InXml)
|
|
'OutXml = InvokeSrv("wsENT.LoadStuBasis", InXml)
|
|
OutXml = InvokeSrv("SXS.ws_21685.LoadStuBasis", InXml)
|
|
|
|
Dim XmlDoc As New XmlDocument '處理Xml字串之物件?
|
|
|
|
'利用XmlDoc物件處理ReturnValue
|
|
XmlDoc.LoadXml(OutXml)
|
|
|
|
If ChkExecutionSuccess(XmlDoc) Then
|
|
'讀取取出資料表之名稱
|
|
|
|
tblENTStuBasis = XmlDoc.GetElementsByTagName("returnvalue").Item(0).SelectNodes("loadStuBasis").Item(0).SelectNodes("name").Item(0).InnerXml
|
|
'取出Schema,dataset讀取Schema可防止Null Field及DateTime的問題
|
|
|
|
XmlSchema = XmlDoc.DocumentElement.GetElementsByTagName("loadStuBasis").Item(0).SelectNodes("schema").Item(0).InnerXml
|
|
If XmlSchema <> "" Then
|
|
'將XML讀入String Reader object中,因為Dataset讀入XML時必須透過String Reader物件
|
|
tmpStringReader = New System.IO.StringReader(XmlSchema)
|
|
dsENT.ReadXmlSchema(tmpStringReader)
|
|
tmpStringReader.Close()
|
|
End If
|
|
|
|
'取出Data
|
|
XmlData = XmlDoc.DocumentElement.GetElementsByTagName("loadStuBasis").Item(0).SelectNodes("value").Item(0).InnerXml
|
|
If XmlData <> "" Then
|
|
tmpStringReader = New System.IO.StringReader(XmlData)
|
|
dsENT.ReadXml(tmpStringReader, XmlReadMode.InferSchema)
|
|
tmpStringReader.Close()
|
|
End If
|
|
|
|
strFilter = ""
|
|
Select Case GetIssueState()
|
|
Case Issue.Unfrozen
|
|
strFilter = FilterByInteger(strFilter, "IssueState", 0)
|
|
Case Issue.Pending
|
|
strFilter = FilterByInteger(strFilter, "IssueState", 1)
|
|
Case Issue.Active
|
|
strFilter = FilterByInteger(strFilter, "IssueState", 2)
|
|
Case Issue.Unused
|
|
strFilter = FilterByInteger(strFilter, "IssueState", -1)
|
|
End Select
|
|
|
|
dsENT.Tables(tblENTStuBasis).DefaultView.RowFilter = strFilter
|
|
dsENT.Tables(tblENTStuBasis).DefaultView.Sort = "StuBasisNo"
|
|
|
|
Me.iugStuBasis.iMESUltraGrid.DataSource = dsENT.Tables(tblENTStuBasis).DefaultView
|
|
|
|
Else
|
|
ExceptionManager.iMESShowDialog(GetExceptionCode(XmlDoc), GetExceptionSysMsg(XmlDoc), GetExceptionStack(XmlDoc))
|
|
Exit Sub
|
|
End If
|
|
|
|
XmlDoc = Nothing
|
|
|
|
Catch ex As Exception
|
|
'MsgBox("Unexpected Error. Load ENT StuBasis Failed!!," & e1.Message, MsgBoxStyle.Exclamation)
|
|
ExceptionManager.iMESShowDialog(defWinErrCode, ex.Message, ex.StackTrace)
|
|
End Try
|
|
|
|
End Sub
|
|
|
|
'//取出tblENTStuBasisCont聯絡人資料
|
|
|
|
Private Sub funLoadStuBasisCont(ByRef StuBasisNo As String)
|
|
|
|
If Not IsNothing(dsENT.Tables(tblENTStuBasisCont)) Then
|
|
dsENT.Tables.Remove(tblENTStuBasisCont)
|
|
End If
|
|
|
|
'組InXml的字串
|
|
strIdentity = CombineXMLIdentity(gComputerName, gUserNo, GetNow())
|
|
strParameter = CombineXMLParameter("StuBasisNo", "StuBasisNo", "String", StuBasisNo, "")
|
|
InXml = CombineXMLRequest(strIdentity, strParameter)
|
|
|
|
Try
|
|
' 2016 YF, OutXml = wsENT.LoadStuBasisCont(InXml)
|
|
'OutXml = InvokeSrv("wsENT.LoadStuBasisCont", InXml)
|
|
OutXml = InvokeSrv("SXS.ws_21685.LoadStuBasisCont", InXml)
|
|
|
|
Dim XmlDoc As New XmlDocument '處理Xml字串之物件?
|
|
|
|
'利用XmlDoc物件處理ReturnValue
|
|
XmlDoc.LoadXml(OutXml)
|
|
If ChkExecutionSuccess(XmlDoc) Then
|
|
'讀取取出資料表之名稱
|
|
|
|
tblENTStuBasisCont = XmlDoc.GetElementsByTagName("returnvalue").Item(0).SelectNodes("loadStuBasiscont").Item(0).SelectNodes("name").Item(0).InnerXml
|
|
'取出Schema,dataset讀取Schema可防止Null Field及DateTime的問題
|
|
XmlSchema = XmlDoc.DocumentElement.GetElementsByTagName("loadStuBasiscont").Item(0).SelectNodes("schema").Item(0).InnerXml
|
|
If XmlSchema <> "" Then
|
|
'將XML讀入String Reader object中,因為Dataset讀入XML時必須透過String Reader物件
|
|
tmpStringReader = New System.IO.StringReader(XmlSchema)
|
|
dsENT.ReadXmlSchema(tmpStringReader)
|
|
tmpStringReader.Close()
|
|
End If
|
|
|
|
'取出Data
|
|
XmlData = XmlDoc.DocumentElement.GetElementsByTagName("loadStuBasiscont").Item(0).SelectNodes("value").Item(0).InnerXml
|
|
If XmlData <> "" Then
|
|
tmpStringReader = New System.IO.StringReader(XmlData)
|
|
dsENT.ReadXml(tmpStringReader, XmlReadMode.InferSchema)
|
|
tmpStringReader.Close()
|
|
End If
|
|
|
|
Me.iugDetail.iMESUltraGrid.DataSource = dsENT.Tables(tblENTStuBasisCont).DefaultView
|
|
|
|
Else
|
|
ExceptionManager.iMESShowDialog(GetExceptionCode(XmlDoc), GetExceptionSysMsg(XmlDoc), GetExceptionStack(XmlDoc))
|
|
End If
|
|
|
|
XmlDoc = Nothing
|
|
|
|
Catch ex As Exception
|
|
'MsgBox("Unexpected Error. Load ENT StuBasis Cont Failed!!," & e1.Message, MsgBoxStyle.Exclamation)
|
|
ExceptionManager.iMESShowDialog(defWinErrCode, ex.Message, ex.StackTrace)
|
|
End Try
|
|
|
|
End Sub
|
|
|
|
Private Sub funShowActiveDetail()
|
|
|
|
If Me.iugStuBasis.iMESUltraGrid.ActiveRow Is Nothing Then
|
|
Me.iugDetail.iMESUltraGrid.DataSource = Nothing
|
|
Else
|
|
Call funLoadStuBasisCont(Me.iugStuBasis.iMESUltraGrid.ActiveRow.Cells("StuBasisNo").Value.ToString)
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub funiMESUltraGridIni()
|
|
|
|
'iugStuBasis 初始設定
|
|
With Me.iugStuBasis.iMESUltraGrid
|
|
.Text = ""
|
|
.DisplayLayout.GroupByBox.Hidden = True
|
|
.DisplayLayout.UseFixedHeaders = False
|
|
End With
|
|
|
|
'系統會以UserNo做為Layout的檔名
|
|
|
|
iugStuBasis.UserNo = gUserNo
|
|
|
|
'iugDetail 初始設定
|
|
With Me.iugDetail.iMESUltraGrid.DisplayLayout
|
|
.GroupByBox.Hidden = True
|
|
.Override.ExpansionIndicator = ShowExpansionIndicator.Default
|
|
.ViewStyle = ViewStyle.SingleBand
|
|
.RowConnectorStyle = RowConnectorStyle.Default
|
|
|
|
End With
|
|
|
|
'系統會以UserNo做為Layout的檔名
|
|
|
|
iugDetail.UserNo = gUserNo
|
|
|
|
End Sub
|
|
|
|
Private Sub iugStuBasis_Load(sender As Object, e As EventArgs) Handles iugStuBasis.Load
|
|
|
|
End Sub
|
|
|
|
|
|
#End Region
|
|
|
|
End Class
|
|
|