InventoryView.cs 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ComponentModel;
  6. using System.ComponentModel.DataAnnotations;
  7. using EMIS.ViewModel.Cultureplan;
  8. using EMIS.Entities;
  9. using EMIS.ViewModel.CacheManage;
  10. namespace EMIS.ViewModel.TeachingMaterial
  11. {
  12. [Serializable]
  13. public class InventoryView
  14. {
  15. /// <summary>
  16. /// 教材ID
  17. /// </summary>
  18. [DisplayName("教材ID")]
  19. public Guid TeachingMaterialPoolID { get; set; }
  20. /// <summary>
  21. /// 库存ID
  22. /// </summary>
  23. [DisplayName("库存ID")]
  24. public Guid TeachingMateriaInventoryID { get; set; }
  25. /// <summary>
  26. /// 出库ID
  27. /// </summary>
  28. [DisplayName("出库ID")]
  29. public Guid StockOutID { get; set; }
  30. /// <summary>
  31. /// 入库ID
  32. /// </summary>
  33. [DisplayName("入库ID")]
  34. public Guid StockInID { get; set; }
  35. /// <summary>
  36. /// 教材编号
  37. /// </summary>
  38. /// [Required]
  39. [DisplayName("教材编号")]
  40. [Required]
  41. public string TeachingMaterialCode { get; set; }
  42. /// <summary>
  43. /// 教材名称
  44. /// </summary>
  45. [DisplayName("教材名称")]
  46. [Required]
  47. public string TeachingMaterialName { get; set; }
  48. /// <summary>
  49. /// 书库编号
  50. /// </summary>
  51. public string LibraryCode { get; set; }
  52. /// <summary>
  53. /// 书库名称
  54. /// </summary>
  55. public string LibraryName { get; set; }
  56. /// <summary>
  57. /// 教材名称
  58. /// </summary>
  59. [DisplayName("教材简称")]
  60. [Required]
  61. public string TeachingMaterialShorName { get; set; }
  62. /// <summary>
  63. /// 学年学期
  64. /// </summary>
  65. [DisplayName("学年学期")]
  66. public string SchoolYearName { get; set; }
  67. /// <summary>
  68. /// 学年学期ID
  69. /// </summary>
  70. [DisplayName("学年学期ID")]
  71. public Guid SchoolYearID { get; set; }
  72. /// <summary>
  73. /// 课程ID
  74. /// </summary>
  75. [DisplayName("课程")]
  76. public HashSet<EM_Coursematerial> CoursematerialEntityList { get; set; }
  77. /// <summary>
  78. /// 课程名称
  79. /// </summary>
  80. [DisplayName("课程名称")]
  81. [Required]
  82. public string CoursematerialName
  83. {
  84. get
  85. {
  86. return string.Join(",", CoursematerialEntityList.Select(x => x.CourseName));
  87. }
  88. }
  89. /// <summary>
  90. /// 课程代码
  91. /// </summary>
  92. [DisplayName("课程代码")]
  93. public string CoursematerialCode
  94. {
  95. get
  96. {
  97. return string.Join(",", CoursematerialEntityList.Select(x => x.CourseCode));
  98. }
  99. }
  100. /// <summary>
  101. /// ISBN
  102. /// </summary>
  103. [DisplayName("ISBN")]
  104. [Required]
  105. public string ISBN { get; set; }
  106. /// <summary>
  107. ///教材类型
  108. /// </summary>
  109. [DisplayName("教材类型")]
  110. [Required]
  111. public int? TeachingMaterialTypeID { get; set; }
  112. /// <summary>
  113. ///教材类型
  114. /// </summary>
  115. [DisplayName("教材类型")]
  116. public string TeachingMaterialTypeName
  117. {
  118. get
  119. {
  120. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_TeachingMaterialType.ToString())
  121. .Where(x => x.Value == TeachingMaterialTypeID)
  122. .Select(x => x.Name).FirstOrDefault();
  123. }
  124. }
  125. /// <summary>
  126. /// 获奖级别
  127. /// </summary>
  128. [DisplayName("获奖级别")]
  129. [Required]
  130. public int? WnningLevel { get; set; }
  131. /// <summary>
  132. /// 获奖级别
  133. /// </summary>
  134. [DisplayName("获奖级别")]
  135. public string WnningLevelName { get; set; }
  136. /// <summary>
  137. /// 版本时间
  138. /// </summary>
  139. [DisplayName("版本时间")]
  140. [Required]
  141. public string PublishTime { get; set; }
  142. /// <summary>
  143. /// 出版单位ID
  144. /// </summary>
  145. [DisplayName("出版单位ID")]
  146. public Guid? PublishID { get; set; }
  147. /// <summary>
  148. /// 出版单位
  149. /// </summary>
  150. [DisplayName("出版单位")]
  151. public string PublishName { get; set; }
  152. /// <summary>
  153. /// 作者
  154. /// </summary>
  155. [DisplayName("作者")]
  156. [Required]
  157. public string Author { get; set; }
  158. /// <summary>
  159. /// 单价
  160. /// </summary>
  161. [DisplayName("单价")]
  162. [Required]
  163. public decimal? Price { get; set; }
  164. /// <summary>
  165. /// 是否过期
  166. /// </summary>
  167. [DisplayName("是否过期")]
  168. [Required]
  169. public bool IsLate { get; set; }
  170. /// <summary>
  171. /// 是否过期
  172. /// </summary>
  173. public string IsLateName { get; set; }
  174. /// <summary>
  175. /// 备注
  176. /// </summary>
  177. [DisplayName("备注")]
  178. public string Desc { get; set; }
  179. /// <summary>
  180. /// 创建时间
  181. /// </summary>
  182. [DisplayName("创建时间")]
  183. public DateTime? CreateTime { get; set; }
  184. /// <summary>
  185. /// 创建人
  186. /// </summary>
  187. [DisplayName("创建人")]
  188. public string CreateUserName { get; set; }
  189. /// <summary>
  190. /// 修改时间
  191. /// </summary>
  192. [DisplayName("修改时间")]
  193. public DateTime? ModifyTime { get; set; }
  194. /// <summary>
  195. /// 修改人
  196. /// </summary>
  197. [DisplayName("修改人")]
  198. public string ModifyUserName { get; set; }
  199. /// <summary>
  200. /// 征订数量(用于教师征订)
  201. /// </summary>
  202. [DisplayName("征订数量")]
  203. public int? OrderQty { get; set; }
  204. /// <summary>
  205. /// 课程级别(用于学生征订)
  206. /// </summary>
  207. [DisplayName("课程级别")]
  208. public string CourseLevelName { get; set; }
  209. /// <summary>
  210. /// 课程科类(用于学生征订)
  211. /// </summary>
  212. [DisplayName("课程科类")]
  213. public string CourseScienceName { get; set; }
  214. /// <summary>
  215. /// 最小库存量
  216. /// </summary>
  217. [DisplayName("最小库存量")]
  218. public int? MinInventory { get; set; }
  219. /// <summary>
  220. /// 当前库存量
  221. /// </summary>
  222. [DisplayName("当前库存量")]
  223. public int? PresentInventory { get; set; }
  224. /// <summary>
  225. /// 库存编号
  226. /// </summary>
  227. [DisplayName("库存编号(出库入库编号)")]
  228. public string InventoryCode { get; set; }
  229. /// <summary>
  230. /// 折扣率
  231. /// </summary>
  232. [DisplayName("折扣率")]
  233. [Required]
  234. [RegularExpression(@"[\d]?(\.[\d]{0,2})?", ErrorMessage = "必须填写小数值")]
  235. public decimal? Discount { get; set; }
  236. /// <summary>
  237. /// 折合价
  238. /// </summary>
  239. [DisplayName("折合价")]
  240. public decimal? DiscountPrice { get; set; }
  241. /// <summary>
  242. /// 码洋
  243. /// </summary>
  244. [DisplayName("码洋")]
  245. public decimal? Total { get; set; }
  246. /// <summary>
  247. /// 实洋
  248. /// </summary>
  249. [DisplayName("实洋")]
  250. public decimal? TotalDollar { get; set; }
  251. /// <summary>
  252. /// 入库数量
  253. /// </summary>
  254. [DisplayName("入库数量")]
  255. public int? StockInQty { get; set; }
  256. /// <summary>
  257. /// 出库数量
  258. /// </summary>
  259. [DisplayName("出库数量")]
  260. public int? StockOutQty { get; set; }
  261. /// <summary>
  262. /// 下半年出库数量
  263. /// </summary>
  264. [DisplayName("下半年出库数量")]
  265. public int? TopStockOutQty { get; set; }
  266. /// <summary>
  267. /// 下半年入库数量
  268. /// </summary>
  269. [DisplayName("下半年入库数量")]
  270. public int? TopStockInQty { get; set; }
  271. /// <summary>
  272. /// 原库存量
  273. /// </summary>
  274. [DisplayName("原库存量")]
  275. public int? InventoryCollectQty { get; set; }
  276. /// <summary>
  277. /// 原库存数量
  278. /// </summary>
  279. [DisplayName("原库存数量")]
  280. public int? InventoryCollectQtyStr
  281. {
  282. get
  283. {
  284. if (InventoryCollectQty < 0 || InventoryCollectQty == null)
  285. {
  286. return 0;
  287. }
  288. return InventoryCollectQty == null ? 0 : InventoryCollectQty;
  289. }
  290. }
  291. }
  292. }