CollectionTask.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using MySqlX.Serialization;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel.Design;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using static Mysqlx.Crud.UpdateOperation.Types;
  9. namespace DataManager
  10. {
  11. public class CollectionTask
  12. {
  13. private int userId; // 当前用户,注意:TA未必是任务所分配的用户
  14. private int taskId;
  15. private string providerId;
  16. private string providerName;
  17. private DateTime taskDate;
  18. private short taskType;
  19. private string entityId;
  20. private string entityName;
  21. private string errMessage;
  22. private sbyte isvalid;
  23. private int? creatorId;
  24. private string creatorName;
  25. private DateTime? createTime;
  26. private int? updatorId;
  27. private string updaterName;
  28. private DateTime? updateTime;
  29. public CollectionTask() { }
  30. public CollectionTask(int userId, int taskId, string providerId, string providerName, DateTime taskDate, short taskType,
  31. string entityId, string entityName,
  32. string errMessage, sbyte isvalid,
  33. int? creatorId, string creatorName, DateTime? createTime,
  34. int? updatorId, string updaterName, DateTime? updateTime)
  35. {
  36. UserId = userId;
  37. TaskId = taskId;
  38. ProviderId = providerId;
  39. ProviderName = providerName;
  40. TaskDate = taskDate;
  41. TaskType = taskType;
  42. EntityId = entityId;
  43. EntityName = entityName;
  44. ErrMessage = errMessage;
  45. Isvalid = isvalid;
  46. CreatorId = creatorId;
  47. CreatorName = creatorName;
  48. CreateTime = createTime;
  49. UpdatorId = updatorId;
  50. UpdaterName = updaterName;
  51. UpdateTime = updateTime;
  52. }
  53. public int SaveToSQL(int userId)
  54. {
  55. int task_id = 0;
  56. DataAccess.Set_dm_collection_task(taskId, providerId, taskDate, taskType, entityId, errMessage, isvalid, userId, out task_id);
  57. return task_id;
  58. }
  59. public int UserId { get => userId; set => userId = value; }
  60. public int TaskId { get => taskId; set => taskId = value; }
  61. public string ProviderId { get => providerId; set => providerId = value; }
  62. public string ProviderName { get => providerName; set => providerName = value; }
  63. public DateTime TaskDate { get => taskDate; set => taskDate = value; }
  64. public short TaskType { get => taskType; set => taskType = value; }
  65. public string EntityId { get => entityId; set => entityId = value; }
  66. public string EntityName { get => entityName; set => entityName = value; }
  67. public string ErrMessage { get => errMessage; set => errMessage = value; }
  68. public sbyte Isvalid { get => isvalid; set => isvalid = value; }
  69. public int? CreatorId { get => creatorId; set => creatorId = value; }
  70. public string CreatorName { get => creatorName; set => creatorName = value; }
  71. public DateTime? CreateTime { get => createTime; set => createTime = value; }
  72. public int? UpdatorId { get => updatorId; set => updatorId = value; }
  73. public string UpdaterName { get => updaterName; set => updaterName = value; }
  74. public DateTime? UpdateTime { get => updateTime; set => updateTime = value; }
  75. }
  76. }