public DataTable GetProductionStockoutQuarantineList(ProductStockoutQuarantineSearchData 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.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,PDP.QCQTY1,PDP.QCQTY2,PDP.QCQTY3,U.NAME UNITNAME,PDP.QUARANTINEREMARK, "; sql += "PDP.STDQTY-PDP.PDQTY AS BADQTY,PDP.SENDFGQTY,PDP.SENDFGDATE,PDP.SENDFGREMARK "; 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); }
private ProductStockoutQuarantineSearchData GetData() { ProductStockoutQuarantineSearchData data = new ProductStockoutQuarantineSearchData(); data.MFGDATEFROM = this.ctlMFGDateFrom.DateValue; data.MFGDATETO = this.ctlMFGDateTo.DateValue; data.SENDFGDATEFROM = this.ctlSendFGDateFrom.DateValue; data.SENDFGDATETO = this.ctlSendFGDateTo.DateValue; data.PRODUCT = Convert.ToDouble(this.cmbProduct.SelectedItem.Value); data.LOTNO = this.txtLotNo.Text.Trim(); return data; }
public DataTable GetProductionStockoutQuarantineList(ProductStockoutQuarantineSearchData data) { return SearchDAL.GetProductionStockoutQuarantineList(data); }