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.

62 lines
2.0 KiB

  1. using HKHelper;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. namespace HKCardManager.Message
  12. {
  13. public partial class MessageShow : Form
  14. {
  15. public MessageShow(Dictionary<string, List<UserDtoModel>> RrrorUser)
  16. {
  17. InitializeComponent();
  18. string message = string.Empty;
  19. string sucess=string.Empty;
  20. string message1=string.Empty;
  21. foreach (var item in RrrorUser)
  22. {
  23. if (item.Value.Count > 0)
  24. {
  25. if (item.Key == "成功")
  26. {
  27. (item.Value as List<UserDtoModel>)?.ForEach(par =>
  28. {
  29. sucess += "[" + par.OrgId + "-" + "" + par.Name + "],";
  30. });
  31. }
  32. else
  33. {
  34. message += item.Key + "列表:\r\n";
  35. message1 += "\r\n\r\n姓名集合:\r\n";
  36. (item.Value as List<UserDtoModel>)?.ForEach(par =>
  37. {
  38. message += "[" + par.OrgId + "-" + "" + par.Name + "],";
  39. message1 += par.Name + ",";
  40. });
  41. }
  42. }
  43. }
  44. label1.Text = $"批量录入成功!成功:{RrrorUser["成功"].Count} 条 失败:{(RrrorUser["名字重复"].Count + RrrorUser["机构不存在"].Count + RrrorUser["添加出错"].Count)} 条";
  45. textBox1.Text= sucess.TrimEnd(',');
  46. textBox3.Text = message.TrimEnd(',')+ message1.TrimEnd(',');
  47. }
  48. private void button_ok_Click(object sender, EventArgs e)
  49. {
  50. this.Close();
  51. }
  52. private void button_esc_Click(object sender, EventArgs e)
  53. {
  54. this.Close();
  55. }
  56. }
  57. }