WD_StaffInfoBusinessLogic.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using HNWD.Pregrant.Model;
  7. using HNWD.Pregrant.DataAccess;
  8. namespace HNWD.Pregrant.BusinessLogic
  9. {
  10. public class WD_StaffInfoBusinessLogic : BusinessLogicBase2<WD_StaffInfo>
  11. {
  12. private string id = string.Empty;
  13. public WD_StaffInfoBusinessLogic(string id)
  14. : base()
  15. {
  16. this.id = id;
  17. }
  18. public WD_StaffInfoExt QueryAll()
  19. {
  20. this.wd_StaffInfoDataAccess.QueryAll();
  21. return this.wd_StaffInfoDataAccess.ext;
  22. }
  23. public override ModelExtBase<WD_StaffInfo> Query(string patientid)
  24. {
  25. this.wd_StaffInfoDataAccess.QueryAll();
  26. this.wd_StaffInfoDataAccess.ext.messageDataList = this.wd_StaffInfoDataAccess.ext.messageDataList.FindAll(f => f.ID == this.id).ToList();
  27. return this.wd_StaffInfoDataAccess.ext;
  28. }
  29. public override ModelBase Business(string data)
  30. {
  31. base.Business(data);
  32. this.wd_StaffInfoDataAccess.Business(this.insert_list, update_list, delete_list);
  33. return this.DefaultReturn();
  34. }
  35. protected override void Dispatch(string data)
  36. {
  37. if(data.Length == 0)
  38. {
  39. this.bSuccess = false;
  40. this.Message = "传入数据长度必须大于0";
  41. return;
  42. }
  43. string[] items = data.Split(new char[]{'$'});
  44. foreach(string item in items)
  45. {
  46. string[] subitems = item.Split(new char[]{'@'});
  47. WD_StaffInfo wd_StaffInfo = new WD_StaffInfo()
  48. {
  49. ID = subitems[1],
  50. STAFF_ID = subitems[2],
  51. STAFF_PASSWORDCARD = subitems[3],
  52. STAFF_NAME = subitems[4],
  53. STAFF_NAME_PY = subitems[5],
  54. STAFF_TYPE = subitems[6],
  55. STAFF_SEX = subitems[7],
  56. STAFF_BIRTHDAY = subitems[8],
  57. STAFF_IDCARD = subitems[9],
  58. STAFF_WORKDATE = subitems[10],
  59. STAFF_PICTURE = subitems[11],
  60. STAFF_WORKTEL = subitems[12],
  61. STAFF_MOBILE = subitems[13],
  62. STAFF_CONTENT = subitems[14],
  63. STAFF_DUTY = subitems[15],
  64. STAFF_DATETIME = subitems[16],
  65. };
  66. if(subitems[0].ToLower() == "i")
  67. {
  68. this.insert_list.Add(wd_StaffInfo);
  69. }
  70. if (subitems[0].ToLower() == "u")
  71. {
  72. this.update_list.Add(wd_StaffInfo);
  73. }
  74. if (subitems[0].ToLower() == "d")
  75. {
  76. this.delete_list.Add(wd_StaffInfo);
  77. }
  78. }
  79. }
  80. }
  81. }