選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

139 行
2.6 KiB

  1. /* Describtion : Class for Data Send From Client / Server
  2. * Company : Wuxi Xinje
  3. * Author : Somuns
  4. * DateTime : 2021/1/18
  5. */
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Data;
  9. namespace StuMgmLib.MyNameSpace
  10. {
  11. public class Info
  12. {
  13. internal const Int16 tokenMaxCount = 32767;
  14. internal static Dictionary<short, int> myToken = new Dictionary<short, int>();
  15. }
  16. #region ClientClass
  17. public enum ClientFunc
  18. {
  19. VerifyLogin = 1,
  20. GetCourseInfo = 2,
  21. GetUserCourseInfo = 3,
  22. SUpdateCourse = 4,
  23. TUpdateCourse = 5,
  24. }
  25. public enum Lvl
  26. {
  27. NotFound = -1,
  28. Error = -2,
  29. Admin = 1,
  30. Teacher = 2,
  31. Student = 3,
  32. }
  33. [Serializable]
  34. public class ClientRequest
  35. {
  36. public ClientFunc Func;
  37. public object Object;
  38. public ClientRequest(ClientFunc func, object obj)
  39. {
  40. Func = func;
  41. Object = obj;
  42. }
  43. }
  44. [Serializable]
  45. public class UserInfoLogin
  46. {
  47. public short Account;
  48. public string Password;
  49. public UserInfoLogin(short account, string password) // Changed
  50. {
  51. Account = account;
  52. Password = password;
  53. }
  54. }
  55. [Serializable]
  56. public class UserCourseInfoReq
  57. {
  58. public short Job_Id;
  59. public int Token;
  60. }
  61. [Serializable]
  62. public class UserCourseInfoOper // T represents teacher, S ->student
  63. {
  64. public short Job_Id;
  65. public int Token;
  66. public string sqlStr;
  67. }
  68. [Serializable]
  69. public enum CourseStatusEnum
  70. {
  71. //lll,
  72. //...//
  73. }
  74. #endregion
  75. #region ServerClass
  76. [Serializable]
  77. public class ServerResponse
  78. {
  79. public object Object;
  80. public ServerResponse(object obj)
  81. {
  82. Object = obj;
  83. }
  84. }
  85. [Serializable]
  86. public class LoginResponse
  87. {
  88. public int Token;
  89. public Lvl Level;
  90. public bool Final;
  91. }
  92. [Serializable]
  93. public class CourseInfo
  94. {
  95. public short Id;
  96. public short Pid;
  97. public int Time;
  98. public string Name;
  99. public string Content;
  100. }
  101. [Serializable]
  102. public class UserCourseInfo
  103. {
  104. public short JobId;//工号
  105. public string Name;//姓名
  106. public string Status;
  107. // ..public DateTime Entry;
  108. public string Details;//信息描述
  109. }
  110. [Serializable]
  111. public class UpdateRp // 数据库操作反馈信息
  112. {
  113. public bool Final;
  114. public string ErrMessge;
  115. #endregion
  116. }
  117. }