Imports System.Text Public Class CharRestraint Inherits System.Windows.Forms.Form #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 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents txtSearchID As System.Windows.Forms.TextBox Friend WithEvents btnSearch As System.Windows.Forms.Button Friend WithEvents cboServerID As System.Windows.Forms.ComboBox Friend WithEvents grdResult As System.Windows.Forms.DataGrid Friend WithEvents btnReg As System.Windows.Forms.Button Friend WithEvents cboType As System.Windows.Forms.ComboBox Friend WithEvents btnBlockClose As System.Windows.Forms.Button Friend WithEvents lblsearchwide As System.Windows.Forms.Label Friend WithEvents lbluid As System.Windows.Forms.Label Friend WithEvents lblserver As System.Windows.Forms.Label Friend WithEvents lbltitle As System.Windows.Forms.Label Private Sub InitializeComponent() Me.lbltitle = New System.Windows.Forms.Label() Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.cboType = New System.Windows.Forms.ComboBox() Me.lblsearchwide = New System.Windows.Forms.Label() Me.lbluid = New System.Windows.Forms.Label() Me.lblserver = New System.Windows.Forms.Label() Me.btnSearch = New System.Windows.Forms.Button() Me.txtSearchID = New System.Windows.Forms.TextBox() Me.cboServerID = New System.Windows.Forms.ComboBox() Me.grdResult = New System.Windows.Forms.DataGrid() Me.btnReg = New System.Windows.Forms.Button() Me.btnBlockClose = New System.Windows.Forms.Button() Me.GroupBox1.SuspendLayout() CType(Me.grdResult, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'lbltitle ' Me.lbltitle.AutoSize = True Me.lbltitle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lbltitle.Font = New System.Drawing.Font("GulimChe", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(129, Byte)) Me.lbltitle.Location = New System.Drawing.Point(440, 56) Me.lbltitle.Name = "lbltitle" Me.lbltitle.Size = New System.Drawing.Size(128, 24) Me.lbltitle.TabIndex = 1 Me.lbltitle.Text = "ij¸¯ÅÍ Á¦Àç " ' 'GroupBox1 ' Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.cboType, Me.lblsearchwide, Me.lbluid, Me.lblserver, Me.btnSearch, Me.txtSearchID, Me.cboServerID}) Me.GroupBox1.Location = New System.Drawing.Point(48, 96) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(576, 80) Me.GroupBox1.TabIndex = 2 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Á¦ÀçµÈ ij¸¯ÅÍ Á¶È¸Çϱâ" ' 'cboType ' Me.cboType.Location = New System.Drawing.Point(336, 24) Me.cboType.Name = "cboType" Me.cboType.Size = New System.Drawing.Size(112, 20) Me.cboType.TabIndex = 12 ' 'lblsearchwide ' Me.lblsearchwide.AutoSize = True Me.lblsearchwide.Location = New System.Drawing.Point(248, 28) Me.lblsearchwide.Name = "lblsearchwide" Me.lblsearchwide.Size = New System.Drawing.Size(79, 14) Me.lblsearchwide.TabIndex = 11 Me.lblsearchwide.Text = "Á¶È¸¹üÀ§¼±ÅÃ" ' 'lbluid ' Me.lbluid.AutoSize = True Me.lbluid.Location = New System.Drawing.Point(16, 52) Me.lbluid.Name = "lbluid" Me.lbluid.Size = New System.Drawing.Size(97, 14) Me.lbluid.TabIndex = 8 Me.lbluid.Text = "UID(À¯ÀúÀ妽º)" ' 'lblserver ' Me.lblserver.AutoSize = True Me.lblserver.Location = New System.Drawing.Point(56, 29) Me.lblserver.Name = "lblserver" Me.lblserver.Size = New System.Drawing.Size(54, 14) Me.lblserver.TabIndex = 6 Me.lblserver.Text = "¼­¹ö¼±ÅÃ" ' 'btnSearch ' Me.btnSearch.Location = New System.Drawing.Point(456, 24) Me.btnSearch.Name = "btnSearch" Me.btnSearch.Size = New System.Drawing.Size(96, 40) Me.btnSearch.TabIndex = 4 Me.btnSearch.Text = "°Ë»ö" ' 'txtSearchID ' Me.txtSearchID.Location = New System.Drawing.Point(120, 48) Me.txtSearchID.Name = "txtSearchID" Me.txtSearchID.Size = New System.Drawing.Size(112, 21) Me.txtSearchID.TabIndex = 3 Me.txtSearchID.Text = "" ' 'cboServerID ' Me.cboServerID.Location = New System.Drawing.Point(120, 24) Me.cboServerID.Name = "cboServerID" Me.cboServerID.Size = New System.Drawing.Size(112, 20) Me.cboServerID.TabIndex = 1 ' 'grdResult ' Me.grdResult.DataMember = "" Me.grdResult.HeaderForeColor = System.Drawing.SystemColors.ControlText Me.grdResult.Location = New System.Drawing.Point(48, 184) Me.grdResult.Name = "grdResult" Me.grdResult.Size = New System.Drawing.Size(904, 336) Me.grdResult.TabIndex = 3 ' 'btnReg ' Me.btnReg.Location = New System.Drawing.Point(648, 120) Me.btnReg.Name = "btnReg" Me.btnReg.Size = New System.Drawing.Size(80, 48) Me.btnReg.TabIndex = 4 Me.btnReg.Text = "Á¦Àçµî·Ï" ' 'btnBlockClose ' Me.btnBlockClose.Location = New System.Drawing.Point(768, 120) Me.btnBlockClose.Name = "btnBlockClose" Me.btnBlockClose.Size = New System.Drawing.Size(80, 48) Me.btnBlockClose.TabIndex = 5 Me.btnBlockClose.Text = "Á¦ÀçÇØÁ¦" ' 'CharRestraint ' Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14) Me.ClientSize = New System.Drawing.Size(1028, 701) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnBlockClose, Me.btnReg, Me.grdResult, Me.GroupBox1, Me.lbltitle}) Me.Name = "CharRestraint" Me.Text = "ij¸¯ÅÍÁ¦Àç" Me.GroupBox1.ResumeLayout(False) CType(Me.grdResult, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub #End Region Private Sub CharRestraint_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ProcessPacket.ICharRestraint = Me DBConn.SetServerNames(cboServerID) cboServerID.SelectedIndex = 0 txtSearchID.Visible = False lbluid.Visible = False txtSearchID.Visible = False Me.Text = ITextCharRestraint.formheader lbltitle.Text = ITextCharRestraint.formheader lblserver.Text = ITextCharRestraint.lblserver lblsearchwide.Text = ITextCharRestraint.lblsearchwide Me.lbluid.Text = ITextCharRestraint.lbluid btnSearch.Text = ITextButton.btnSearch btnReg.Text = ITextAdminSetting.chkRestraintReg Me.btnBlockClose.Text = ITextAdminSetting.chkRestraintRelease cboType.Items.Add(ITextCharRestraint.cboType_1) cboType.Items.Add(ITextCharRestraint.cboType_2) cboType.SelectedIndex = 0 grdResult.DataSource = ds.Tables(CharRestraintIndex) If IToolAdminRight.RestraintReg = False Then btnReg.Enabled = False Else btnReg.Enabled = True End If If IToolAdminRight.RestraintRelease = False Then btnBlockClose.Enabled = False Else btnBlockClose.Enabled = True End If End Sub Private Sub CharRestraint_UnLoad(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Closed ProcessPacket.ICharRestraint = Nothing ProcessPacket.IRylMDI.ICharRestraint = Nothing End Sub 'searching ... Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click If cboType.SelectedIndex = 1 And txtSearchID.Text = "" Then MsgBox(ITextMSG.msg_inputadminid, MsgBoxStyle.OKOnly, ITextMSG.msg_error) txtSearchID.Focus() Exit Sub End If ViewRestraintList() End Sub Public Sub ViewRestraintList() ds.Tables(CharRestraintIndex).Clear() Dim serverid As Byte Select Case cboServerID.SelectedIndex Case 0 serverid = 0 Case 1 serverid = 1 Case 2 serverid = 2 Case 3 serverid = 3 Case 4 serverid = 4 Case 5 serverid = 5 Case 6 serverid = 6 End Select If cboType.SelectedIndex = 0 Then ' ÀçÁ¦ °Ë»ö ' Flag(1) / ServerID(1) / UID(4) Dim sendb(5) As Byte sendb(0) = 1 ' Flag sendb(1) = serverid ' ServerID Dim dwUID As Int32 = 0 ' UID Array.Copy(BitConverter.GetBytes(dwUID), 0, sendb, 2, 4) IClientSocket.Send(9, sendb) Else 'ºÎºÐ°Ë»ö ' ÀçÁ¦ °Ë»ö ' Flag(1) / ServerID(1) / UID(4) Dim sendb(5) As Byte sendb(0) = 2 ' Flag sendb(1) = serverid ' ServerID Dim dwUID As Int32 = CInt(txtSearchID.Text) ' UID Array.Copy(BitConverter.GetBytes(dwUID), 0, sendb, 2, 4) IClientSocket.Send(9, sendb) End If End Sub Private Sub btnReg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReg.Click Dim ICharRestraintReg As New CharRestraintReg() ICharRestraintReg.ShowDialog() End Sub Private Sub cboType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboType.SelectedIndexChanged If cboType.SelectedIndex = 1 Then lbluid.Visible = True txtSearchID.Visible = True Else lbluid.Visible = False txtSearchID.Visible = False End If End Sub 'Á¦ÀçÇØÁ¦ Private Sub btnBlockClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBlockClose.Click 'ÇöÀç Ŭ¸¯µÈ rowÀÇ À妽º¹øÈ£(0ºÎÅÍ ½ÃÀÛÇÑ´Ù.) Dim SelectedCellText As String = grdResult.Item(grdResult.CurrentCell) Dim CurrentIndex As Integer = grdResult.CurrentRowIndex Dim encoding As Encoding = encoding.GetEncoding(Code) Dim serverid As Byte Select Case cboServerID.SelectedIndex Case 0 serverid = 0 Case 1 serverid = 1 Case 2 serverid = 2 Case 3 serverid = 3 Case 4 serverid = 4 Case 5 serverid = 5 Case 6 serverid = 6 End Select ' Á¦Àç »èÁ¦ ' ServerID(1) / UID(4) / CharName(16) Dim sendb(20) As Byte sendb(0) = serverid ' ServerID Dim dwDeleteUID As Int32 = CInt(grdResult.Item(CurrentIndex, 0)) ' UID - dwDeleteUID ÀÇ Å¸ÀÔÀº ¹Ýµå½Ã int32À̾î¾ß ÇÔ Array.Copy(BitConverter.GetBytes(dwDeleteUID), 0, sendb, 1, 4) Dim szDeleteCharName As String = grdResult.Item(CurrentIndex, 2) ' Á¦Àç ij¸¯ÅÍ À̸§ encoding.GetBytes(szDeleteCharName, 0, Min(16, szDeleteCharName.Length), sendb, 5) IClientSocket.Send(12, sendb) End Sub End Class