02c8baf50c83481003ad22685af04ba99c601f8c.svn-base 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using Core.XgMes.Client.StorageBase;
  9. namespace Core.XgMes.Client.JGKC.RollManager
  10. {
  11. public partial class UCSendQueryJB : UserControl
  12. {
  13. public UCSendQueryJB()
  14. {
  15. InitializeComponent();
  16. }
  17. private string _WhereStr = "";
  18. public string WhereStr
  19. {
  20. get
  21. {
  22. _WhereStr = GetSteelCondition();
  23. _WhereStr = _WhereStr + GetPactNOCondition();
  24. _WhereStr = _WhereStr + GetSendDateCondition();
  25. _WhereStr = _WhereStr + GetBookInDateCondition();
  26. _WhereStr = _WhereStr + GetListCondingCondition();
  27. //_WhereStr = _WhereStr + GetIncpNameCondition();
  28. //_WhereStr = _WhereStr + GetStationNameCondition();
  29. _WhereStr = _WhereStr + GetRollNOCondition();
  30. _WhereStr = _WhereStr + GetPlyCondition();
  31. _WhereStr = _WhereStr + GetWidthCondition();
  32. _WhereStr = _WhereStr + GetLengthCondition();
  33. _WhereStr = _WhereStr + GetPlanNOCondition();
  34. _WhereStr = _WhereStr + GetVecihleNOCondition();
  35. _WhereStr = _WhereStr + GetClassTeamCondition();
  36. _WhereStr = _WhereStr + GetSendManCondition();
  37. _WhereStr = _WhereStr + GetSendType();
  38. _WhereStr = _WhereStr + GetCondole();
  39. _WhereStr = _WhereStr + GetBookInManCondition();
  40. _WhereStr = _WhereStr + GetGJH();
  41. //_WhereStr = _WhereStr + GetQuality();
  42. //_WhereStr = _WhereStr + GetPLCondition();
  43. // _WhereStr = _WhereStr + GetCutStateCondition();
  44. return _WhereStr;
  45. }
  46. }
  47. #region "Method"
  48. private string GetSteelCondition()
  49. {
  50. try
  51. {
  52. string rtnStr = "";
  53. if (this.Chk_SteelName.Checked && this.Cmb_SteelName.Text.Trim().Length > 0)
  54. {
  55. rtnStr = " AND A.SPEC_STL_GRD LIKE '" + this.Cmb_SteelName.Text.Trim() + "%' ";
  56. }
  57. return rtnStr;
  58. }
  59. catch (System.Exception ex)
  60. {
  61. System.Diagnostics.Debug.WriteLine(ex.ToString());
  62. return "";
  63. }
  64. }
  65. //合同号B
  66. private string GetPactNOCondition()
  67. {
  68. try
  69. {
  70. string rtnStr = "";
  71. if (this.Chk_PactNO.Checked && this.txt_PactNO.Text.Trim().Length > 0)
  72. {
  73. rtnStr = " AND B.ORD_NO LIKE '%" + this.txt_PactNO.Text.Trim() + "%' ";
  74. }
  75. return rtnStr;
  76. }
  77. catch (System.Exception ex)
  78. {
  79. System.Diagnostics.Debug.WriteLine(ex.ToString());
  80. return "";
  81. }
  82. }
  83. //发运日期A
  84. private string GetSendDateCondition()
  85. {
  86. try
  87. {
  88. string rtnStr = "";
  89. if (this.Chk_SendDate.Checked && this.Dte_SendBegin.Value != null)
  90. {
  91. rtnStr = " AND TO_CHAR(A.PICKSTORAGETIME,'YY-MM-DD')>='" + Convert.ToDateTime(this.Dte_SendBegin.Value).ToString("yy-MM-dd") + "' "
  92. + " AND TO_CHAR(A.PICKSTORAGETIME,'YY-MM-DD')<='" + Convert.ToDateTime(this.Dte_SendEnd.Value).ToString("yy-MM-dd") + "' ";
  93. }
  94. return rtnStr;
  95. }
  96. catch (System.Exception ex)
  97. {
  98. System.Diagnostics.Debug.WriteLine(ex.ToString());
  99. return "";
  100. }
  101. }
  102. //登记日期A
  103. private string GetBookInDateCondition()
  104. {
  105. try
  106. {
  107. string rtnStr = "";
  108. if (this.Chk_BookInDate.Checked && this.Dte_BookInBegin.Value != null)
  109. {
  110. rtnStr = " AND TO_CHAR(A.CREATETIME,'YY-MM-DD')>='" + Convert.ToDateTime(this.Dte_BookInBegin.Value).ToString("yy-MM-dd") + "' "
  111. + " AND TO_CHAR(A.CREATETIME,'YY-MM-DD')<='" + Convert.ToDateTime(this.Dte_BookInEnd.Value).ToString("yy-MM-dd") + "' ";
  112. }
  113. return rtnStr;
  114. }
  115. catch (System.Exception ex)
  116. {
  117. System.Diagnostics.Debug.WriteLine(ex.ToString());
  118. return "";
  119. }
  120. }
  121. //发运明细A
  122. private string GetListCondingCondition()
  123. {
  124. try
  125. {
  126. string rtnStr = "";
  127. if (this.Chk_ListCode.Checked && this.txt_ListCodingEnd.Text.Trim().Length > 0)
  128. {
  129. rtnStr = " AND A.LISTNUMBER LIKE '%" + this.txt_ListCodingEnd.Text.Trim() + "%' ";
  130. }
  131. return rtnStr;
  132. }
  133. catch (System.Exception ex)
  134. {
  135. System.Diagnostics.Debug.WriteLine(ex.ToString());
  136. return "";
  137. }
  138. }
  139. ////收货单位C
  140. private string GetIncpNameCondition()
  141. {
  142. try
  143. {
  144. string rtnStr = "";
  145. if (this.Chk_IncpName.Checked && this.txt_IncpName.Text.Trim().Length > 0)
  146. {
  147. rtnStr = " AND C.CUST_CD LIKE '%" + this.txt_IncpName.Text.Trim() + "%' ";
  148. }
  149. return rtnStr;
  150. }
  151. catch (System.Exception ex)
  152. {
  153. System.Diagnostics.Debug.WriteLine(ex.ToString());
  154. return "";
  155. }
  156. }
  157. ////到站D
  158. private string GetStationNameCondition()
  159. {
  160. try
  161. {
  162. string rtnStr = "";
  163. if (this.Chk_StationName.Checked && this.txt_StationName.Text.Trim().Length > 0)
  164. {
  165. rtnStr = " AND D.SM_CD LIKE '%" + this.txt_StationName.Text.Trim() + "%' ";
  166. }
  167. return rtnStr;
  168. }
  169. catch (System.Exception ex)
  170. {
  171. System.Diagnostics.Debug.WriteLine(ex.ToString());
  172. return "";
  173. }
  174. }
  175. //钢卷包号
  176. private string GetRollNOCondition()
  177. {
  178. try
  179. {
  180. string rtnStr = "";
  181. if (this.chk_RollNum.Checked && this.txt_BH.Text.Trim().Length > 0)
  182. {
  183. rtnStr = " AND A.COIL_NO_ID LIKE '%" + this.txt_BH.Text.Trim() + "%' ";
  184. }
  185. return rtnStr;
  186. }
  187. catch (System.Exception ex)
  188. {
  189. System.Diagnostics.Debug.WriteLine(ex.ToString());
  190. return "";
  191. }
  192. }
  193. //厚度
  194. private string GetPlyCondition()
  195. {
  196. try
  197. {
  198. if (this.chk_Ply.Checked)
  199. {
  200. string rtnStr = "";
  201. if (StorageBaseClass.CheckDecimal(this.txt_PlyBegin.Value) > 0 && StorageBaseClass.CheckDecimal(this.txt_PlyEnd.Value) == 0)
  202. {
  203. rtnStr = " AND A.ZSLAB_PLY=" + StorageBaseClass.CheckNullStr(this.txt_PlyBegin.Value);
  204. return rtnStr;
  205. }
  206. if (StorageBaseClass.CheckDecimal(this.txt_PlyBegin.Value) == 0 && StorageBaseClass.CheckDecimal(this.txt_PlyEnd.Value) > 0)
  207. {
  208. rtnStr = " AND A.ZSLAB_PLY<=" + StorageBaseClass.CheckNullStr(this.txt_PlyEnd.Value);
  209. return rtnStr;
  210. }
  211. if (StorageBaseClass.CheckDecimal(this.txt_PlyBegin.Value) > 0 && StorageBaseClass.CheckDecimal(this.txt_PlyEnd.Value) > 0)
  212. {
  213. rtnStr = " AND A.ZSLAB_PLY>=" + StorageBaseClass.CheckNullStr(this.txt_PlyBegin.Value)
  214. + " AND A.ZSLAB_PLY<=" + StorageBaseClass.CheckNullStr(this.txt_PlyEnd.Value);
  215. return rtnStr;
  216. }
  217. }
  218. return "";
  219. }
  220. catch (System.Exception ex)
  221. {
  222. System.Diagnostics.Debug.WriteLine(ex.ToString());
  223. return "";
  224. }
  225. }
  226. //宽度
  227. private string GetWidthCondition()
  228. {
  229. try
  230. {
  231. if (this.chk_Width.Checked)
  232. {
  233. string rtnStr = "";
  234. if (StorageBaseClass.CheckDecimal(this.txt_WidthBegin.Value) > 0 && StorageBaseClass.CheckDecimal(this.txt_WidthEnd.Value) == 0)
  235. {
  236. rtnStr = " AND A.ZSLAB_WIDTH=" + StorageBaseClass.CheckNullStr(this.txt_WidthBegin.Value);
  237. return rtnStr;
  238. }
  239. if (StorageBaseClass.CheckDecimal(this.txt_WidthBegin.Value) == 0 && StorageBaseClass.CheckDecimal(this.txt_WidthEnd.Value) > 0)
  240. {
  241. rtnStr = " AND A.ZSLAB_WIDTH<=" + StorageBaseClass.CheckNullStr(this.txt_WidthEnd.Value);
  242. return rtnStr;
  243. }
  244. if (StorageBaseClass.CheckDecimal(this.txt_WidthBegin.Value) > 0 && StorageBaseClass.CheckDecimal(this.txt_WidthEnd.Value) > 0)
  245. {
  246. rtnStr = " AND A.ZSLAB_WIDTH>=" + StorageBaseClass.CheckNullStr(this.txt_WidthBegin.Value)
  247. + " AND A.ZSLAB_WIDTH<=" + StorageBaseClass.CheckNullStr(this.txt_WidthEnd.Value);
  248. return rtnStr;
  249. }
  250. }
  251. return "";
  252. }
  253. catch (System.Exception ex)
  254. {
  255. System.Diagnostics.Debug.WriteLine(ex.ToString());
  256. return "";
  257. }
  258. }
  259. //长度
  260. private string GetLengthCondition()
  261. {
  262. try
  263. {
  264. if (this.chk_Length.Checked)
  265. {
  266. string rtnStr = "";
  267. if (StorageBaseClass.CheckDecimal(this.txt_LenghtBegin.Value) > 0 && StorageBaseClass.CheckDecimal(this.txt_LengthEnd.Value) == 0)
  268. {
  269. rtnStr = " AND A.ZSLAB_LENGTH=" + StorageBaseClass.CheckNullStr(this.txt_LenghtBegin.Value);
  270. return rtnStr;
  271. }
  272. if (StorageBaseClass.CheckDecimal(this.txt_LenghtBegin.Value) == 0 && StorageBaseClass.CheckDecimal(this.txt_LengthEnd.Value) > 0)
  273. {
  274. rtnStr = " AND A.ZSLAB_LENGTH<=" + StorageBaseClass.CheckNullStr(this.txt_LengthEnd.Value);
  275. return rtnStr;
  276. }
  277. if (StorageBaseClass.CheckDecimal(this.txt_LenghtBegin.Value) > 0 && StorageBaseClass.CheckDecimal(this.txt_LengthEnd.Value) > 0)
  278. {
  279. rtnStr = " AND A.ZSLAB_LENGTH>=" + StorageBaseClass.CheckNullStr(this.txt_LenghtBegin.Value)
  280. + " AND A.ZSLAB_LENGTH<=" + StorageBaseClass.CheckNullStr(this.txt_LengthEnd.Value);
  281. return rtnStr;
  282. }
  283. }
  284. return "";
  285. }
  286. catch (System.Exception ex)
  287. {
  288. System.Diagnostics.Debug.WriteLine(ex.ToString());
  289. return "";
  290. }
  291. }
  292. //批号
  293. private string GetPlanNOCondition()
  294. {
  295. try
  296. {
  297. string rtnStr = "";
  298. if (this.Chk_Condole.Checked && this.Txt_Condole.Text.Trim().Length > 0)
  299. {
  300. rtnStr = " AND A.SLAB_NO LIKE '%" + this.Txt_Condole.Text.Trim() + "%' ";
  301. }
  302. return rtnStr;
  303. }
  304. catch (System.Exception ex)
  305. {
  306. System.Diagnostics.Debug.WriteLine(ex.ToString());
  307. return "";
  308. }
  309. }
  310. //车牌号
  311. private string GetVecihleNOCondition()
  312. {
  313. try
  314. {
  315. string rtnStr = "";
  316. if (this.Chk_VecihleNO.Checked && this.txt_VecihleNO.Text.Trim().Length > 0)
  317. {
  318. rtnStr = " AND A.TRAINWAGON LIKE '%" + this.txt_VecihleNO.Text.Trim() + "%' ";
  319. }
  320. return rtnStr;
  321. }
  322. catch (System.Exception ex)
  323. {
  324. System.Diagnostics.Debug.WriteLine(ex.ToString());
  325. return "";
  326. }
  327. }
  328. //班组
  329. private string GetClassTeamCondition()
  330. {
  331. try
  332. {
  333. string rtnStr = "";
  334. if (this.Chk_ClassTeam.Checked && StorageBaseClass.CheckNullStr(this.Cmb_ClassTeam.Value).Length > 0)
  335. {
  336. rtnStr = " AND A.CLASSTEAM='" + StorageBaseClass.CheckNullStr(this.Cmb_ClassTeam.Value) + "' ";
  337. }
  338. return rtnStr;
  339. }
  340. catch (System.Exception ex)
  341. {
  342. System.Diagnostics.Debug.WriteLine(ex.ToString());
  343. return "";
  344. }
  345. }
  346. //发运人
  347. private string GetSendManCondition()
  348. {
  349. try
  350. {
  351. string rtnStr = "";
  352. if (this.Chk_SendMan.Checked && this.txt_SendMan.Text.Trim().Length > 0)
  353. {
  354. rtnStr = " AND A.PICKSTORAGEMAN='" + this.txt_SendMan.Text.Trim() + "' ";
  355. }
  356. return rtnStr;
  357. }
  358. catch (System.Exception ex)
  359. {
  360. System.Diagnostics.Debug.WriteLine(ex.ToString());
  361. return "";
  362. }
  363. }
  364. //发运明细的登记人
  365. private string GetBookInManCondition()
  366. {
  367. try
  368. {
  369. string rtnStr = "";
  370. if (this.Chk_BookInMan.Checked && this.txt_BookInMan.Text.Trim().Length > 0)
  371. {
  372. rtnStr = " AND A.CREATOR='" + this.txt_BookInMan.Text.Trim() + "' ";
  373. }
  374. return rtnStr;
  375. }
  376. catch (System.Exception ex)
  377. {
  378. System.Diagnostics.Debug.WriteLine(ex.ToString());
  379. return "";
  380. }
  381. }
  382. //钢卷号
  383. private string GetGJH()
  384. {
  385. try
  386. {
  387. string rtnStr = "";
  388. if (this.ultChk_SampleNo.Checked && this.txt_SampleNo.Text.Trim().Length > 0)
  389. {
  390. rtnStr = " AND A.OLD_SAMPL_NO LIKE '" + this.txt_SampleNo.Text.Trim() + "%' ";
  391. }
  392. return rtnStr;
  393. }
  394. catch (System.Exception ex)
  395. {
  396. System.Diagnostics.Debug.WriteLine(ex.ToString());
  397. return "";
  398. }
  399. }
  400. //获得发运类型的条件
  401. private string GetSendType()
  402. {
  403. try
  404. {
  405. string rtnStr = "";
  406. if (this.Chk_SendType.Checked && StorageBaseClass.CheckNullStr(this.Cmb_SendType.Value).Length > 0)
  407. {
  408. rtnStr = " AND A.SENDTYPE='" + StorageBaseClass.CheckNullStr(this.Cmb_SendType.Value) + "' ";
  409. }
  410. return rtnStr;
  411. }
  412. catch (System.Exception ex)
  413. {
  414. System.Diagnostics.Debug.WriteLine(ex.ToString());
  415. return "";
  416. }
  417. }
  418. //发运号码
  419. private string GetCondole()
  420. {
  421. try
  422. {
  423. string rtnStr = "";
  424. if (this.chk_SendNo.Checked && this.txt_SendNo.Text.Length > 0)
  425. {
  426. rtnStr = " AND A.PLANVEHICLEID LIKE '%" + this.txt_SendNo.Text + "%' ";
  427. }
  428. return rtnStr;
  429. }
  430. catch (System.Exception ex)
  431. {
  432. System.Diagnostics.Debug.WriteLine(ex.ToString());
  433. return "";
  434. }
  435. }
  436. private void UCSendQueryJB_Load(object sender, EventArgs e)
  437. {
  438. this.Cmb_SendType.Value = "0";
  439. }
  440. //获得是正品还是次品的条件
  441. //private string GetQuality()
  442. //{
  443. // try
  444. // {
  445. // if ((this.Chk_IsGood.Checked && this.Chk_IsWaster.Checked) | (!this.Chk_IsGood.Checked && !this.Chk_IsWaster.Checked))
  446. // return "";
  447. // if (this.Chk_IsWaster.Checked)
  448. // return " AND (A.CLIPTYPEPROCESS LIKE '10301%' OR A.DETERMINANTRESULT LIKE '401403%' OR A.DETERMINANTRESULT LIKE '401404%') ";
  449. // if (this.Chk_IsGood.Checked)
  450. // return " AND (A.CLIPTYPEPROCESS NOT LIKE '10301%' AND A.DETERMINANTRESULT LIKE '401401%') ";
  451. // return "";
  452. // }
  453. // catch (System.Exception ex)
  454. // {
  455. // System.Diagnostics.Debug.WriteLine(ex.ToString());
  456. // return "";
  457. // }
  458. //}
  459. #endregion
  460. }
  461. }