Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

98 lignes
2.2 KiB

  1. using HKLib.Dto;
  2. using HKLib.Interfaces;
  3. using HKLib.Logic;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Data;
  8. using System.Drawing;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using System.Windows.Forms;
  13. namespace HKCardManager
  14. {
  15. public partial class PersonnelEntry : Form
  16. {
  17. List<string> OrgList = new List<string>();
  18. public PersonnelEntry()
  19. {
  20. InitializeComponent();
  21. comboBox1.SelectedIndex = 0;
  22. ServiceHandler.GetOrgList()?.ForEach(item =>
  23. {
  24. OrgList.Add(item.Name);
  25. });
  26. comboBox2.DataSource = OrgList;
  27. }
  28. private void button1_Click(object sender, EventArgs e)
  29. {
  30. this.Close();
  31. }
  32. private void button2_Click(object sender, EventArgs e)
  33. {
  34. if (string.IsNullOrEmpty(textBox1.Text.Trim()))
  35. {
  36. label5.Text = "请输入姓名";
  37. return;
  38. }
  39. if (!textBox2.Text.Trim().IsMobile())
  40. {
  41. label5.Text = "手机号格式不正确";
  42. return;
  43. }
  44. UserDto userDto = new UserDto()
  45. {
  46. Name = textBox1.Text.Trim(),
  47. //Org = comboBox2.SelectedText,
  48. Phone = textBox2.Text.Trim(),
  49. };
  50. Task.Factory.StartNew(() => { HKLibHelper.AddUser(userDto); });
  51. }
  52. private void textBox2_TextChanged(object sender, EventArgs e)
  53. {
  54. }
  55. private void label4_Click(object sender, EventArgs e)
  56. {
  57. }
  58. private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
  59. {
  60. }
  61. private void label3_Click(object sender, EventArgs e)
  62. {
  63. }
  64. private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  65. {
  66. }
  67. private void label2_Click(object sender, EventArgs e)
  68. {
  69. }
  70. private void textBox1_TextChanged(object sender, EventArgs e)
  71. {
  72. }
  73. private void label1_Click(object sender, EventArgs e)
  74. {
  75. }
  76. }
  77. }