Exemplo n.º 1
0
        public DataTable GetProductionLostList(ProductionLostSearchData whereData)
        {
            string whereString = "";

            if (whereData.MFGDATEFROM.Year != 1)
                whereString += (whereString == "" ? "" : "AND ") + "MFGDATE >= " + OracleDB.QRDate(whereData.MFGDATEFROM) + " ";
            if (whereData.MFGDATETO.Year != 1)
                whereString += (whereString == "" ? "" : "AND ") + "MFGDATE <= " + OracleDB.QRDate(whereData.MFGDATETO) + " ";
            if (whereData.SENDFGDATEFROM.Year != 1)
                whereString += (whereString == "" ? "" : "AND ") + "SENDFGDATE >= " + OracleDB.QRDate(whereData.SENDFGDATEFROM) + " ";
            if (whereData.SENDFGDATETO.Year != 1)
                whereString += (whereString == "" ? "" : "AND ") + "SENDFGDATE <= " + OracleDB.QRDate(whereData.SENDFGDATETO) + " ";
            if (whereData.ORDERDATEFROM.Year != 1)
                whereString += (whereString == "" ? "" : "AND ") + "ORDERDATE >= " + OracleDB.QRDate(whereData.ORDERDATEFROM) + " ";
            if (whereData.ORDERDATETO.Year != 1)
                whereString += (whereString == "" ? "" : "AND ") + "ORDERDATE <= " + OracleDB.QRDate(whereData.ORDERDATETO) + " ";
            if (whereData.PRODUCT != 0)
                whereString += (whereString == "" ? "" : "AND ") + "PRODUCT = " + whereData.PRODUCT + " ";
            if (whereData.LOTNO.Trim() != "")
                whereString += (whereString == "" ? "" : "AND ") + "LOTNO = '" + OracleDB.QRText(whereData.LOTNO.Trim()) + "' ";

            string sql = "SELECT ROWNUM NO,A.* FROM (SELECT PDP.LOID,PDP.MFGDATE,PDP.QUARANTINEDATE,PDP.PRODUCT, ";
            sql += "PD.NAME PRODUCTNAME,PDP.LOTNO,PDP.PDQTY,U.NAME UNITNAME,PDP.QUARANTINEREMARK, ";
            sql += "PDP.STDQTY,PDP.YIELD,PDP.SENDFGDATE,PO.ORDERDATE ";
            sql += "FROM PDPRODUCT PDP INNER JOIN PDORDER PO ON PDP.PDORDER = PO.LOID ";
            sql += "INNER JOIN PRODUCT PD ON PDP.PRODUCT = PD.LOID INNER JOIN UNIT U ON PD.UNIT = U.LOID)A ";
            sql += (whereString == "" ? "" : "WHERE " + whereString);
            sql += "ORDER BY NO ";

            return OracleDB.ExecListCmd(sql);
        }
Exemplo n.º 2
0
 private ProductionLostSearchData GetData()
 {
     ProductionLostSearchData data = new ProductionLostSearchData();
     data.MFGDATEFROM = this.ctlMfgDateFrom.DateValue;
     data.MFGDATETO = this.ctlMfgDateTo.DateValue;
     data.SENDFGDATEFROM = this.ctlSendFGDateFrom.DateValue;
     data.SENDFGDATETO = this.ctlSendFGDateTo.DateValue;
     data.ORDERDATEFROM = this.ctlOrderDateFrom.DateValue;
     data.ORDERDATETO = this.ctlOrderDateTo.DateValue;
     data.PRODUCT = Convert.ToDouble(this.cmbProduct.SelectedItem.Value);
     data.LOTNO = this.txtLotNo.Text.Trim();
     return data;
 }
Exemplo n.º 3
0
 public DataTable GetProductionLostList(ProductionLostSearchData data)
 {
     return SearchDAL.GetProductionLostList(data);
 }