Imports System.Text Public Class CharRestraintReg 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 cboCharID As System.Windows.Forms.ComboBox Friend WithEvents cboServerName As System.Windows.Forms.ComboBox Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox Friend WithEvents btnCommit As System.Windows.Forms.Button Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox Friend WithEvents cboType As System.Windows.Forms.ComboBox Friend WithEvents btnSearch As System.Windows.Forms.Button Friend WithEvents cboBlockType As System.Windows.Forms.ComboBox Friend WithEvents cboRestraintKind As System.Windows.Forms.ComboBox Friend WithEvents cboDescription As System.Windows.Forms.ComboBox Friend WithEvents txtUID As System.Windows.Forms.TextBox Friend WithEvents cboEndTime As System.Windows.Forms.ComboBox Friend WithEvents lblcharname As System.Windows.Forms.Label Friend WithEvents lbluid As System.Windows.Forms.Label Friend WithEvents lblservername As System.Windows.Forms.Label Friend WithEvents lblrestraintway As System.Windows.Forms.Label Friend WithEvents lblrestraintfrom As System.Windows.Forms.Label Friend WithEvents lblrestraintto As System.Windows.Forms.Label Friend WithEvents lblblockkind As System.Windows.Forms.Label Friend WithEvents lblrestraintwhy As System.Windows.Forms.Label Friend WithEvents lblrestrainttime As System.Windows.Forms.Label Friend WithEvents lblrestraintwide As System.Windows.Forms.Label Friend WithEvents lbltitle As System.Windows.Forms.Label Private Sub InitializeComponent() Me.lbltitle = New System.Windows.Forms.Label() Me.lblcharname = New System.Windows.Forms.Label() Me.cboCharID = New System.Windows.Forms.ComboBox() Me.lbluid = New System.Windows.Forms.Label() Me.txtUID = New System.Windows.Forms.TextBox() Me.cboServerName = New System.Windows.Forms.ComboBox() Me.lblservername = New System.Windows.Forms.Label() Me.lblrestraintway = New System.Windows.Forms.Label() Me.cboRestraintKind = New System.Windows.Forms.ComboBox() Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.lblrestraintfrom = New System.Windows.Forms.Label() Me.lblrestraintto = New System.Windows.Forms.Label() Me.cboEndTime = New System.Windows.Forms.ComboBox() Me.cboBlockType = New System.Windows.Forms.ComboBox() Me.lblblockkind = New System.Windows.Forms.Label() Me.btnCommit = New System.Windows.Forms.Button() Me.cboDescription = New System.Windows.Forms.ComboBox() Me.lblrestraintwhy = New System.Windows.Forms.Label() Me.lblrestrainttime = New System.Windows.Forms.Label() Me.GroupBox2 = New System.Windows.Forms.GroupBox() Me.btnSearch = New System.Windows.Forms.Button() Me.GroupBox3 = New System.Windows.Forms.GroupBox() Me.cboType = New System.Windows.Forms.ComboBox() Me.lblrestraintwide = New System.Windows.Forms.Label() Me.GroupBox1.SuspendLayout() Me.GroupBox2.SuspendLayout() Me.GroupBox3.SuspendLayout() Me.SuspendLayout() ' 'lbltitle ' Me.lbltitle.AutoSize = True Me.lbltitle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lbltitle.Font = New System.Drawing.Font("±¼¸²Ã¼", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(129, Byte)) Me.lbltitle.Location = New System.Drawing.Point(232, 32) Me.lbltitle.Name = "lbltitle" Me.lbltitle.Size = New System.Drawing.Size(167, 24) Me.lbltitle.TabIndex = 2 Me.lbltitle.Text = "ij¸¯ÅÍÁ¦Àç µî·Ï " ' 'lblcharname ' Me.lblcharname.AutoSize = True Me.lblcharname.Location = New System.Drawing.Point(32, 24) Me.lblcharname.Name = "lblcharname" Me.lblcharname.Size = New System.Drawing.Size(54, 14) Me.lblcharname.TabIndex = 10 Me.lblcharname.Text = "ij¸¯Å͸í" ' 'cboCharID ' Me.cboCharID.Location = New System.Drawing.Point(104, 16) Me.cboCharID.Name = "cboCharID" Me.cboCharID.Size = New System.Drawing.Size(128, 20) Me.cboCharID.TabIndex = 12 ' 'lbluid ' Me.lbluid.AutoSize = True Me.lbluid.Location = New System.Drawing.Point(64, 56) Me.lbluid.Name = "lbluid" Me.lbluid.Size = New System.Drawing.Size(26, 14) Me.lbluid.TabIndex = 13 Me.lbluid.Text = "UID" ' 'txtUID ' Me.txtUID.Location = New System.Drawing.Point(104, 48) Me.txtUID.Name = "txtUID" Me.txtUID.Size = New System.Drawing.Size(128, 21) Me.txtUID.TabIndex = 14 Me.txtUID.Text = "" ' 'cboServerName ' Me.cboServerName.Location = New System.Drawing.Point(104, 24) Me.cboServerName.Name = "cboServerName" Me.cboServerName.Size = New System.Drawing.Size(128, 20) Me.cboServerName.TabIndex = 15 ' 'lblservername ' Me.lblservername.AutoSize = True Me.lblservername.Location = New System.Drawing.Point(24, 27) Me.lblservername.Name = "lblservername" Me.lblservername.Size = New System.Drawing.Size(66, 14) Me.lblservername.TabIndex = 16 Me.lblservername.Text = "°ÔÀÓ¼­¹ö¸í" ' 'lblrestraintway ' Me.lblrestraintway.AutoSize = True Me.lblrestraintway.Location = New System.Drawing.Point(32, 72) Me.lblrestraintway.Name = "lblrestraintway" Me.lblrestraintway.Size = New System.Drawing.Size(54, 14) Me.lblrestraintway.TabIndex = 17 Me.lblrestraintway.Text = "Á¦Àç¹æ¹ý" ' 'cboRestraintKind ' Me.cboRestraintKind.Location = New System.Drawing.Point(104, 64) Me.cboRestraintKind.Name = "cboRestraintKind" Me.cboRestraintKind.Size = New System.Drawing.Size(128, 20) Me.cboRestraintKind.TabIndex = 18 ' 'GroupBox1 ' Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.lblrestraintfrom, Me.lblrestraintto, Me.cboEndTime, Me.cboBlockType, Me.lblblockkind, Me.btnCommit, Me.cboDescription, Me.lblrestraintwhy, Me.lblrestrainttime, Me.lblrestraintway, Me.cboRestraintKind, Me.cboCharID, Me.lblcharname}) Me.GroupBox1.Location = New System.Drawing.Point(128, 264) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(352, 192) Me.GroupBox1.TabIndex = 19 Me.GroupBox1.TabStop = False ' 'lblrestraintfrom ' Me.lblrestraintfrom.AutoSize = True Me.lblrestraintfrom.Location = New System.Drawing.Point(102, 93) Me.lblrestraintfrom.Name = "lblrestraintfrom" Me.lblrestraintfrom.Size = New System.Drawing.Size(54, 14) Me.lblrestraintfrom.TabIndex = 30 Me.lblrestraintfrom.Text = "Áö±ÝºÎÅÍ" ' 'lblrestraintto ' Me.lblrestraintto.AutoSize = True Me.lblrestraintto.Location = New System.Drawing.Point(232, 92) Me.lblrestraintto.Name = "lblrestraintto" Me.lblrestraintto.Size = New System.Drawing.Size(75, 14) Me.lblrestraintto.TabIndex = 29 Me.lblrestraintto.Text = "ÀÏ µ¿¾È ºí·°" ' 'cboEndTime ' Me.cboEndTime.Location = New System.Drawing.Point(158, 88) Me.cboEndTime.Name = "cboEndTime" Me.cboEndTime.Size = New System.Drawing.Size(66, 20) Me.cboEndTime.TabIndex = 28 ' 'cboBlockType ' Me.cboBlockType.Location = New System.Drawing.Point(104, 40) Me.cboBlockType.Name = "cboBlockType" Me.cboBlockType.Size = New System.Drawing.Size(128, 20) Me.cboBlockType.TabIndex = 27 ' 'lblblockkind ' Me.lblblockkind.AutoSize = True Me.lblblockkind.Location = New System.Drawing.Point(32, 46) Me.lblblockkind.Name = "lblblockkind" Me.lblblockkind.Size = New System.Drawing.Size(54, 14) Me.lblblockkind.TabIndex = 26 Me.lblblockkind.Text = "ºí·°Á¾·ù" ' 'btnCommit ' Me.btnCommit.Location = New System.Drawing.Point(104, 144) Me.btnCommit.Name = "btnCommit" Me.btnCommit.Size = New System.Drawing.Size(128, 32) Me.btnCommit.TabIndex = 24 Me.btnCommit.Text = "Á¦Àç¿Ï·á" ' 'cboDescription ' Me.cboDescription.Location = New System.Drawing.Point(104, 112) Me.cboDescription.Name = "cboDescription" Me.cboDescription.Size = New System.Drawing.Size(232, 20) Me.cboDescription.TabIndex = 21 ' 'lblrestraintwhy ' Me.lblrestraintwhy.AutoSize = True Me.lblrestraintwhy.Location = New System.Drawing.Point(32, 120) Me.lblrestraintwhy.Name = "lblrestraintwhy" Me.lblrestraintwhy.Size = New System.Drawing.Size(54, 14) Me.lblrestraintwhy.TabIndex = 20 Me.lblrestraintwhy.Text = "Á¦Àç»çÀ¯" ' 'lblrestrainttime ' Me.lblrestrainttime.AutoSize = True Me.lblrestrainttime.Location = New System.Drawing.Point(32, 96) Me.lblrestrainttime.Name = "lblrestrainttime" Me.lblrestrainttime.Size = New System.Drawing.Size(54, 14) Me.lblrestrainttime.TabIndex = 19 Me.lblrestrainttime.Text = "󸮽ð£" ' 'GroupBox2 ' Me.GroupBox2.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnSearch, Me.lblservername, Me.lbluid, Me.txtUID, Me.cboServerName}) Me.GroupBox2.Location = New System.Drawing.Point(128, 128) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Size = New System.Drawing.Size(352, 128) Me.GroupBox2.TabIndex = 20 Me.GroupBox2.TabStop = False ' 'btnSearch ' Me.btnSearch.Location = New System.Drawing.Point(104, 80) Me.btnSearch.Name = "btnSearch" Me.btnSearch.Size = New System.Drawing.Size(128, 32) Me.btnSearch.TabIndex = 25 Me.btnSearch.Text = "Á¶È¸Çϱâ" ' 'GroupBox3 ' Me.GroupBox3.Controls.AddRange(New System.Windows.Forms.Control() {Me.cboType, Me.lblrestraintwide}) Me.GroupBox3.Location = New System.Drawing.Point(128, 72) Me.GroupBox3.Name = "GroupBox3" Me.GroupBox3.Size = New System.Drawing.Size(352, 56) Me.GroupBox3.TabIndex = 21 Me.GroupBox3.TabStop = False ' 'cboType ' Me.cboType.Location = New System.Drawing.Point(104, 24) Me.cboType.Name = "cboType" Me.cboType.Size = New System.Drawing.Size(128, 20) Me.cboType.TabIndex = 18 ' 'lblrestraintwide ' Me.lblrestraintwide.AutoSize = True Me.lblrestraintwide.Location = New System.Drawing.Point(18, 28) Me.lblrestraintwide.Name = "lblrestraintwide" Me.lblrestraintwide.Size = New System.Drawing.Size(79, 14) Me.lblrestraintwide.TabIndex = 17 Me.lblrestraintwide.Text = "Á¦Àç¹üÀ§¼±ÅÃ" ' 'CharRestraintReg ' Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14) Me.ClientSize = New System.Drawing.Size(576, 517) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.GroupBox3, Me.GroupBox2, Me.GroupBox1, Me.lbltitle}) Me.Name = "CharRestraintReg" Me.Text = "ij¸¯ÅÍÁ¦Àç µî·Ï" Me.GroupBox1.ResumeLayout(False) Me.GroupBox2.ResumeLayout(False) Me.GroupBox3.ResumeLayout(False) Me.ResumeLayout(False) End Sub #End Region Private Sub CharRestraintReg_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'ÇöÀç Á¦Àç¹öưÀ» ºñȰ¼ºµÈ»óÅ·Π¸¸µç´Ù. ProcessPacket.ICharRestraintReg = Me btnCommit.Enabled = False Me.Text = ITextCharRestraintreg.formheader Me.lbltitle.Text = ITextCharRestraintreg.formheader Me.lblblockkind.Text = ITextCharRestraintreg.lblblockkind Me.lblcharname.Text = ITextCharInfo.cboidtype_name Me.lblrestraintfrom.Text = ITextCharRestraintreg.lblrestraintfrom Me.lblrestrainttime.Text = ITextCharRestraintreg.lblrestrainttime Me.lblrestraintto.Text = ITextCharRestraintreg.lblrestraintto Me.lblrestraintway.Text = ITextCharRestraintreg.lblrestraintway Me.lblrestraintwhy.Text = ITextCharRestraintreg.lblrestraintwhy Me.lblrestraintwide.Text = ITextCharRestraintreg.lblrestraintwhy Me.lblservername.Text = ITextCharRestraint.lblserver Me.lbluid.Text = ITextCharInfo.cboidtype_uid Me.btnSearch.Text = ITextButton.btnSearch Me.btnCommit.Text = ITextAdminSetting.chkRestraintReg cboType.Text = ITextCharRestraintreg.cbowide_text cboType.Items.Add(ITextCharRestraintreg.cbowide_1) cboType.Items.Add(ITextCharRestraintreg.cbowide_2) DBConn.SetServerNames(cboServerName) GroupBox1.Enabled = False GroupBox2.Enabled = False cboBlockType.Items.Add(ITextCharRestraintreg.cboblock_1) cboBlockType.Items.Add(ITextCharRestraintreg.cboblock_2) cboBlockType.SelectedIndex = 1 cboRestraintKind.Enabled = False cboDescription.Items.Add(ITextCharRestraintreg.cbowhy_1) cboDescription.Items.Add(ITextCharRestraintreg.cbowhy_2) cboDescription.Items.Add(ITextCharRestraintreg.cbowhy_3) cboDescription.Items.Add(ITextCharRestraintreg.cbowhy_4) cboDescription.Items.Add(ITextCharRestraintreg.cbowhy_5) cboDescription.Items.Add(ITextCharRestraintreg.cbowhy_6) cboDescription.Items.Add(ITextCharRestraintreg.cbowhy_7) cboDescription.SelectedIndex = 0 cboEndTime.Items.Add("1") cboEndTime.Items.Add("3") cboEndTime.Items.Add("5") cboEndTime.Items.Add("7") cboEndTime.Items.Add("10") cboEndTime.Items.Add("15") cboEndTime.Items.Add("30") cboEndTime.SelectedIndex = 0 'DateTimePicker1.Format = DateTimePickerFormat.Custom 'DateTimePicker1.CustomFormat = "yyyy-MM-dd HH:mm:00" End Sub Private Sub CharRestraintReg_UnLoad(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Closed ProcessPacket.ICharRestraintReg = Nothing End Sub 'ij¸¯ºí·° ¶Ç´Â °èÁ¤ºí·°À» ¼±ÅÃÇÑ´Ù. Private Sub cboType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboType.SelectedIndexChanged Select Case cboType.SelectedIndex Case 0 GroupBox2.Enabled = True GroupBox1.Enabled = True btnSearch.Enabled = False cboCharID.Enabled = False btnCommit.Enabled = True Case 1 GroupBox2.Enabled = True GroupBox1.Enabled = True btnSearch.Enabled = True cboCharID.Enabled = True btnCommit.Enabled = False End Select End Sub 'Àû¿ëÇϱâ............ Private Sub btnCommit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCommit.Click Dim serverid As Byte Select Case cboServerName.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 Dim BlockKind As Byte Select Case cboType.SelectedIndex Case 0 BlockKind = 1 '°èÁ¤ºí·° Case 1 BlockKind = 2 'ij¸¯ºí·° End Select Dim BlcokType As Byte Select Case cboBlockType.SelectedIndex Case 0 BlcokType = 1 '¿µ±¸ºí·° Case 1 BlcokType = 0 'ÀÓ½Ãºí·° End Select ' Á¦Àç µî·Ï ' ServerID(1) / UID(4) / CharName(16) / BlockType(1) / BlockKind(1) / ' BlockFinishDateTime(20) / Description(31) Dim encoding As Encoding = encoding.GetEncoding(Code) Dim sendb(70) As Byte sendb(0) = serverid ' ServerID Dim dwUID As Int32 = CInt(txtUID.Text) ' UID - dwUIDÀÇ Å¸ÀÔÀº ¹Ýµå½Ã int32À̾î¾ß ÇÔ. Array.Copy(BitConverter.GetBytes(dwUID), 0, sendb, 1, 4) Dim szCharName As String = cboCharID.Text ' CharName encoding.GetBytes(szCharName, 0, Min(szCharName.Length, 16), sendb, 5) sendb(21) = BlockKind ' BlockType sendb(22) = BlcokType ' BlockKind encoding.GetBytes(cboEndTime.Text, 0, Min(cboEndTime.Text.Length, 20), sendb, 23) Dim szDescription As String = cboDescription.Text ' Description encoding.GetBytes(szDescription, 0, Min(szDescription.Length, 31), sendb, 43) IClientSocket.Send(10, sendb) Me.Close() End Sub Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click Dim serverid As Byte Select Case cboServerName.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 ICharRestraintReg.cboCharID.Items.Clear() Try Dim dwUID As Int32 = CInt(txtUID.Text) ' UID - dwUIDÀÇ Å¸ÀÔÀº ¹Ýµå½Ã int32À̾î¾ß ÇÔ. Dim sendb(4) As Byte Array.Copy(BitConverter.GetBytes(dwUID), 0, sendb, 0, 3) sendb(4) = serverid btnSearch.Enabled = False IClientSocket.Send(13, sendb) Catch MsgBox("¿¡·¯ÀÔ´Ï´Ù. UID¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä. ¶Ç´Â ³×Æ®¿öÅ© ¿¬°áÀÌ ²÷¾îÁ³À» ¼ö ÀÖ½À´Ï´Ù.", MsgBoxStyle.Critical) End Try End Sub Private Sub cboBlockType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboBlockType.SelectedIndexChanged Select Case cboBlockType.SelectedIndex Case 0 '¿µ±¸ºí·° cboEndTime.Hide() cboEndTime.SelectedIndex = cboEndTime.MaxLength - 1 Case 1 'ÀÓ½Ãºí·° cboEndTime.Show() End Select End Sub End Class