diff --git a/HKCardManager/UserPages/CancellationPage.cs b/HKCardManager/UserPages/CancellationPage.cs index faf2849..190d8cb 100644 --- a/HKCardManager/UserPages/CancellationPage.cs +++ b/HKCardManager/UserPages/CancellationPage.cs @@ -61,8 +61,8 @@ namespace HKCardManager.UserPages keywrod = name, Stutas = status }); - if (res) MessageLogNotify.GetInstance.Show($"用户 {TagName} 成功"); - else MessageLogNotify.GetInstance.ShowError($"用户 {TagName} 失败,请检查名称是否正常"); + if (res) MessageLogNotify.GetInstance.Show($"用户【{temp.UserName}】 {TagName} 成功"); + else MessageLogNotify.GetInstance.ShowError($"用户【{temp.UserName}】 {TagName} 失败,请检查名称是否正常"); } else { diff --git a/HKCardManager/UserPages/CarMangerPage.cs b/HKCardManager/UserPages/CarMangerPage.cs index f2a1000..81579c6 100644 --- a/HKCardManager/UserPages/CarMangerPage.cs +++ b/HKCardManager/UserPages/CarMangerPage.cs @@ -12,6 +12,7 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows.Forms; using UHFHelper; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; namespace HKCardManager.UserPages { @@ -120,7 +121,7 @@ namespace HKCardManager.UserPages comboBox2.Visible = true; comboBox2.Enabled = true; //textBox4.Enabled = false; - //comboBox1.Enabled = false; + comboBox1.Enabled = false; var user = Global.UserListDtos.FirstOrDefault(p => !string.IsNullOrEmpty(comboBox2.Text.Trim()) && !string.IsNullOrEmpty(p.UserName) && p.UserName == comboBox2.Text.Trim()); if (user != null && !string.IsNullOrEmpty(user.Phone)) { @@ -163,7 +164,12 @@ namespace HKCardManager.UserPages MessageLogNotify.GetInstance.ShowWarning("请输入姓名"); return; } - Name = textBox2.Text.Trim(); + if (HKLibHelper.GetUserList(textBox2.Text.Trim()).Count > 0) + { + MessageLogNotify.GetInstance.ShowWarning("用户已经存在,请勿重复添加"); + return; + } + Name = textBox2.Text.Trim(); } //if (!textBox4.Text.Trim().IsMobile()) //{ @@ -237,7 +243,7 @@ namespace HKCardManager.UserPages comboBox1.Text = users.OrgInfo.ElementAt(0).Name; } }); - MessageLogNotify.GetInstance.Show("读卡成功,详细信息请在页面查看"); + MessageLogNotify.GetInstance.Show($"读卡成功,当前卡号【{res}】,详细信息请在页面查看"); } else { diff --git a/HKCardManager/UserPages/PersonnelEntryPage.cs b/HKCardManager/UserPages/PersonnelEntryPage.cs index dae738d..5b82fbd 100644 --- a/HKCardManager/UserPages/PersonnelEntryPage.cs +++ b/HKCardManager/UserPages/PersonnelEntryPage.cs @@ -110,6 +110,14 @@ namespace HKCardManager.UserPages MessageLogNotify.GetInstance.ShowWarning("请输入姓名"); return; } + + if (HKLibHelper.GetUserList(textBox1.Text.Trim()).Count >0) + { + MessageLogNotify.GetInstance.ShowWarning("用户已经存在,请勿重复添加"); + return; + } + + //if (!string.IsNullOrEmpty(textBox2.Text.Trim())) //{ // if (!textBox2.Text.Trim().IsMobile()) diff --git a/HKLib/Interfaces/HKLibHelper.cs b/HKLib/Interfaces/HKLibHelper.cs index 356abe1..51ec83f 100644 --- a/HKLib/Interfaces/HKLibHelper.cs +++ b/HKLib/Interfaces/HKLibHelper.cs @@ -120,12 +120,15 @@ namespace HKLib.Interfaces /// public static bool AlterOrg(string input, string Sid) { - return IHttpMultiClient.HttpMulti.AddHeader(t => t.Headers = Header).AddNode(t => + var param = (new { Name = input, Id = Sid }).ToJson(); + var data = IHttpMultiClient.HttpMulti.AddHeader(t => t.Headers = Header).AddNode(t => { t.NodePath = $"{Configer.SaasRoute}api/one-card/member-tag"; t.ReqType = MultiType.PUT; - t.JsonParam = (new { Name = input, Id = Sid }).ToJson(); - }).Build().RunStringFirst().ToModel()["data"]["isSuccess"].ToString().AsBool(); + t.JsonParam = param; + }).Build().RunStringFirst(); + + return data.ToModel()["data"]["isSuccess"].ToString().AsBool(); } ///