@@ -28,8 +28,8 @@ | |||||
/// </summary> | /// </summary> | ||||
private void InitializeComponent() | 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 dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); | |||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); | |||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); | this.splitContainer1 = new System.Windows.Forms.SplitContainer(); | ||||
this.groupBox5 = new System.Windows.Forms.GroupBox(); | this.groupBox5 = new System.Windows.Forms.GroupBox(); | ||||
this.pictureBox11 = new System.Windows.Forms.PictureBox(); | this.pictureBox11 = new System.Windows.Forms.PictureBox(); | ||||
@@ -50,6 +50,7 @@ | |||||
this.button10 = new System.Windows.Forms.Button(); | this.button10 = new System.Windows.Forms.Button(); | ||||
this.button11 = new System.Windows.Forms.Button(); | this.button11 = new System.Windows.Forms.Button(); | ||||
this.groupBox2 = new System.Windows.Forms.GroupBox(); | this.groupBox2 = new System.Windows.Forms.GroupBox(); | ||||
this.pictureBox12 = new System.Windows.Forms.PictureBox(); | |||||
this.button13 = new System.Windows.Forms.Button(); | this.button13 = new System.Windows.Forms.Button(); | ||||
this.pictureBox6 = new System.Windows.Forms.PictureBox(); | this.pictureBox6 = new System.Windows.Forms.PictureBox(); | ||||
this.pictureBox5 = new System.Windows.Forms.PictureBox(); | this.pictureBox5 = new System.Windows.Forms.PictureBox(); | ||||
@@ -65,7 +66,6 @@ | |||||
this.dataGridView1 = new System.Windows.Forms.DataGridView(); | 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.pictureBox12 = new System.Windows.Forms.PictureBox(); | |||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); | ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); | ||||
this.splitContainer1.Panel1.SuspendLayout(); | this.splitContainer1.Panel1.SuspendLayout(); | ||||
this.splitContainer1.Panel2.SuspendLayout(); | this.splitContainer1.Panel2.SuspendLayout(); | ||||
@@ -82,6 +82,7 @@ | |||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).BeginInit(); | ((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).BeginInit(); | ||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit(); | ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit(); | ||||
this.groupBox2.SuspendLayout(); | this.groupBox2.SuspendLayout(); | ||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox12)).BeginInit(); | |||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).BeginInit(); | ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).BeginInit(); | ||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit(); | ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit(); | ||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit(); | ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit(); | ||||
@@ -91,7 +92,6 @@ | |||||
this.splitContainer2.Panel2.SuspendLayout(); | this.splitContainer2.Panel2.SuspendLayout(); | ||||
this.splitContainer2.SuspendLayout(); | this.splitContainer2.SuspendLayout(); | ||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); | ||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox12)).BeginInit(); | |||||
this.SuspendLayout(); | this.SuspendLayout(); | ||||
// | // | ||||
// splitContainer1 | // splitContainer1 | ||||
@@ -374,6 +374,17 @@ | |||||
this.groupBox2.TabStop = false; | this.groupBox2.TabStop = false; | ||||
this.groupBox2.Text = "卡片维护"; | this.groupBox2.Text = "卡片维护"; | ||||
// | // | ||||
// pictureBox12 | |||||
// | |||||
this.pictureBox12.BackColor = System.Drawing.Color.Transparent; | |||||
this.pictureBox12.Image = global::HKCardManager.Properties.Resources.xiaohu; | |||||
this.pictureBox12.Location = new System.Drawing.Point(20, 210); | |||||
this.pictureBox12.Name = "pictureBox12"; | |||||
this.pictureBox12.Size = new System.Drawing.Size(20, 20); | |||||
this.pictureBox12.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; | |||||
this.pictureBox12.TabIndex = 9; | |||||
this.pictureBox12.TabStop = false; | |||||
// | |||||
// button13 | // button13 | ||||
// | // | ||||
this.button13.BackColor = System.Drawing.SystemColors.Control; | this.button13.BackColor = System.Drawing.SystemColors.Control; | ||||
@@ -551,8 +562,8 @@ | |||||
// | // | ||||
// 图标 | // 图标 | ||||
// | // | ||||
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter; | |||||
this.图标.DefaultCellStyle = dataGridViewCellStyle5; | |||||
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopCenter; | |||||
this.图标.DefaultCellStyle = dataGridViewCellStyle1; | |||||
this.图标.HeaderText = "图标"; | this.图标.HeaderText = "图标"; | ||||
this.图标.Name = "图标"; | this.图标.Name = "图标"; | ||||
this.图标.ReadOnly = true; | this.图标.ReadOnly = true; | ||||
@@ -561,23 +572,12 @@ | |||||
// 消息文本 | // 消息文本 | ||||
// | // | ||||
this.消息文本.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | this.消息文本.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | ||||
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; | |||||
this.消息文本.DefaultCellStyle = dataGridViewCellStyle6; | |||||
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; | |||||
this.消息文本.DefaultCellStyle = dataGridViewCellStyle2; | |||||
this.消息文本.HeaderText = "消息文本"; | this.消息文本.HeaderText = "消息文本"; | ||||
this.消息文本.Name = "消息文本"; | this.消息文本.Name = "消息文本"; | ||||
this.消息文本.ReadOnly = true; | this.消息文本.ReadOnly = true; | ||||
// | // | ||||
// pictureBox12 | |||||
// | |||||
this.pictureBox12.BackColor = System.Drawing.Color.Transparent; | |||||
this.pictureBox12.Image = global::HKCardManager.Properties.Resources.xiaohu; | |||||
this.pictureBox12.Location = new System.Drawing.Point(20, 210); | |||||
this.pictureBox12.Name = "pictureBox12"; | |||||
this.pictureBox12.Size = new System.Drawing.Size(20, 20); | |||||
this.pictureBox12.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; | |||||
this.pictureBox12.TabIndex = 9; | |||||
this.pictureBox12.TabStop = false; | |||||
// | |||||
// Form1 | // Form1 | ||||
// | // | ||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); | ||||
@@ -603,6 +603,7 @@ | |||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).EndInit(); | ((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).EndInit(); | ||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).EndInit(); | ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).EndInit(); | ||||
this.groupBox2.ResumeLayout(false); | this.groupBox2.ResumeLayout(false); | ||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox12)).EndInit(); | |||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).EndInit(); | ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).EndInit(); | ||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit(); | ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit(); | ||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit(); | ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit(); | ||||
@@ -612,7 +613,6 @@ | |||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); | ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); | ||||
this.splitContainer2.ResumeLayout(false); | this.splitContainer2.ResumeLayout(false); | ||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); | ||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox12)).EndInit(); | |||||
this.ResumeLayout(false); | this.ResumeLayout(false); | ||||
} | } | ||||
@@ -296,11 +296,9 @@ namespace HKCardManager | |||||
ShowPage(new AdvertisingSetPage()); | ShowPage(new AdvertisingSetPage()); | ||||
} | } | ||||
private void button13_Click(object sender, EventArgs e) | |||||
private async void button13_Click(object sender, EventArgs e) | |||||
{ | { | ||||
if (UHFCardHelper.GetInstance().ComOpen) | if (UHFCardHelper.GetInstance().ComOpen) | ||||
{ | { | ||||
try | try | ||||
@@ -315,11 +313,30 @@ namespace HKCardManager | |||||
return; | return; | ||||
} | } | ||||
var result = await HKLibHelper.GetUserList(""); | |||||
UserListDto users = null; | |||||
result.ForEach(item => | |||||
{ | |||||
if (item.Cards.FirstOrDefault(t => t.CardNum.Equals(res)) != null) | |||||
{ | |||||
users = item; | |||||
return; | |||||
} | |||||
}); | |||||
if (users != null) | |||||
{ | |||||
await HKLibHelper.CardStutasChange(new CardStutasDto() | |||||
{ | |||||
keywrod = users.Name, | |||||
Stutas = 3, | |||||
}); | |||||
} | |||||
var resz = MessageBox.Show($"提示!!!\n 当前卡号{res},确定销卡?", "提示", MessageBoxButtons.YesNo); | var resz = MessageBox.Show($"提示!!!\n 当前卡号{res},确定销卡?", "提示", MessageBoxButtons.YesNo); | ||||
if (resz == DialogResult.Yes) | if (resz == DialogResult.Yes) | ||||
{ | { | ||||
var res1 = UHFCardHelper.GetInstance().WriteCard("000"); | var res1 = UHFCardHelper.GetInstance().WriteCard("000"); | ||||
MessageBox.Show(res1.Res ? "销卡成功" : "销卡失败"); | |||||
MessageBox.Show(res1.Res ? "000为默认新卡卡号,销卡成功" : "销卡失败"); | |||||
} | } | ||||
} | } | ||||
catch (Exception) | catch (Exception) | ||||
@@ -63,10 +63,4 @@ | |||||
<metadata name="消息文本.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | <metadata name="消息文本.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | ||||
<value>True</value> | <value>True</value> | ||||
</metadata> | </metadata> | ||||
<metadata name="图标.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||||
<value>True</value> | |||||
</metadata> | |||||
<metadata name="消息文本.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||||
<value>True</value> | |||||
</metadata> | |||||
</root> | </root> |
@@ -21,7 +21,7 @@ namespace HKCardManager.UserPages | |||||
//this.SizeChanged += CancellationPage_SizeChanged; | //this.SizeChanged += CancellationPage_SizeChanged; | ||||
} | } | ||||
private void Ref() | |||||
private void Ref() | |||||
{ | { | ||||
var res = HKLibHelper.GetUserListSync(""); | var res = HKLibHelper.GetUserListSync(""); | ||||
Global.UserListDtos.Clear(); | Global.UserListDtos.Clear(); | ||||
@@ -76,7 +76,7 @@ namespace HKCardManager.UserPages | |||||
var temp = Global.UserListDtos.FirstOrDefault(p => p.UserName == name); | var temp = Global.UserListDtos.FirstOrDefault(p => p.UserName == name); | ||||
if (temp != null) | if (temp != null) | ||||
{ | { | ||||
if (status==3&& temp.State== "挂失") | |||||
if (status == 3 && temp.State == "挂失") | |||||
{ | { | ||||
MessageBox.Show($"用户【{temp.UserName}】挂失状态不能销户"); | MessageBox.Show($"用户【{temp.UserName}】挂失状态不能销户"); | ||||
return; | return; | ||||
@@ -91,6 +91,10 @@ namespace HKCardManager.UserPages | |||||
keywrod = name, | keywrod = name, | ||||
Stutas = status | Stutas = status | ||||
}); | }); | ||||
if (status == 3) | |||||
{ | |||||
await HKLibHelper.DisableUser(name); | |||||
} | |||||
if (res) | if (res) | ||||
{ | { | ||||
MessageBox.Show($"用户【{temp.UserName}】 {TagName} 成功"); | MessageBox.Show($"用户【{temp.UserName}】 {TagName} 成功"); | ||||
@@ -258,9 +258,16 @@ namespace HKCardManager.UserPages | |||||
if (Regex.IsMatch(res, "\\d{19}")) | if (Regex.IsMatch(res, "\\d{19}")) | ||||
{ | { | ||||
var result = await HKLibHelper.GetUserList(""); | var result = await HKLibHelper.GetUserList(""); | ||||
UserListDto users = null; | |||||
result.ForEach(item => | |||||
{ | |||||
if (item.Cards.FirstOrDefault(t => t.CardNum.Equals(res)) != null) | |||||
{ | |||||
users = item; | |||||
return; | |||||
} | |||||
}); | |||||
var users = result.Where(t => !t.Cards.Select(x => x.CardNum).Contains(res)).FirstOrDefault(); | |||||
if (users != null) | if (users != null) | ||||
{ | { | ||||
textBox2.Text = users.Name; | textBox2.Text = users.Name; | ||||
@@ -28,8 +28,8 @@ | |||||
/// </summary> | /// </summary> | ||||
private void InitializeComponent() | private void InitializeComponent() | ||||
{ | { | ||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); | |||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PersonnelEntryPage)); | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PersonnelEntryPage)); | ||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); | |||||
this.button2 = new System.Windows.Forms.Button(); | this.button2 = new System.Windows.Forms.Button(); | ||||
this.comboBox2 = new System.Windows.Forms.ComboBox(); | this.comboBox2 = new System.Windows.Forms.ComboBox(); | ||||
this.label3 = new System.Windows.Forms.Label(); | this.label3 = new System.Windows.Forms.Label(); | ||||
@@ -37,13 +37,6 @@ | |||||
this.label1 = new System.Windows.Forms.Label(); | this.label1 = new System.Windows.Forms.Label(); | ||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); | this.splitContainer1 = new System.Windows.Forms.SplitContainer(); | ||||
this.dataGridView1 = new System.Windows.Forms.DataGridView(); | 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.删除 = new System.Windows.Forms.DataGridViewButtonColumn(); | |||||
this.label2 = new System.Windows.Forms.Label(); | this.label2 = new System.Windows.Forms.Label(); | ||||
this.button1 = new System.Windows.Forms.Button(); | this.button1 = new System.Windows.Forms.Button(); | ||||
this.pictureBox2 = new System.Windows.Forms.PictureBox(); | this.pictureBox2 = new System.Windows.Forms.PictureBox(); | ||||
@@ -65,6 +58,13 @@ | |||||
this.label8 = new System.Windows.Forms.Label(); | this.label8 = new System.Windows.Forms.Label(); | ||||
this.label_down = new System.Windows.Forms.Label(); | this.label_down = new System.Windows.Forms.Label(); | ||||
this.label_end = new System.Windows.Forms.Label(); | this.label_end = new System.Windows.Forms.Label(); | ||||
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.删除 = new System.Windows.Forms.DataGridViewButtonColumn(); | |||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); | ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); | ||||
this.splitContainer1.Panel1.SuspendLayout(); | this.splitContainer1.Panel1.SuspendLayout(); | ||||
this.splitContainer1.Panel2.SuspendLayout(); | this.splitContainer1.Panel2.SuspendLayout(); | ||||
@@ -189,66 +189,6 @@ | |||||
this.dataGridView1.TabIndex = 0; | this.dataGridView1.TabIndex = 0; | ||||
this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); | this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); | ||||
// | // | ||||
// 编号 | |||||
// | |||||
this.编号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | |||||
this.编号.DataPropertyName = "Num"; | |||||
this.编号.HeaderText = "编号"; | |||||
this.编号.Name = "编号"; | |||||
// | |||||
// 名称 | |||||
// | |||||
this.名称.DataPropertyName = "UserName"; | |||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; | |||||
this.名称.DefaultCellStyle = dataGridViewCellStyle2; | |||||
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; | |||||
// | |||||
// 删除 | |||||
// | |||||
this.删除.DataPropertyName = "ContextName"; | |||||
this.删除.FlatStyle = System.Windows.Forms.FlatStyle.Flat; | |||||
this.删除.HeaderText = "删除"; | |||||
this.删除.Name = "删除"; | |||||
this.删除.ReadOnly = true; | |||||
this.删除.Text = "删除"; | |||||
this.删除.UseColumnTextForButtonValue = true; | |||||
// | |||||
// label2 | // label2 | ||||
// | // | ||||
this.label2.AutoSize = true; | this.label2.AutoSize = true; | ||||
@@ -442,6 +382,67 @@ | |||||
this.label_end.TabIndex = 4; | this.label_end.TabIndex = 4; | ||||
this.label_end.Text = "尾页"; | this.label_end.Text = "尾页"; | ||||
// | // | ||||
// 编号 | |||||
// | |||||
this.编号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; | |||||
this.编号.DataPropertyName = "Num"; | |||||
this.编号.HeaderText = "编号"; | |||||
this.编号.Name = "编号"; | |||||
this.编号.ReadOnly = true; | |||||
// | |||||
// 名称 | |||||
// | |||||
this.名称.DataPropertyName = "UserName"; | |||||
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; | |||||
this.名称.DefaultCellStyle = dataGridViewCellStyle1; | |||||
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; | |||||
// | |||||
// 删除 | |||||
// | |||||
this.删除.DataPropertyName = "ContextName"; | |||||
this.删除.FlatStyle = System.Windows.Forms.FlatStyle.Flat; | |||||
this.删除.HeaderText = "删除"; | |||||
this.删除.Name = "删除"; | |||||
this.删除.ReadOnly = true; | |||||
this.删除.Text = "删除"; | |||||
this.删除.UseColumnTextForButtonValue = true; | |||||
// | |||||
// PersonnelEntryPage | // PersonnelEntryPage | ||||
// | // | ||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); | ||||
@@ -489,6 +490,8 @@ | |||||
private Button 导入Excel; | private Button 导入Excel; | ||||
private PictureBox pictureBox2; | private PictureBox pictureBox2; | ||||
private PictureBox pictureBox1; | private PictureBox pictureBox1; | ||||
private Button button1; | |||||
private Label label2; | |||||
private DataGridViewTextBoxColumn 编号; | private DataGridViewTextBoxColumn 编号; | ||||
private DataGridViewTextBoxColumn 名称; | private DataGridViewTextBoxColumn 名称; | ||||
private DataGridViewTextBoxColumn 卡状态; | private DataGridViewTextBoxColumn 卡状态; | ||||
@@ -496,7 +499,5 @@ | |||||
private DataGridViewTextBoxColumn 手机号; | private DataGridViewTextBoxColumn 手机号; | ||||
private DataGridViewTextBoxColumn 卡号; | private DataGridViewTextBoxColumn 卡号; | ||||
private DataGridViewButtonColumn 删除; | private DataGridViewButtonColumn 删除; | ||||
private Button button1; | |||||
private Label label2; | |||||
} | } | ||||
} | } |
@@ -636,37 +636,39 @@ namespace HKCardManager.UserPages | |||||
MessageLogNotify.GetInstance.ShowError("用户名不能为空.请重试!"); | MessageLogNotify.GetInstance.ShowError("用户名不能为空.请重试!"); | ||||
return; | return; | ||||
} | } | ||||
string name=string.Empty; | |||||
bool cxindex = false; | |||||
int index = 0; | |||||
for (int i = 0; i < dataGridView1.Rows.Count; i++) | |||||
var res = HKLibHelper.GetUserListSync(textBox1.Text); | |||||
Global.UserListDtos.Clear(); | |||||
var userinfo = new List<UserInfoModel>(); | |||||
res?.ToList()?.ForEach(item => | |||||
{ | { | ||||
this.dataGridView1.Rows[i].Selected = false; | |||||
var res = dataGridView1.Rows[i].Cells[1].Value?.ToString(); | |||||
if (string.IsNullOrEmpty(res)) | |||||
string status = ""; | |||||
string cardNum = ""; | |||||
if (item.Cards != null && item.Cards.Count > 0) | |||||
{ | { | ||||
MessageBox.Show("用户名无效.请重试!"); | |||||
MessageLogNotify.GetInstance.ShowError("用户名无效"); | |||||
return; | |||||
cardNum = item.Cards.ElementAt(0).CardNum; | |||||
status = ((CarStatus)item.Cards.ElementAt(0).State).ToString(); | |||||
} | } | ||||
if (res.Contains(textBox1.Text)) | |||||
Global.UserListDtos.Add(new UserInfoModel() | |||||
{ | { | ||||
cxindex = true; name = res; | |||||
this.dataGridView1.Rows[i].Selected = true; | |||||
index=i; | |||||
} | |||||
} | |||||
if (cxindex) | |||||
{ | |||||
dataGridView1.CurrentCell = dataGridView1.Rows[index].Cells[1]; | |||||
MessageBox.Show($"用户:【{name}】 查询成功,已定位到该用户!"); | |||||
MessageLogNotify.GetInstance.Show($"用户:【{name}】 查询成功,已定位到该用户!"); | |||||
} else | |||||
Num = item.Num, | |||||
UserName = item.Name, | |||||
Phone = item.Phone, | |||||
OrgName = item.OrgInfo?.Count > 0 ? item.OrgInfo.ElementAt(0).Name : "", | |||||
CardNum = cardNum, | |||||
State = status | |||||
}); | |||||
}); | |||||
for (int i = (currentPageIndex - 1) * pageSize; i < Global.UserListDtos.Count; i++) | |||||
{ | { | ||||
MessageBox.Show($"未查询到用户..."); | |||||
MessageLogNotify.GetInstance.ShowError($"未查询到用户..."); | |||||
if (userinfo.Count < pageSize) | |||||
userinfo.Add(Global.UserListDtos.ElementAt(i)); | |||||
else | |||||
break; | |||||
} | } | ||||
dataGridView1.DataSource = userinfo; | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -247,25 +247,4 @@ | |||||
WSNRerYAAAAASUVORK5CYII= | WSNRerYAAAAASUVORK5CYII= | ||||
</value> | </value> | ||||
</data> | </data> | ||||
<metadata name="编号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||||
<value>True</value> | |||||
</metadata> | |||||
<metadata name="名称.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||||
<value>True</value> | |||||
</metadata> | |||||
<metadata name="卡状态.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||||
<value>True</value> | |||||
</metadata> | |||||
<metadata name="机构.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||||
<value>True</value> | |||||
</metadata> | |||||
<metadata name="手机号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||||
<value>True</value> | |||||
</metadata> | |||||
<metadata name="卡号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||||
<value>True</value> | |||||
</metadata> | |||||
<metadata name="删除.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||||
<value>True</value> | |||||
</metadata> | |||||
</root> | </root> |
@@ -30,6 +30,7 @@ namespace HKCardManager.UserPages | |||||
TotalPage = 0; | TotalPage = 0; | ||||
Total = 0; | Total = 0; | ||||
this.button3.Enabled = false; | this.button3.Enabled = false; | ||||
this.button4.Enabled = false; | |||||
} | } | ||||
@@ -81,12 +82,12 @@ namespace HKCardManager.UserPages | |||||
for (int i = 0; i < TableName.Rows.Count+1; i++) | for (int i = 0; i < TableName.Rows.Count+1; i++) | ||||
{ | { | ||||
RowRead++; | RowRead++; | ||||
Percent = (int)(100 * RowRead / TotalCount); | |||||
Percent = (int)(100 * RowRead / (TotalCount+1)); | |||||
Application.DoEvents(); | Application.DoEvents(); | ||||
string strData = string.Empty; | string strData = string.Empty; | ||||
for (int j = 0; j < TableName.Columns.Count; j++) | for (int j = 0; j < TableName.Columns.Count; j++) | ||||
{ | { | ||||
if (i == TableName.Rows.Count - 1) | |||||
if (i == TableName.Rows.Count) | |||||
{ | { | ||||
if (TableName.Columns[j].Visible && TableName.Columns[j].Name == "早上消费金额") | if (TableName.Columns[j].Visible && TableName.Columns[j].Name == "早上消费金额") | ||||
{ | { | ||||
@@ -116,7 +117,7 @@ namespace HKCardManager.UserPages | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
if (i <= TableName.Rows.Count+1 - 2) | |||||
if (i <= TableName.Rows.Count-1) | |||||
{ | { | ||||
string? res = TableName.Rows[i].Cells[j].Value?.ToString(); | string? res = TableName.Rows[i].Cells[j].Value?.ToString(); | ||||
if (TableName.Columns[j].Visible) | if (TableName.Columns[j].Visible) | ||||
@@ -174,13 +175,14 @@ namespace HKCardManager.UserPages | |||||
TotalPage = Math.Ceiling(Total * 1.0 / PageSize); | TotalPage = Math.Ceiling(Total * 1.0 / PageSize); | ||||
res = res.Skip(0).Take(PageSize).ToList(); | res = res.Skip(0).Take(PageSize).ToList(); | ||||
label1.Text = $"{PageIndex}/{TotalPage}"; | label1.Text = $"{PageIndex}/{TotalPage}"; | ||||
if (res != null) | if (res != null) | ||||
{ | { | ||||
if (res.Count > 0) | if (res.Count > 0) | ||||
{ | { | ||||
this.Invoke(() => | this.Invoke(() => | ||||
{ | { | ||||
this.button3.Enabled = true; | |||||
if (type == 1) | if (type == 1) | ||||
{ | { | ||||
dataGridView1.Columns[0].Visible = true; | dataGridView1.Columns[0].Visible = true; | ||||
@@ -68,20 +68,25 @@ namespace HKLib.Interfaces | |||||
/// </summary> | /// </summary> | ||||
public static async Task<string> SetOrg(string input) | public static async Task<string> SetOrg(string input) | ||||
{ | { | ||||
var data = await IHttpMultiClient.HttpMulti | |||||
.AddHeader(t => t.Headers = Header) | |||||
.AddNode(t => | |||||
{ | |||||
t.NodePath = $"{Configer.SaasRoute}api/one-card/member-tag"; | |||||
t.ReqType = MultiType.POST; | |||||
t.JsonParam = (new { Name = input }).ToJson(); | |||||
}).Build().RunStringFirstAsync(); | |||||
return data.ToModel<JObject>()["data"]["data"]["id"].ToString(); | |||||
try | |||||
{ | |||||
var data = await IHttpMultiClient.HttpMulti.AddHeader(t => t.Headers = Header).AddNode(t => | |||||
{ | |||||
t.NodePath = $"{Configer.SaasRoute}api/one-card/member-tag"; | |||||
t.ReqType = MultiType.POST; | |||||
t.JsonParam = (new { Name = input }).ToJson(); | |||||
}).Build().RunStringFirstAsync(); | |||||
return data.ToModel<JObject>()["data"]["data"]["id"].ToString(); | |||||
} | |||||
catch (System.Exception) | |||||
{ | |||||
return string.Empty; | |||||
} | |||||
} | } | ||||
public static string SetOrgSync(string input) | public static string SetOrgSync(string input) | ||||
{ | { | ||||
var data = IHttpMultiClient.HttpMulti | |||||
var data = IHttpMultiClient.HttpMulti | |||||
.AddHeader(t => t.Headers = Header) | .AddHeader(t => t.Headers = Header) | ||||
.AddNode(t => | .AddNode(t => | ||||
{ | { | ||||
@@ -124,7 +129,7 @@ namespace HKLib.Interfaces | |||||
}).Build().RunStringFirstAsync(); | }).Build().RunStringFirstAsync(); | ||||
if (data.IsNullOrEmpty()) return new List<OrgDto>(); | if (data.IsNullOrEmpty()) return new List<OrgDto>(); | ||||
var model = data.ToModel<JObject>()["data"]["data"].ToJson().ToModel<List<OrgOutDto>>(); | var model = data.ToModel<JObject>()["data"]["data"].ToJson().ToModel<List<OrgOutDto>>(); | ||||
return model.Where(t => !t.Name.IsNullOrEmpty()).Where(t=>!t.Name.Contains("管理员")).Select(t => new OrgDto | |||||
return model.Where(t => !t.Name.IsNullOrEmpty()).Where(t => !t.Name.Contains("管理员")).Select(t => new OrgDto | |||||
{ | { | ||||
Name = t.Name, | Name = t.Name, | ||||
SId = t.Id | SId = t.Id | ||||
@@ -157,11 +162,11 @@ namespace HKLib.Interfaces | |||||
var str = data.ToModel<JObject>()["data"]["data"].ToString(); | var str = data.ToModel<JObject>()["data"]["data"].ToString(); | ||||
var check = str.IsNullOrEmpty(); | var check = str.IsNullOrEmpty(); | ||||
if (check) return "0001"; | if (check) return "0001"; | ||||
return (str.AsInt() + 1).ToString().PadLeft(4, '0'); | |||||
return (str.AsInt() + 1).ToString().PadLeft(4, '0'); | |||||
} | } | ||||
public static string GetUserMaxNumSync() | public static string GetUserMaxNumSync() | ||||
{ | { | ||||
var data = IHttpMultiClient.HttpMulti.AddHeader(t => t.Headers = Header).AddNode(t => | |||||
var data = IHttpMultiClient.HttpMulti.AddHeader(t => t.Headers = Header).AddNode(t => | |||||
{ | { | ||||
t.NodePath = $"{Configer.SaasRoute}api/one-card/max-num"; | t.NodePath = $"{Configer.SaasRoute}api/one-card/max-num"; | ||||
t.ReqType = MultiType.GET; | t.ReqType = MultiType.GET; | ||||
@@ -187,12 +192,12 @@ namespace HKLib.Interfaces | |||||
if (string.IsNullOrEmpty(data)) | if (string.IsNullOrEmpty(data)) | ||||
return new List<UserListDto>(); | return new List<UserListDto>(); | ||||
var res = data.ToModel<JObject>()["data"]["data"].ToJson().ToModel<List<UserListDto>>(); | var res = data.ToModel<JObject>()["data"]["data"].ToJson().ToModel<List<UserListDto>>(); | ||||
return res.Where(t=>!t.Name.Contains("管理员")).OrderByDescending(t=>t.Num).ToList(); | |||||
return res.Where(t => !t.Name.Contains("管理员")).OrderByDescending(t => t.Num).ToList(); | |||||
} | } | ||||
public static List<UserListDto> GetUserListSync(string keyword) | public static List<UserListDto> GetUserListSync(string keyword) | ||||
{ | { | ||||
var data = IHttpMultiClient.HttpMulti.AddHeader(t => t.Headers = Header).AddNode(t => | |||||
var data = IHttpMultiClient.HttpMulti.AddHeader(t => t.Headers = Header).AddNode(t => | |||||
{ | { | ||||
t.NodePath = $"{Configer.SaasRoute}api/one-card/staff-list"; | t.NodePath = $"{Configer.SaasRoute}api/one-card/staff-list"; | ||||
t.ReqType = MultiType.POST; | t.ReqType = MultiType.POST; | ||||
@@ -215,11 +220,14 @@ namespace HKLib.Interfaces | |||||
{ | { | ||||
t.NodePath = $"{Configer.SaasRoute}api/one-card/mmenber-card"; | t.NodePath = $"{Configer.SaasRoute}api/one-card/mmenber-card"; | ||||
t.ReqType = MultiType.POST; | t.ReqType = MultiType.POST; | ||||
t.JsonParam = (new { tagId = input.OrgId, | |||||
realName = input.Name, | |||||
num=input.Num, | |||||
phone = input.Phone, | |||||
cardNum = input.CardNo }).ToJson(); | |||||
t.JsonParam = (new | |||||
{ | |||||
tagId = input.OrgId, | |||||
realName = input.Name, | |||||
num = input.Num, | |||||
phone = input.Phone, | |||||
cardNum = input.CardNo | |||||
}).ToJson(); | |||||
}).Build().RunStringFirstAsync(); | }).Build().RunStringFirstAsync(); | ||||
return data.ToModel<JObject>()["data"]["isSuccess"].ToString().AsBool(); | return data.ToModel<JObject>()["data"]["isSuccess"].ToString().AsBool(); | ||||
@@ -249,14 +257,14 @@ namespace HKLib.Interfaces | |||||
{ | { | ||||
t.NodePath = $"{Configer.SaasRoute}api/one-card/staff"; | t.NodePath = $"{Configer.SaasRoute}api/one-card/staff"; | ||||
t.ReqType = MultiType.POST; | t.ReqType = MultiType.POST; | ||||
t.JsonParam = (new { tagId = input.OrgId, realName = input.Name, phone = input.Phone,num=input.Num }).ToJson(); | |||||
t.JsonParam = (new { tagId = input.OrgId, realName = input.Name, phone = input.Phone, num = input.Num }).ToJson(); | |||||
}).Build().RunStringFirstAsync(); | }).Build().RunStringFirstAsync(); | ||||
return data.ToModel<JObject>()["data"]["isSuccess"].ToString().AsBool(); | return data.ToModel<JObject>()["data"]["isSuccess"].ToString().AsBool(); | ||||
} | } | ||||
public static bool AddUserSync(UserDto input) | public static bool AddUserSync(UserDto input) | ||||
{ | { | ||||
var data = IHttpMultiClient.HttpMulti.AddHeader(t => t.Headers = Header).AddNode(t => | |||||
var data = IHttpMultiClient.HttpMulti.AddHeader(t => t.Headers = Header).AddNode(t => | |||||
{ | { | ||||
t.NodePath = $"{Configer.SaasRoute}api/one-card/staff"; | t.NodePath = $"{Configer.SaasRoute}api/one-card/staff"; | ||||
t.ReqType = MultiType.POST; | t.ReqType = MultiType.POST; | ||||