xxe 2 年前
父节点
当前提交
e081bbb04d
共有 2 个文件被更改,包括 107 次插入71 次删除
  1. +89
    -67
      HKCardManager/UserPages/CarMangerPage.Designer.cs
  2. +18
    -4
      HKCardManager/UserPages/CarMangerPage.cs

+ 89
- 67
HKCardManager/UserPages/CarMangerPage.Designer.cs 查看文件

@@ -41,6 +41,8 @@
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.panel1 = new System.Windows.Forms.Panel();
this.textBox5 = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
@@ -60,12 +62,6 @@
this.label4 = new System.Windows.Forms.Label();
this.panel4 = new System.Windows.Forms.Panel();
this.dataGridView1_全部 = new System.Windows.Forms.DataGridView();
this.编号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.名称 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.卡状态 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.机构 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.手机号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.卡号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel3 = new System.Windows.Forms.Panel();
this.label5 = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
@@ -80,8 +76,14 @@
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.button4 = new System.Windows.Forms.Button();
this.编号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.名称 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.卡状态 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.机构 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.手机号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.卡号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
@@ -103,7 +105,7 @@
//
this.button2.Enabled = false;
this.button2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.button2.Location = new System.Drawing.Point(98, 248);
this.button2.Location = new System.Drawing.Point(98, 297);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(190, 34);
this.button2.TabIndex = 29;
@@ -114,7 +116,7 @@
// button1
//
this.button1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.button1.Location = new System.Drawing.Point(98, 192);
this.button1.Location = new System.Drawing.Point(98, 241);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(190, 34);
this.button1.TabIndex = 28;
@@ -147,7 +149,7 @@
this.comboBox1.Enabled = false;
this.comboBox1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(98, 142);
this.comboBox1.Location = new System.Drawing.Point(98, 182);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(190, 29);
this.comboBox1.TabIndex = 19;
@@ -156,7 +158,7 @@
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label1.Location = new System.Drawing.Point(15, 145);
this.label1.Location = new System.Drawing.Point(15, 185);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(90, 21);
this.label1.TabIndex = 18;
@@ -188,6 +190,8 @@
//
// panel1
//
this.panel1.Controls.Add(this.textBox5);
this.panel1.Controls.Add(this.label8);
this.panel1.Controls.Add(this.comboBox2);
this.panel1.Controls.Add(this.textBox2);
this.panel1.Controls.Add(this.comboBox1);
@@ -199,9 +203,26 @@
this.panel1.Controls.Add(this.label2);
this.panel1.Location = new System.Drawing.Point(312, 91);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(301, 297);
this.panel1.Size = new System.Drawing.Size(359, 405);
this.panel1.TabIndex = 31;
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(98, 140);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(190, 23);
this.textBox5.TabIndex = 32;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label8.Location = new System.Drawing.Point(31, 140);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(74, 21);
this.label8.TabIndex = 31;
this.label8.Text = "手机号:";
//
// comboBox2
//
this.comboBox2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
@@ -439,56 +460,6 @@
this.dataGridView1_全部.Size = new System.Drawing.Size(1096, 137);
this.dataGridView1_全部.TabIndex = 37;
//
// 编号
//
this.编号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.编号.DataPropertyName = "Num";
this.编号.HeaderText = "编号";
this.编号.Name = "编号";
//
// 名称
//
this.名称.DataPropertyName = "UserName";
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.名称.DefaultCellStyle = dataGridViewCellStyle4;
this.名称.HeaderText = "姓名";
this.名称.Name = "名称";
this.名称.ReadOnly = true;
this.名称.Width = 150;
//
// 卡状态
//
this.卡状态.DataPropertyName = "State";
this.卡状态.HeaderText = "卡状态";
this.卡状态.Name = "卡状态";
this.卡状态.ReadOnly = true;
this.卡状态.Width = 150;
//
// 机构
//
this.机构.DataPropertyName = "OrgName";
this.机构.HeaderText = "机构";
this.机构.Name = "机构";
this.机构.ReadOnly = true;
this.机构.Width = 150;
//
// 手机号
//
this.手机号.DataPropertyName = "Phone";
this.手机号.HeaderText = "手机号";
this.手机号.Name = "手机号";
this.手机号.ReadOnly = true;
this.手机号.Visible = false;
this.手机号.Width = 150;
//
// 卡号
//
this.卡号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.卡号.DataPropertyName = "CardNum";
this.卡号.HeaderText = "卡号";
this.卡号.Name = "卡号";
this.卡号.ReadOnly = true;
//
// panel3
//
this.panel3.Controls.Add(this.label5);
@@ -630,6 +601,13 @@
this.tabPage5.Text = "手动输入卡号";
this.tabPage5.UseVisualStyleBackColor = true;
//
// 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;
//
// button4
//
this.button4.Location = new System.Drawing.Point(421, 302);
@@ -640,12 +618,54 @@
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;
this.编号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.编号.DataPropertyName = "Num";
this.编号.HeaderText = "编号";
this.编号.Name = "编号";
//
// 名称
//
this.名称.DataPropertyName = "UserName";
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.名称.DefaultCellStyle = dataGridViewCellStyle4;
this.名称.HeaderText = "姓名";
this.名称.Name = "名称";
this.名称.ReadOnly = true;
this.名称.Width = 150;
//
// 卡状态
//
this.卡状态.DataPropertyName = "State";
this.卡状态.HeaderText = "卡状态";
this.卡状态.Name = "卡状态";
this.卡状态.ReadOnly = true;
this.卡状态.Width = 150;
//
// 机构
//
this.机构.DataPropertyName = "OrgName";
this.机构.HeaderText = "机构";
this.机构.Name = "机构";
this.机构.ReadOnly = true;
this.机构.Width = 150;
//
// 手机号
//
this.手机号.DataPropertyName = "Phone";
this.手机号.HeaderText = "手机号";
this.手机号.Name = "手机号";
this.手机号.ReadOnly = true;
this.手机号.Width = 150;
//
// 卡号
//
this.卡号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.卡号.DataPropertyName = "CardNum";
this.卡号.HeaderText = "卡号";
this.卡号.Name = "卡号";
this.卡号.ReadOnly = true;
//
// CarMangerPage
//
@@ -732,5 +752,7 @@
private TabPage tabPage5;
private TextBox textBox4;
private Button button4;
private TextBox textBox5;
private Label label8;
}
}

+ 18
- 4
HKCardManager/UserPages/CarMangerPage.cs 查看文件

@@ -32,7 +32,6 @@ namespace HKCardManager.UserPages
comboBox2.TextUpdate += ComboBox2_TextUpdate;
comboBox2.SelectedValueChanged += ComboBox2_SelectedValueChanged;
comboBox4.DataSource = HKLib.Configer.Admin;

radioButton1.Checked = true;
comboBox2.Visible = false;
Init();
@@ -176,7 +175,7 @@ namespace HKCardManager.UserPages
if (UHFCardHelper.GetInstance().ComOpen)
{
string Name = string.Empty;
string Phone=string.Empty;
if (radioButton2.Checked)
{
Name = comboBox2.SelectedItem.ToString();
@@ -189,13 +188,25 @@ namespace HKCardManager.UserPages
MessageLogNotify.GetInstance.ShowWarning("请输入姓名");
return;
}
var res1 = await HKLibHelper.GetUserList(textBox2.Text.Trim());
if (res1?.Count > 0)
var res1 = await HKLibHelper.GetUserList("");

var ck = res1.FirstOrDefault(t => t.Name.Equals(textBox2.Text.Trim()));

if (ck!=null)
{
MessageBox.Show("提示!!!\n 用户已经存在,请勿重复添加...");
MessageLogNotify.GetInstance.ShowWarning("用户已经存在,请勿重复添加");
return;
}
var ck1 = res1.FirstOrDefault(t => t.Phone.Equals(textBox5.Text.Trim()));

if (ck1 != null)
{
MessageBox.Show("提示!!!\n 用户手机号已经存在,请勿重复添加...");
MessageLogNotify.GetInstance.ShowWarning("用户手机号已经存在,请勿重复添加");
return;
}
Phone=textBox5.Text.Trim();
Name = textBox2.Text.Trim();
}

@@ -206,6 +217,7 @@ namespace HKCardManager.UserPages
Name = Name,
OrgId = orgTables.FirstOrDefault(p => p.Name == comboBox1.Text)?.SId,
CardNo = worker,
Phone=Phone,
Num= HKLibHelper.GetUserMaxNumSync()
};
//Task.Factory.StartNew(() =>
@@ -275,6 +287,7 @@ namespace HKCardManager.UserPages
{
comboBox1.Text = users.OrgInfo.ElementAt(0).Name;
}
textBox5.Text = users.Phone;
MessageLogNotify.GetInstance.Show($"读卡成功,当前卡号【{res}】,当前用户【{users.Name}】,详细信息请在页面查看");
return;
}
@@ -362,6 +375,7 @@ namespace HKCardManager.UserPages
Name = Name,
OrgId = orgTables.FirstOrDefault(p => p.Name == FirstUser.OrgName)?.SId,
CardNo = worker,
Phone=FirstUser.Phone
};
var res = UHFCardHelper.GetInstance().WriteCard(userDto.CardNo);
if (res.Res == false)


正在加载...
取消
保存