StockInView.cs 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. using EMIS.ViewModel.CacheManage;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.Linq;
  7. using System.Text;
  8. namespace EMIS.ViewModel.TeachingMaterial
  9. {
  10. [Serializable]
  11. public class StockInView
  12. {
  13. /// <summary>
  14. /// 教材入库ID
  15. /// </summary>
  16. [DisplayName("教材入库ID")]
  17. public Guid StockInID { get; set; }
  18. /// <summary>
  19. /// 教材信息ID
  20. /// </summary>
  21. [DisplayName("教材信息ID")]
  22. public Guid TeachingMaterialPoolID { get; set; }
  23. /// <summary>
  24. /// 入库明细ID
  25. /// </summary>
  26. [DisplayName("入库明细ID")]
  27. public Guid StockInDetailID { get; set; }
  28. /// <summary>
  29. /// 学年学期
  30. /// </summary>
  31. [DisplayName("学年学期")]
  32. [Required]
  33. public Guid? SchoolyearID { get; set; }
  34. /// <summary>
  35. /// 学年学期
  36. /// </summary>
  37. [DisplayName("学年学期")]
  38. [Required]
  39. public string SchoolyearName { get; set; }
  40. /// <summary>
  41. /// 入库单据号
  42. /// </summary>
  43. /// [Required]
  44. [DisplayName("入库单据号")]
  45. [Required]
  46. public string StockInDocumentNo { get; set; }
  47. /// <summary>
  48. /// 入库编号
  49. /// </summary>
  50. /// [Required]
  51. [DisplayName("入库编号")]
  52. public string StockInNumber { get; set; }
  53. /// <summary>
  54. /// 订单号
  55. /// </summary>
  56. [DisplayName("订单号")]
  57. public string OrdersNo { get; set; }
  58. /// <summary>
  59. /// 入库单据时间
  60. /// </summary>
  61. [DisplayName("入库单据时间")]
  62. [Required]
  63. public DateTime? StockInDJTime { get; set; }
  64. /// <summary>
  65. /// 入库总金额
  66. /// </summary>
  67. [DisplayName("入库总金额")]
  68. public decimal? StockInSumMoney { get; set; }
  69. /// <summary>
  70. /// 书库ID
  71. /// </summary>
  72. [DisplayName("书库ID")]
  73. public Guid LibraryID { get; set; }
  74. /// <summary>
  75. /// 书库编号
  76. /// </summary>
  77. [DisplayName("书库编号")]
  78. public string RoomNumber { get; set; }
  79. /// <summary>
  80. /// 书库名称
  81. /// </summary>
  82. [DisplayName("书库名称")]
  83. public string LibraryName { get; set; }
  84. /// <summary>
  85. /// 教材编号
  86. /// </summary>
  87. [DisplayName("教材编号")]
  88. public string TeachingMaterialCode { get; set; }
  89. /// <summary>
  90. /// 教材名称
  91. /// </summary>
  92. [DisplayName("教材名称")]
  93. public string TeachingMaterialName { get; set; }
  94. /// <summary>
  95. ///教材类型
  96. /// </summary>
  97. [DisplayName("教材类型")]
  98. public int? TeachingMaterialTypeID { get; set; }
  99. /// <summary>
  100. ///教材类型
  101. /// </summary>
  102. [DisplayName("教材类型")]
  103. public string TeachingMaterialTypeName
  104. {
  105. get
  106. {
  107. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_TeachingMaterialType.ToString())
  108. .Where(x => x.Value == TeachingMaterialTypeID)
  109. .Select(x => x.Name).FirstOrDefault();
  110. }
  111. }
  112. /// <summary>
  113. /// ISBN
  114. /// </summary>
  115. [DisplayName("ISBN")]
  116. public string ISBN { get; set; }
  117. /// <summary>
  118. /// 出版单位ID
  119. /// </summary>
  120. [Required]
  121. [DisplayName("出版单位ID")]
  122. public Guid? PublishID { get; set; }
  123. /// <summary>
  124. /// 出版单位
  125. /// </summary>
  126. [DisplayName("出版单位")]
  127. public string PublishName { get; set; }
  128. /// <summary>
  129. /// 供应商
  130. /// </summary>
  131. [DisplayName("供应商")]
  132. [Required]
  133. public Guid? SupplierID { get; set; }
  134. /// <summary>
  135. /// 供应商
  136. /// </summary>
  137. [DisplayName("供应商")]
  138. public string SupplierName { get; set; }
  139. /// <summary>
  140. /// 版本时间
  141. /// </summary>
  142. [DisplayName("版本时间")]
  143. public string PublishTime { get; set; }
  144. /// <summary>
  145. /// 作者
  146. /// </summary>
  147. [DisplayName("作者")]
  148. [Required]
  149. public string Author { get; set; }
  150. /// <summary>
  151. /// 数量
  152. /// </summary>
  153. [DisplayName("数量")]
  154. [RegularExpression(@"^[1-9]\d*$", ErrorMessage = "必须填写整数")]
  155. public int? Quantity { get; set; }
  156. /// <summary>
  157. /// 单价
  158. /// </summary>
  159. [DisplayName("单价")]
  160. [DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
  161. public decimal? Price { get; set; }
  162. /// <summary>
  163. /// 折合价
  164. /// </summary>
  165. [DisplayName("折合价")]
  166. [DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
  167. public decimal? DiscountPrice { get; set; }
  168. /// <summary>
  169. /// 折扣率
  170. /// </summary>
  171. [DisplayName("折扣率")]
  172. [Required]
  173. [DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
  174. [RegularExpression(@"[\d]?(\.[\d]{0,2})?", ErrorMessage = "必须填写小数值")]
  175. public decimal? Discount { get; set; }
  176. /// <summary>
  177. /// 码洋
  178. /// </summary>
  179. [DisplayName("码洋")]
  180. [DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
  181. public decimal? TotalPrice { get; set; }
  182. /// <summary>
  183. /// 总价(实洋)
  184. /// </summary>
  185. [DisplayName("总价(实洋)")]
  186. public decimal? TotalDollar { get; set; }
  187. /// <summary>
  188. /// 经手人
  189. /// </summary>
  190. [DisplayName("经手人")]
  191. public string HandlerUserName { get; set; }
  192. /// <summary>
  193. /// 入库时间
  194. /// </summary>
  195. [DisplayName("入库时间")]
  196. public DateTime? StockInTime { get; set; }
  197. /// <summary>
  198. /// 入库人
  199. /// </summary>
  200. [DisplayName("入库人")]
  201. public string StockInUserName { get; set; }
  202. /// <summary>
  203. /// 入库类型
  204. /// </summary>
  205. [DisplayName("入库类型")]
  206. public int? StockInType { get; set; }
  207. /// <summary>
  208. /// 操作状态
  209. /// </summary>
  210. [DisplayName("操作状态ID")]
  211. public int? RecordStatus { get; set; }
  212. /// <summary>
  213. /// 操作状态
  214. /// </summary>
  215. [DisplayName("操作状态")]
  216. public string RecordStatusName { get; set; }
  217. [DisplayName("是否入库")]
  218. public bool isLate { get; set; }
  219. /// <summary>
  220. /// 备注
  221. /// </summary>
  222. [DisplayName("备注")]
  223. public string Desc { get; set; }
  224. [DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
  225. public decimal? DiscountStr
  226. {
  227. get
  228. {
  229. if (this.Discount == null)
  230. return 0;
  231. return Math.Round((decimal)Discount, 2);
  232. }
  233. }
  234. [DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
  235. public decimal? DiscountPriceStr
  236. {
  237. get
  238. {
  239. if (this.DiscountPrice == null)
  240. return 0;
  241. return Math.Round((decimal)DiscountPrice, 2);
  242. }
  243. }
  244. [DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
  245. public decimal? TotalDollarStr
  246. {
  247. get
  248. {
  249. if (this.TotalDollar == null)
  250. return 0;
  251. return Math.Round((decimal)TotalDollar, 2);
  252. }
  253. }
  254. [DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
  255. public decimal? TotalPriceStr
  256. {
  257. get
  258. {
  259. if (this.TotalPrice == null)
  260. return 0;
  261. return Math.Round((decimal)TotalPrice, 2);
  262. }
  263. }
  264. [DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
  265. public decimal? StockInSumMoneyStr
  266. {
  267. get
  268. {
  269. if (this.StockInSumMoney == null)
  270. return 0;
  271. return Math.Round((decimal)StockInSumMoney, 2);
  272. }
  273. }
  274. }
  275. }