From 040a4edb716e7d4035120e11162443ac29a3d8a1 Mon Sep 17 00:00:00 2001 From: xxe Date: Sat, 3 Dec 2022 13:00:26 +0800 Subject: [PATCH] 1 --- .../UserPages/CarMangerPage.Designer.cs | 118 +++++++++++++++--- HKCardManager/UserPages/CarMangerPage.cs | 30 +++++ HKCardManager/UserPages/CarMangerPage.resx | 27 ---- 3 files changed, 128 insertions(+), 47 deletions(-) diff --git a/HKCardManager/UserPages/CarMangerPage.Designer.cs b/HKCardManager/UserPages/CarMangerPage.Designer.cs index 71e1bd8..80f0dfe 100644 --- a/HKCardManager/UserPages/CarMangerPage.Designer.cs +++ b/HKCardManager/UserPages/CarMangerPage.Designer.cs @@ -28,10 +28,10 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); this.button2 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.textBox2 = new System.Windows.Forms.TextBox(); @@ -76,6 +76,12 @@ this.comboBox4 = new System.Windows.Forms.ComboBox(); this.textBox1 = new System.Windows.Forms.TextBox(); this.button6 = new System.Windows.Forms.Button(); + this.tabPage4 = new System.Windows.Forms.TabPage(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.button3 = new System.Windows.Forms.Button(); + this.tabPage5 = new System.Windows.Forms.TabPage(); + this.button4 = new System.Windows.Forms.Button(); + this.textBox4 = new System.Windows.Forms.TextBox(); this.panel1.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); @@ -89,6 +95,8 @@ this.panel3.SuspendLayout(); this.panel2.SuspendLayout(); this.tabPage3.SuspendLayout(); + this.tabPage4.SuspendLayout(); + this.tabPage5.SuspendLayout(); this.SuspendLayout(); // // button2 @@ -208,6 +216,8 @@ this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage3); + this.tabControl1.Controls.Add(this.tabPage4); + this.tabControl1.Controls.Add(this.tabPage5); this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl1.Location = new System.Drawing.Point(0, 0); this.tabControl1.Name = "tabControl1"; @@ -330,12 +340,12 @@ // this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.dataGridViewTextBoxColumn2.DataPropertyName = "UserName"; - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle5.BackColor = System.Drawing.Color.Gray; - dataGridViewCellStyle5.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.Brown; - dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.Lime; - this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.Gray; + dataGridViewCellStyle1.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.Brown; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.Lime; + this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle1; this.dataGridViewTextBoxColumn2.FillWeight = 18.55311F; this.dataGridViewTextBoxColumn2.HeaderText = "姓名"; this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; @@ -345,11 +355,11 @@ // this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; this.dataGridViewTextBoxColumn1.DataPropertyName = "Num"; - dataGridViewCellStyle6.BackColor = System.Drawing.Color.Gray; - dataGridViewCellStyle6.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.Brown; - dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.Lime; - this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.Gray; + dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.Brown; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.Lime; + this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle2; this.dataGridViewTextBoxColumn1.FillWeight = 271.066F; this.dataGridViewTextBoxColumn1.HeaderText = "编号"; this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; @@ -359,9 +369,9 @@ // this.dataGridViewTextBoxColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.dataGridViewTextBoxColumn4.DataPropertyName = "OrgName"; - dataGridViewCellStyle7.BackColor = System.Drawing.Color.Gray; - dataGridViewCellStyle7.ForeColor = System.Drawing.Color.White; - this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle7; + dataGridViewCellStyle3.BackColor = System.Drawing.Color.Gray; + dataGridViewCellStyle3.ForeColor = System.Drawing.Color.White; + this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle3; this.dataGridViewTextBoxColumn4.FillWeight = 10.38091F; this.dataGridViewTextBoxColumn4.HeaderText = "机构"; this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; @@ -439,8 +449,8 @@ // 名称 // this.名称.DataPropertyName = "UserName"; - dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.名称.DefaultCellStyle = dataGridViewCellStyle8; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.名称.DefaultCellStyle = dataGridViewCellStyle4; this.名称.HeaderText = "姓名"; this.名称.Name = "名称"; this.名称.ReadOnly = true; @@ -579,6 +589,64 @@ this.button6.UseVisualStyleBackColor = true; this.button6.Click += new System.EventHandler(this.button6_Click); // + // tabPage4 + // + this.tabPage4.Controls.Add(this.textBox3); + this.tabPage4.Controls.Add(this.button3); + this.tabPage4.Location = new System.Drawing.Point(4, 26); + this.tabPage4.Name = "tabPage4"; + this.tabPage4.Padding = new System.Windows.Forms.Padding(3); + this.tabPage4.Size = new System.Drawing.Size(1102, 579); + this.tabPage4.TabIndex = 3; + this.tabPage4.Text = "卡片读取"; + this.tabPage4.UseVisualStyleBackColor = true; + // + // textBox3 + // + this.textBox3.Location = new System.Drawing.Point(375, 254); + this.textBox3.Name = "textBox3"; + this.textBox3.Size = new System.Drawing.Size(256, 23); + this.textBox3.TabIndex = 1; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(443, 304); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(113, 56); + this.button3.TabIndex = 0; + this.button3.Text = "读取卡片卡号"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // tabPage5 + // + this.tabPage5.Controls.Add(this.textBox4); + this.tabPage5.Controls.Add(this.button4); + this.tabPage5.Location = new System.Drawing.Point(4, 26); + this.tabPage5.Name = "tabPage5"; + this.tabPage5.Padding = new System.Windows.Forms.Padding(3); + this.tabPage5.Size = new System.Drawing.Size(1102, 579); + this.tabPage5.TabIndex = 4; + this.tabPage5.Text = "手动输入卡号"; + this.tabPage5.UseVisualStyleBackColor = true; + // + // button4 + // + this.button4.Location = new System.Drawing.Point(421, 302); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(106, 58); + this.button4.TabIndex = 0; + this.button4.Text = "手动制卡"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.button4_Click); + // + // textBox4 + // + this.textBox4.Location = new System.Drawing.Point(352, 252); + this.textBox4.Name = "textBox4"; + this.textBox4.Size = new System.Drawing.Size(259, 23); + this.textBox4.TabIndex = 1; + // // CarMangerPage // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); @@ -605,6 +673,10 @@ this.panel2.PerformLayout(); this.tabPage3.ResumeLayout(false); this.tabPage3.PerformLayout(); + this.tabPage4.ResumeLayout(false); + this.tabPage4.PerformLayout(); + this.tabPage5.ResumeLayout(false); + this.tabPage5.PerformLayout(); this.ResumeLayout(false); } @@ -654,5 +726,11 @@ private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2; private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4; + private TabPage tabPage4; + private TextBox textBox3; + private Button button3; + private TabPage tabPage5; + private TextBox textBox4; + private Button button4; } } diff --git a/HKCardManager/UserPages/CarMangerPage.cs b/HKCardManager/UserPages/CarMangerPage.cs index 64a541d..284a472 100644 --- a/HKCardManager/UserPages/CarMangerPage.cs +++ b/HKCardManager/UserPages/CarMangerPage.cs @@ -549,5 +549,35 @@ namespace HKCardManager.UserPages } } + + private void button3_Click(object sender, EventArgs e) + { + if (UHFCardHelper.GetInstance().ComOpen) + { + var res = UHFCardHelper.GetInstance().ReadCard(); + if (string.IsNullOrEmpty(res)) + { + MessageBox.Show("提示!!!\n 请放入卡片,再读卡..."); + MessageLogNotify.GetInstance.Show("请放入卡片"); + return; + } + + textBox3.Text= res; + } + + } + + private void button4_Click(object sender, EventArgs e) + { + if (UHFCardHelper.GetInstance().ComOpen) + { + if (!string.IsNullOrEmpty(textBox3.Text)) + { + var rr = UHFCardHelper.GetInstance().WriteCard(textBox3.Text); + if(rr.Res) + MessageLogNotify.GetInstance.Show($"手动制卡成功,卡号[{textBox3.Text}]"); + } + } + } } } diff --git a/HKCardManager/UserPages/CarMangerPage.resx b/HKCardManager/UserPages/CarMangerPage.resx index 849ba7e..cc99101 100644 --- a/HKCardManager/UserPages/CarMangerPage.resx +++ b/HKCardManager/UserPages/CarMangerPage.resx @@ -66,33 +66,6 @@ True - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - True