CeErpProduct.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. using Castle.ActiveRecord;
  2. using NHibernate.Criterion;
  3. using System;
  4. using System.Data;
  5. using System.Text;
  6. namespace BizCom
  7. {
  8. [ActiveRecord("CE_ErpProduct")]
  9. public class CeErpProduct : ComBase<CeErpProduct>
  10. {
  11. /// <summary>
  12. ///
  13. /// </summary>
  14. [PrimaryKey(PrimaryKeyType.Native)]
  15. public int ID { get; set; }
  16. private int _pCategory = 0;
  17. /// <summary>
  18. ///类别
  19. /// </summary>
  20. [Property]
  21. public int PCategory
  22. {
  23. get { return _pCategory; }
  24. set { _pCategory = value; }
  25. }
  26. private string _pCategoryText = "";
  27. /// <summary>
  28. ///
  29. /// </summary>
  30. [Property]
  31. public string PCategoryText
  32. {
  33. get { return _pCategoryText; }
  34. set { _pCategoryText = value; }
  35. }
  36. private string _pSupTypeId = "";
  37. /// <summary>
  38. ///一级分类ID
  39. /// </summary>
  40. [Property]
  41. public string PSupTypeId
  42. {
  43. get { return _pSupTypeId; }
  44. set { _pSupTypeId = value; }
  45. }
  46. private string _pSupType = "";
  47. /// <summary>
  48. ///一级分类
  49. /// </summary>
  50. [Property]
  51. public string PSupType
  52. {
  53. get { return _pSupType; }
  54. set { _pSupType = value; }
  55. }
  56. private string _pTypeId = "";
  57. /// <summary>
  58. ///类型ID
  59. /// </summary>
  60. [Property]
  61. public string PTypeId
  62. {
  63. get { return _pTypeId; }
  64. set { _pTypeId = value; }
  65. }
  66. private string _pType = "";
  67. /// <summary>
  68. ///类型名称
  69. /// </summary>
  70. [Property]
  71. public string PType
  72. {
  73. get { return _pType; }
  74. set { _pType = value; }
  75. }
  76. private string _spu = "";
  77. /// <summary>
  78. ///款式编码
  79. /// </summary>
  80. [Property]
  81. public string Spu
  82. {
  83. get { return _spu; }
  84. set { _spu = value; }
  85. }
  86. private string _pNo = "";
  87. /// <summary>
  88. ///编号
  89. /// </summary>
  90. [Property]
  91. public string PNo
  92. {
  93. get { return _pNo; }
  94. set { _pNo = value; }
  95. }
  96. private string _pName = "";
  97. /// <summary>
  98. ///商品名称
  99. /// </summary>
  100. [Property]
  101. public string PName
  102. {
  103. get { return _pName; }
  104. set { _pName = value; }
  105. }
  106. private string _shortName = "";
  107. /// <summary>
  108. ///短名称
  109. /// </summary>
  110. [Property]
  111. public string ShortName
  112. {
  113. get { return _shortName; }
  114. set { _shortName = value; }
  115. }
  116. private string _pNum = "";
  117. /// <summary>
  118. ///
  119. /// </summary>
  120. [Property]
  121. public string PNum
  122. {
  123. get { return _pNum; }
  124. set { _pNum = value; }
  125. }
  126. private string _pMaterial = "";
  127. /// <summary>
  128. ///材质
  129. /// </summary>
  130. [Property]
  131. public string PMaterial
  132. {
  133. get { return _pMaterial; }
  134. set { _pMaterial = value; }
  135. }
  136. private string _pCraft = "";
  137. /// <summary>
  138. ///工艺
  139. /// </summary>
  140. [Property]
  141. public string PCraft
  142. {
  143. get { return _pCraft; }
  144. set { _pCraft = value; }
  145. }
  146. private int _isAutoDistribute = 0;
  147. /// <summary>
  148. ///
  149. /// </summary>
  150. [Property]
  151. public int IsAutoDistribute
  152. {
  153. get { return _isAutoDistribute; }
  154. set { _isAutoDistribute = value; }
  155. }
  156. private int _isNeedDesignPrice = 0;
  157. /// <summary>
  158. ///
  159. /// </summary>
  160. [Property]
  161. public int IsNeedDesignPrice
  162. {
  163. get { return _isNeedDesignPrice; }
  164. set { _isNeedDesignPrice = value; }
  165. }
  166. private double _chang = 0;
  167. /// <summary>
  168. ///长
  169. /// </summary>
  170. [Property]
  171. public double Chang
  172. {
  173. get { return _chang; }
  174. set { _chang = value; }
  175. }
  176. private double _kuang = 0;
  177. /// <summary>
  178. ///宽
  179. /// </summary>
  180. [Property]
  181. public double Kuang
  182. {
  183. get { return _kuang; }
  184. set { _kuang = value; }
  185. }
  186. private double _gao = 0;
  187. /// <summary>
  188. ///高
  189. /// </summary>
  190. [Property]
  191. public double Gao
  192. {
  193. get { return _gao; }
  194. set { _gao = value; }
  195. }
  196. private string _chiCunUnit = "";
  197. /// <summary>
  198. ///尺寸单位
  199. /// </summary>
  200. [Property]
  201. public string ChiCunUnit
  202. {
  203. get { return _chiCunUnit; }
  204. set { _chiCunUnit = value; }
  205. }
  206. private double _mianJi = 0;
  207. /// <summary>
  208. ///面积
  209. /// </summary>
  210. [Property]
  211. public double MianJi
  212. {
  213. get { return _mianJi; }
  214. set { _mianJi = value; }
  215. }
  216. private string _mianJiUnit = "";
  217. /// <summary>
  218. ///面积单位
  219. /// </summary>
  220. [Property]
  221. public string MianJiUnit
  222. {
  223. get { return _mianJiUnit; }
  224. set { _mianJiUnit = value; }
  225. }
  226. private double _tiJi = 0;
  227. /// <summary>
  228. ///体积
  229. /// </summary>
  230. [Property]
  231. public double TiJi
  232. {
  233. get { return _tiJi; }
  234. set { _tiJi = value; }
  235. }
  236. private string _tiJiUnit = "";
  237. /// <summary>
  238. ///体积单位
  239. /// </summary>
  240. [Property]
  241. public string TiJiUnit
  242. {
  243. get { return _tiJiUnit; }
  244. set { _tiJiUnit = value; }
  245. }
  246. private double _weight = 0;
  247. /// <summary>
  248. ///重量
  249. /// </summary>
  250. [Property]
  251. public double Weight
  252. {
  253. get { return _weight; }
  254. set { _weight = value; }
  255. }
  256. private string _weightUnit = "";
  257. /// <summary>
  258. ///重量单位
  259. /// </summary>
  260. [Property]
  261. public string WeightUnit
  262. {
  263. get { return _weightUnit; }
  264. set { _weightUnit = value; }
  265. }
  266. private string _color = "";
  267. /// <summary>
  268. ///颜色
  269. /// </summary>
  270. [Property]
  271. public string Color
  272. {
  273. get { return _color; }
  274. set { _color = value; }
  275. }
  276. private string _spec = "";
  277. /// <summary>
  278. ///规格
  279. /// </summary>
  280. [Property]
  281. public string Spec
  282. {
  283. get { return _spec; }
  284. set { _spec = value; }
  285. }
  286. private string _stockUnit = "";
  287. /// <summary>
  288. ///库存数量基准单位
  289. /// </summary>
  290. [Property]
  291. public string StockUnit
  292. {
  293. get { return _stockUnit; }
  294. set { _stockUnit = value; }
  295. }
  296. private string _logoPicPath = "";
  297. /// <summary>
  298. ///Logo路径
  299. /// </summary>
  300. [Property]
  301. public string LogoPicPath
  302. {
  303. get { return _logoPicPath; }
  304. set { _logoPicPath = value; }
  305. }
  306. private string _picPath = "";
  307. /// <summary>
  308. ///大图路径
  309. /// </summary>
  310. [Property]
  311. public string PicPath
  312. {
  313. get { return _picPath; }
  314. set { _picPath = value; }
  315. }
  316. private double _jiZunPrice = 0;
  317. /// <summary>
  318. ///
  319. /// </summary>
  320. [Property]
  321. public double JiZunPrice
  322. {
  323. get { return _jiZunPrice; }
  324. set { _jiZunPrice = value; }
  325. }
  326. private double _chengBenPrice = 0;
  327. /// <summary>
  328. ///
  329. /// </summary>
  330. [Property]
  331. public double ChengBenPrice
  332. {
  333. get { return _chengBenPrice; }
  334. set { _chengBenPrice = value; }
  335. }
  336. private double _diaoPaiPrice = 0;
  337. /// <summary>
  338. ///
  339. /// </summary>
  340. [Property]
  341. public double DiaoPaiPrice
  342. {
  343. get { return _diaoPaiPrice; }
  344. set { _diaoPaiPrice = value; }
  345. }
  346. private int _isLock = 0;
  347. /// <summary>
  348. ///是否删除
  349. /// </summary>
  350. [Property]
  351. public int IsLock
  352. {
  353. get { return _isLock; }
  354. set { _isLock = value; }
  355. }
  356. private int _isDel = 0;
  357. /// <summary>
  358. ///是否停用
  359. /// </summary>
  360. [Property]
  361. public int IsDel
  362. {
  363. get { return _isDel; }
  364. set { _isDel = value; }
  365. }
  366. private string _remark = "";
  367. /// <summary>
  368. ///
  369. /// </summary>
  370. [Property]
  371. public string Remark
  372. {
  373. get { return _remark; }
  374. set { _remark = value; }
  375. }
  376. private int _createUid = 0;
  377. /// <summary>
  378. ///
  379. /// </summary>
  380. [Property]
  381. public int CreateUid
  382. {
  383. get { return _createUid; }
  384. set { _createUid = value; }
  385. }
  386. private string _createUserName = "";
  387. /// <summary>
  388. ///
  389. /// </summary>
  390. [Property]
  391. public string CreateUserName
  392. {
  393. get { return _createUserName; }
  394. set { _createUserName = value; }
  395. }
  396. /// <summary>
  397. ///
  398. /// </summary>
  399. [Property]
  400. public DateTime CreateTime { get; set; }
  401. private int _updateUid = 0;
  402. /// <summary>
  403. ///
  404. /// </summary>
  405. [Property]
  406. public int UpdateUid
  407. {
  408. get { return _updateUid; }
  409. set { _updateUid = value; }
  410. }
  411. private string _updateUserName = "";
  412. /// <summary>
  413. ///
  414. /// </summary>
  415. [Property]
  416. public string UpdateUserName
  417. {
  418. get { return _updateUserName; }
  419. set { _updateUserName = value; }
  420. }
  421. /// <summary>
  422. ///
  423. /// </summary>
  424. [Property]
  425. public DateTime UpdateTime { get; set; }
  426. private int _isAllDesignerSelect = 0;
  427. /// <summary>
  428. ///
  429. /// </summary>
  430. [Property]
  431. public int IsAllDesignerSelect
  432. {
  433. get { return _isAllDesignerSelect; }
  434. set { _isAllDesignerSelect = value; }
  435. }
  436. //表单json
  437. private string _formJson = "";
  438. [Property]
  439. public string FormJson
  440. {
  441. get { return _formJson; }
  442. set { _formJson = value; }
  443. }
  444. private string _uuid = "";
  445. /// <summary>
  446. /// uuid
  447. /// </summary>
  448. [Property]
  449. public string uuid
  450. {
  451. get { return _uuid; }
  452. set { _uuid = value; }
  453. }
  454. public static void Del(object id)
  455. {
  456. StringBuilder sql = new StringBuilder();
  457. sql.AppendFormat("delete from CE_ErpProduct where id=" + id);
  458. ExecuteNonQuery(sql.ToString());
  459. }
  460. public static CeErpProduct GetById(int id)
  461. {
  462. return FindFirst(Expression.Eq("ID", id));
  463. }
  464. public static DataTable Get()
  465. {
  466. string sql = "select * from CE_ErpProduct order by PTypeId,ID asc";
  467. return DbConn.ExecuteDataset(sql).Tables[0];
  468. }
  469. public static CeErpProduct GetByName(string name)
  470. {
  471. return FindFirst(Expression.Eq("uuid", name));
  472. }
  473. }
  474. }