UIBuckAuthorizeFund.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace DataManager
  11. {
  12. public partial class UIBuckAuthorizeFund : Form
  13. {
  14. private int userId;
  15. public int UserId { get => userId; set => userId = value; }
  16. public UIBuckAuthorizeFund(int userId)
  17. {
  18. this.userId = userId;
  19. InitializeComponent();
  20. }
  21. private void btnBuckAuthorizeFund_Click(object sender, EventArgs e)
  22. {
  23. string s = txtFundIds.Text.Trim().ToUpper();
  24. string[] ids = s.Split(',');
  25. List<string> errIds = new List<string> { };
  26. foreach (string id in ids)
  27. {
  28. if (id.Length != 6) errIds.Add(id);
  29. }
  30. if (errIds.Count > 0)
  31. {
  32. MessageBox.Show("这些备案编码有问题:" + string.Join(",", errIds), "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
  33. txtFundIds.Focus();
  34. }
  35. else
  36. {
  37. int ret = DataAccess.Set_dm_fund_authorization(s, 1, UserId);
  38. MessageBox.Show(ret < 0 ? "通知程序员存盘有问题" : "批量导入成功", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
  39. }
  40. }
  41. }
  42. }