| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Text;
- using System.Windows.Forms;
- using Core.XgMes.Client.StorageBase;
- namespace Core.XgMes.Client.JGKC.RollManager
- {
- public partial class UCSendQueryJB : UserControl
- {
- public UCSendQueryJB()
- {
- InitializeComponent();
- }
- private string _WhereStr = "";
- public string WhereStr
- {
- get
- {
- _WhereStr = GetSteelCondition();
- _WhereStr = _WhereStr + GetPactNOCondition();
- _WhereStr = _WhereStr + GetSendDateCondition();
- _WhereStr = _WhereStr + GetBookInDateCondition();
- _WhereStr = _WhereStr + GetListCondingCondition();
- //_WhereStr = _WhereStr + GetIncpNameCondition();
- //_WhereStr = _WhereStr + GetStationNameCondition();
- _WhereStr = _WhereStr + GetRollNOCondition();
- _WhereStr = _WhereStr + GetPlyCondition();
- _WhereStr = _WhereStr + GetWidthCondition();
- _WhereStr = _WhereStr + GetLengthCondition();
- _WhereStr = _WhereStr + GetPlanNOCondition();
- _WhereStr = _WhereStr + GetVecihleNOCondition();
- _WhereStr = _WhereStr + GetClassTeamCondition();
- _WhereStr = _WhereStr + GetSendManCondition();
- _WhereStr = _WhereStr + GetSendType();
-
- _WhereStr = _WhereStr + GetCondole();
- _WhereStr = _WhereStr + GetBookInManCondition();
- _WhereStr = _WhereStr + GetGJH();
- //_WhereStr = _WhereStr + GetQuality();
- //_WhereStr = _WhereStr + GetPLCondition();
- // _WhereStr = _WhereStr + GetCutStateCondition();
- return _WhereStr;
- }
- }
- #region "Method"
-
- private string GetSteelCondition()
- {
- try
- {
- string rtnStr = "";
- if (this.Chk_SteelName.Checked && this.Cmb_SteelName.Text.Trim().Length > 0)
- {
- rtnStr = " AND A.SPEC_STL_GRD LIKE '" + this.Cmb_SteelName.Text.Trim() + "%' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //合同号B
- private string GetPactNOCondition()
- {
- try
- {
- string rtnStr = "";
- if (this.Chk_PactNO.Checked && this.txt_PactNO.Text.Trim().Length > 0)
- {
- rtnStr = " AND B.ORD_NO LIKE '%" + this.txt_PactNO.Text.Trim() + "%' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //发运日期A
- private string GetSendDateCondition()
- {
- try
- {
- string rtnStr = "";
- if (this.Chk_SendDate.Checked && this.Dte_SendBegin.Value != null)
- {
- rtnStr = " AND TO_CHAR(A.PICKSTORAGETIME,'YY-MM-DD')>='" + Convert.ToDateTime(this.Dte_SendBegin.Value).ToString("yy-MM-dd") + "' "
- + " AND TO_CHAR(A.PICKSTORAGETIME,'YY-MM-DD')<='" + Convert.ToDateTime(this.Dte_SendEnd.Value).ToString("yy-MM-dd") + "' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //登记日期A
- private string GetBookInDateCondition()
- {
- try
- {
- string rtnStr = "";
- if (this.Chk_BookInDate.Checked && this.Dte_BookInBegin.Value != null)
- {
- rtnStr = " AND TO_CHAR(A.CREATETIME,'YY-MM-DD')>='" + Convert.ToDateTime(this.Dte_BookInBegin.Value).ToString("yy-MM-dd") + "' "
- + " AND TO_CHAR(A.CREATETIME,'YY-MM-DD')<='" + Convert.ToDateTime(this.Dte_BookInEnd.Value).ToString("yy-MM-dd") + "' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //发运明细A
- private string GetListCondingCondition()
- {
- try
- {
- string rtnStr = "";
- if (this.Chk_ListCode.Checked && this.txt_ListCodingEnd.Text.Trim().Length > 0)
- {
- rtnStr = " AND A.LISTNUMBER LIKE '%" + this.txt_ListCodingEnd.Text.Trim() + "%' ";
- }
-
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
-
- ////收货单位C
- private string GetIncpNameCondition()
- {
- try
- {
- string rtnStr = "";
- if (this.Chk_IncpName.Checked && this.txt_IncpName.Text.Trim().Length > 0)
- {
- rtnStr = " AND C.CUST_CD LIKE '%" + this.txt_IncpName.Text.Trim() + "%' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- ////到站D
- private string GetStationNameCondition()
- {
- try
- {
- string rtnStr = "";
- if (this.Chk_StationName.Checked && this.txt_StationName.Text.Trim().Length > 0)
- {
- rtnStr = " AND D.SM_CD LIKE '%" + this.txt_StationName.Text.Trim() + "%' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //钢卷包号
- private string GetRollNOCondition()
- {
- try
- {
- string rtnStr = "";
- if (this.chk_RollNum.Checked && this.txt_BH.Text.Trim().Length > 0)
- {
- rtnStr = " AND A.COIL_NO_ID LIKE '%" + this.txt_BH.Text.Trim() + "%' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //厚度
- private string GetPlyCondition()
- {
- try
- {
- if (this.chk_Ply.Checked)
- {
- string rtnStr = "";
- if (StorageBaseClass.CheckDecimal(this.txt_PlyBegin.Value) > 0 && StorageBaseClass.CheckDecimal(this.txt_PlyEnd.Value) == 0)
- {
- rtnStr = " AND A.ZSLAB_PLY=" + StorageBaseClass.CheckNullStr(this.txt_PlyBegin.Value);
- return rtnStr;
- }
- if (StorageBaseClass.CheckDecimal(this.txt_PlyBegin.Value) == 0 && StorageBaseClass.CheckDecimal(this.txt_PlyEnd.Value) > 0)
- {
- rtnStr = " AND A.ZSLAB_PLY<=" + StorageBaseClass.CheckNullStr(this.txt_PlyEnd.Value);
- return rtnStr;
- }
- if (StorageBaseClass.CheckDecimal(this.txt_PlyBegin.Value) > 0 && StorageBaseClass.CheckDecimal(this.txt_PlyEnd.Value) > 0)
- {
- rtnStr = " AND A.ZSLAB_PLY>=" + StorageBaseClass.CheckNullStr(this.txt_PlyBegin.Value)
- + " AND A.ZSLAB_PLY<=" + StorageBaseClass.CheckNullStr(this.txt_PlyEnd.Value);
- return rtnStr;
- }
- }
- return "";
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //宽度
- private string GetWidthCondition()
- {
- try
- {
- if (this.chk_Width.Checked)
- {
- string rtnStr = "";
- if (StorageBaseClass.CheckDecimal(this.txt_WidthBegin.Value) > 0 && StorageBaseClass.CheckDecimal(this.txt_WidthEnd.Value) == 0)
- {
- rtnStr = " AND A.ZSLAB_WIDTH=" + StorageBaseClass.CheckNullStr(this.txt_WidthBegin.Value);
- return rtnStr;
- }
- if (StorageBaseClass.CheckDecimal(this.txt_WidthBegin.Value) == 0 && StorageBaseClass.CheckDecimal(this.txt_WidthEnd.Value) > 0)
- {
- rtnStr = " AND A.ZSLAB_WIDTH<=" + StorageBaseClass.CheckNullStr(this.txt_WidthEnd.Value);
- return rtnStr;
- }
- if (StorageBaseClass.CheckDecimal(this.txt_WidthBegin.Value) > 0 && StorageBaseClass.CheckDecimal(this.txt_WidthEnd.Value) > 0)
- {
- rtnStr = " AND A.ZSLAB_WIDTH>=" + StorageBaseClass.CheckNullStr(this.txt_WidthBegin.Value)
- + " AND A.ZSLAB_WIDTH<=" + StorageBaseClass.CheckNullStr(this.txt_WidthEnd.Value);
- return rtnStr;
- }
- }
- return "";
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //长度
- private string GetLengthCondition()
- {
- try
- {
- if (this.chk_Length.Checked)
- {
- string rtnStr = "";
- if (StorageBaseClass.CheckDecimal(this.txt_LenghtBegin.Value) > 0 && StorageBaseClass.CheckDecimal(this.txt_LengthEnd.Value) == 0)
- {
- rtnStr = " AND A.ZSLAB_LENGTH=" + StorageBaseClass.CheckNullStr(this.txt_LenghtBegin.Value);
- return rtnStr;
- }
- if (StorageBaseClass.CheckDecimal(this.txt_LenghtBegin.Value) == 0 && StorageBaseClass.CheckDecimal(this.txt_LengthEnd.Value) > 0)
- {
- rtnStr = " AND A.ZSLAB_LENGTH<=" + StorageBaseClass.CheckNullStr(this.txt_LengthEnd.Value);
- return rtnStr;
- }
- if (StorageBaseClass.CheckDecimal(this.txt_LenghtBegin.Value) > 0 && StorageBaseClass.CheckDecimal(this.txt_LengthEnd.Value) > 0)
- {
- rtnStr = " AND A.ZSLAB_LENGTH>=" + StorageBaseClass.CheckNullStr(this.txt_LenghtBegin.Value)
- + " AND A.ZSLAB_LENGTH<=" + StorageBaseClass.CheckNullStr(this.txt_LengthEnd.Value);
- return rtnStr;
- }
- }
- return "";
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //批号
- private string GetPlanNOCondition()
- {
- try
- {
- string rtnStr = "";
- if (this.Chk_Condole.Checked && this.Txt_Condole.Text.Trim().Length > 0)
- {
- rtnStr = " AND A.SLAB_NO LIKE '%" + this.Txt_Condole.Text.Trim() + "%' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //车牌号
- private string GetVecihleNOCondition()
- {
- try
- {
- string rtnStr = "";
- if (this.Chk_VecihleNO.Checked && this.txt_VecihleNO.Text.Trim().Length > 0)
- {
- rtnStr = " AND A.TRAINWAGON LIKE '%" + this.txt_VecihleNO.Text.Trim() + "%' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //班组
- private string GetClassTeamCondition()
- {
- try
- {
- string rtnStr = "";
- if (this.Chk_ClassTeam.Checked && StorageBaseClass.CheckNullStr(this.Cmb_ClassTeam.Value).Length > 0)
- {
- rtnStr = " AND A.CLASSTEAM='" + StorageBaseClass.CheckNullStr(this.Cmb_ClassTeam.Value) + "' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //发运人
- private string GetSendManCondition()
- {
- try
- {
- string rtnStr = "";
- if (this.Chk_SendMan.Checked && this.txt_SendMan.Text.Trim().Length > 0)
- {
- rtnStr = " AND A.PICKSTORAGEMAN='" + this.txt_SendMan.Text.Trim() + "' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //发运明细的登记人
- private string GetBookInManCondition()
- {
- try
- {
- string rtnStr = "";
- if (this.Chk_BookInMan.Checked && this.txt_BookInMan.Text.Trim().Length > 0)
- {
- rtnStr = " AND A.CREATOR='" + this.txt_BookInMan.Text.Trim() + "' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //钢卷号
- private string GetGJH()
- {
- try
- {
- string rtnStr = "";
- if (this.ultChk_SampleNo.Checked && this.txt_SampleNo.Text.Trim().Length > 0)
- {
- rtnStr = " AND A.OLD_SAMPL_NO LIKE '" + this.txt_SampleNo.Text.Trim() + "%' ";
- }
-
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //获得发运类型的条件
- private string GetSendType()
- {
- try
- {
- string rtnStr = "";
- if (this.Chk_SendType.Checked && StorageBaseClass.CheckNullStr(this.Cmb_SendType.Value).Length > 0)
- {
- rtnStr = " AND A.SENDTYPE='" + StorageBaseClass.CheckNullStr(this.Cmb_SendType.Value) + "' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- //发运号码
- private string GetCondole()
- {
- try
- {
- string rtnStr = "";
- if (this.chk_SendNo.Checked && this.txt_SendNo.Text.Length > 0)
- {
- rtnStr = " AND A.PLANVEHICLEID LIKE '%" + this.txt_SendNo.Text + "%' ";
- }
- return rtnStr;
- }
- catch (System.Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return "";
- }
- }
- private void UCSendQueryJB_Load(object sender, EventArgs e)
- {
- this.Cmb_SendType.Value = "0";
- }
- //获得是正品还是次品的条件
- //private string GetQuality()
- //{
- // try
- // {
- // if ((this.Chk_IsGood.Checked && this.Chk_IsWaster.Checked) | (!this.Chk_IsGood.Checked && !this.Chk_IsWaster.Checked))
- // return "";
- // if (this.Chk_IsWaster.Checked)
- // return " AND (A.CLIPTYPEPROCESS LIKE '10301%' OR A.DETERMINANTRESULT LIKE '401403%' OR A.DETERMINANTRESULT LIKE '401404%') ";
- // if (this.Chk_IsGood.Checked)
- // return " AND (A.CLIPTYPEPROCESS NOT LIKE '10301%' AND A.DETERMINANTRESULT LIKE '401401%') ";
- // return "";
- // }
- // catch (System.Exception ex)
- // {
- // System.Diagnostics.Debug.WriteLine(ex.ToString());
- // return "";
- // }
- //}
- #endregion
- }
- }
|