UIF042010_CTL.cs 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace Core.LZMes.Client.UIF
  10. {
  11. public partial class UIF042010_CTL : UserControl
  12. {
  13. public UIF042010_CTL()
  14. {
  15. InitializeComponent();
  16. }
  17. private string _Condition = "";
  18. public string Condition
  19. {
  20. get
  21. {
  22. _Condition = "";
  23. if (this.chk_SZ.Checked)
  24. {
  25. _Condition += " AND INSTR(C.C_PRODNM_CD,'" + this.chk_SZ.Text + "')>0";
  26. }
  27. string Appearance = "";
  28. if (this.chk_FA.Checked)
  29. Appearance += "'" + this.chk_FA.Text + "',";
  30. if(this.chk_FB.Checked)
  31. Appearance += "'" + this.chk_FB.Text + "',";
  32. if (this.chk_FC.Checked)
  33. Appearance += "'" + this.chk_FC.Text + "',";
  34. if (this.chk_FD.Checked)
  35. Appearance += "'" + this.chk_FD.Text + "',";
  36. if(Appearance.Length>0)
  37. {
  38. Appearance = Appearance.Substring(0,Appearance.Length-1);
  39. _Condition += " AND C.C_EXTSHAPE_REQ IN(" + Appearance + ")";
  40. }
  41. string[] height = mtx_height.Text.Split('~');
  42. string min_height = height[0].Replace(" ","");
  43. min_height = min_height == "." ? "0" : min_height;
  44. string max_height = height[1].Replace(" ", "");
  45. max_height = max_height == "." ? "99" : max_height;
  46. _Condition += " AND C.C_ORD_THK BETWEEN " + min_height + " AND " + max_height;
  47. string[] width = mtx_Width.Text.Split('~');
  48. string min_width = width[0].Replace(" ","").Length == 0 ? "0" : width[0];
  49. string max_width = width[1].Replace(" ","").Length == 0 ? "1500" : width[1];
  50. _Condition += " AND C.C_ORD_WTH BETWEEN " + min_width + " AND " + max_width;
  51. string[] senddate = mtx_SendDate.Text.Split('~');
  52. string min_senddate = senddate[0].Replace(" ","")== "--" ? "2010-01-01" : senddate[0];
  53. string max_senddate = senddate[1].Replace(" ","")== "--" ? "2099-01-01" : senddate[1];
  54. _Condition += " AND C.DEL_TO_DATE BETWEEN TO_CHAR(TO_DATE('" + min_senddate + "','YYYY-MM-DD'),'YYYYMMDD') "
  55. + " AND TO_CHAR(TO_DATE('" + max_senddate + "','YYYY-MM-DD'),'YYYYMMDD') ";
  56. return _Condition;
  57. }
  58. }
  59. private void CheckBox_CheckedChanged(object sender, EventArgs e)
  60. {
  61. try
  62. {
  63. if ((sender as CheckBox).Checked)
  64. (sender as CheckBox).BackColor = System.Drawing.Color.LightSteelBlue;
  65. else
  66. (sender as CheckBox).BackColor = System.Drawing.Color.White;
  67. }
  68. catch (System.Exception ex)
  69. {
  70. System.Diagnostics.Debug.WriteLine(ex.ToString());
  71. }
  72. }
  73. }
  74. }