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.

CancellationPage.cs 2.0 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using HKLib.Dto;
  2. using HKLib.Interfaces;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. using BPA.Helper;
  13. namespace HKCardManager.UserPages
  14. {
  15. public partial class CancellationPage : UserControl
  16. {
  17. public CancellationPage()
  18. {
  19. InitializeComponent();
  20. //this.SizeChanged += CancellationPage_SizeChanged;
  21. }
  22. //private void CancellationPage_SizeChanged(object? sender, EventArgs e)
  23. //{
  24. // panel1.Left = (this.Width - panel1.Width) / 2;
  25. // panel1.Top = (this.Height - panel1.Height) / 2;
  26. //}
  27. private void button2_Click(object sender, EventArgs e)
  28. {
  29. string name = textBox1.Text.Trim();
  30. if (string.IsNullOrEmpty(name))
  31. {
  32. MessageLogNotify.GetInstance.Show("请输入用户名");
  33. return;
  34. }
  35. string TagName = this.Tag.ToString();
  36. if (string.IsNullOrEmpty(TagName))
  37. {
  38. MessageLogNotify.GetInstance.Show("功能名称为空,操作失败,请重试");
  39. }
  40. else
  41. {
  42. int status = 0;
  43. if (TagName == "销户") status = 3;
  44. else if (TagName == "挂失") status = 2;
  45. else if (TagName == "解挂") status = 1;
  46. Task.Factory.StartNew(() =>
  47. {
  48. var res = HKLibHelper.CardStutasChange(new CardStutasDto()
  49. {
  50. keywrod = name,
  51. Stutas = status
  52. });
  53. if (res) MessageLogNotify.GetInstance.Show($"用户 {TagName} 成功");
  54. else MessageLogNotify.GetInstance.Show($"用户 {TagName} 失败,请重试");
  55. });
  56. }
  57. }
  58. }
  59. }