Public Class DataTransactionForm
#Region "Events"
Private _sqlDBTrans As Kemet.Never.DA.DBTransaction
Private _BL As Kemet.Never.BL.Query
Public mCtlCfg As Kemet.Never.App.ctlConfiguration
Private Sub DataTransactionForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim DBInstranceName = "LDBYYQ3R1\MYSQLTEST"
_sqlDBTrans = New Kemet.Never.DA.DBTransaction("", Configuration.ConfigurationSettings.AppSettings.Get("SQLConnectionString").Replace("[SQLINSTANCE]", DBInstranceName))
_BL = New Kemet.Never.BL.Query(_sqlDBTrans)
With Me.TabControl1
' If .SelectedTab Is Me.TabPage3 Then
If mCtlCfg Is Nothing Then
mCtlCfg = New Kemet.Never.App.ctlConfiguration()
End If
.TabPages("TabPage3").Controls.Add(mCtlCfg)
mCtlCfg.Focus()
mCtlCfg.Dock = DockStyle.Fill
' End If
End With
Catch ex As Exception
End Try
Me.ReportViewer1.RefreshReport()
End Sub
Private Sub ButtonGetData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetData.Click
Dim Jobname = "254645"
Dim job As New Kemet.Never.BL.Query.Job
job = _BL.GetJobInfo(Jobname)
With job
Label1.Text = .jobName
Label2.Text = .PartNumber
Label3.Text = .Routing
End With
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim returnv As String = ""
_BL.UpdateJobStaus("254645", returnv)
Dim test As String = returnv
Catch ex As Exception
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Try
Dim jobname As String = "254645"
_BL.RemoveJob(jobname, "ps")
Catch ex As Exception
End Try
End Sub
#End Region
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim myservice As New ServiceReference1.ServiceSoapClient
Dim r As New ServiceReference1.re
Dim jobDS As New DataSet
Dim con As String = "Data Source=LDBYYQ3R1\MYSQLTEST; Initial Catalog=MES_TRANS_MCD; User ID=sa; PassWord=admin; Persist Security Info=False;"
r.connec = con
jobDS = myservice.Binding(r)
DataGridView1.DataSource = jobDS.Tables(0)
DataGridView1.Enabled = True
'Dim jobDataSet As New DataSet
'jobDataSet = _BL.GetJobInfo(TextBoxPN.Text)
'TextBoxRouting.Text = jobDataSet.Tables(0).Rows(0)("routing").ToString()
'DataGridView1.DataSource = jobDataSet.Tables(0)
'DataGridView1.Enabled = True
jobDS = Bindings()
DataGridView2.DataSource = jobDS.Tables(0)
DataGridView2.Enabled = True
End Sub
Public Function Bindings() As DataSet
Dim _connectionString As String = "Data Source=LDBYYQ3R1\MYSQLTEST; Initial Catalog=MES_TRANS_MCD; User ID=sa; PassWord=admin; Persist Security Info=False;"
_sqlDBTrans = New Kemet.Never.DA.DBTransaction("", _connectionString)
_BL = New Kemet.Never.BL.Query(_sqlDBTrans)
Dim resultDS As New DataSet
Try
resultDS = _BL.GetJobInfo2("FPI162236TMW3N")
Return resultDS
Catch ex As Exception
Throw ex
End Try
End Function
Private Sub IniReport()
Dim ReportUsers As String = ""
Dim PW As String = ""
Dim ReportDomain As String = ""
Dim reportServer As String = ""
Dim reportFolder As String = "'"
ReportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote
'Dim credential As New System.Net.NetworkCredential(ReportUsers, PW, ReportDomain)
' ReportViewer1.ServerReport.ReportServerCredentials = credential
ReportViewer1.ServerReport.ReportServerUrl = New Uri(reportServer)
ReportViewer1.ServerReport.ReportPath = reportFolder
End Sub
Protected Sub tabContorl_SelectIndexChanged(ByVal sender As System.Object, ByVal e As EventArgs) Handles TabControl1.SelectedIndexChanged
SetUpTagview()
End Sub
Private Sub SetUpTagview()
With Me.TabControl1
' If .SelectedTab Is Me.TabPage3 Then
If mCtlCfg Is Nothing Then
mCtlCfg = New Kemet.Never.App.ctlConfiguration()
End If
.TabPages("TabPage3").Controls.Add(mCtlCfg)
mCtlCfg.Focus()
mCtlCfg.Dock = DockStyle.Fill
' End If
End With
End Sub
End Class