You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CardView.xaml.cs 1.3 KiB

2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using HKCardIN.Logic;
  2. using HKCardIN.Logic.Model;
  3. using HKLog;
  4. using System.Text.RegularExpressions;
  5. using System.Windows;
  6. using UHFHelper;
  7. using XExten.Advance.LinqFramework;
  8. namespace HKCardIN.Views
  9. {
  10. /// <summary>
  11. /// CardView.xaml 的交互逻辑
  12. /// </summary>
  13. public partial class CardView : System.Windows.Window
  14. {
  15. UserAndCardInfo info;
  16. public CardView()
  17. {
  18. InitializeComponent();
  19. }
  20. private void QueryClick(object sender, RoutedEventArgs e)
  21. {
  22. if (this.Phone.Text.IsNullOrEmpty()) HandyControl.Controls.Growl.InfoGlobal("手机号不能为空!");
  23. if (!Regex.IsMatch(this.Phone.Text, "\\d{11}")) HandyControl.Controls.Growl.InfoGlobal("请输入正确的手机号!");
  24. info = BaseLogic.GetInstance().GetCardNoByPhone(Phone.Text);
  25. if (info != null)
  26. //查询接口
  27. Create.IsEnabled = true;
  28. }
  29. private void CreateClick(object sender, RoutedEventArgs e)
  30. {
  31. if (info.CardNum == null) return;
  32. var res = UHFCardHelper.GetInstance().WriteCard(info.CardNum);
  33. HKLogImport.WriteInfo(res.ResMes);
  34. DialogResult = true;
  35. Close();
  36. }
  37. }
  38. }