Beispiel #1
0
         public DataTable GetPDRequestList(QCAnalysisSearchData data)
         {
             string whereString = "";

             if (data.QCCODE.Trim() != "")
                 whereString += (whereString == "" ? "" : "AND ") + "QCCODE = '" + OracleDB.QRText(data.QCCODE.Trim()) + "' ";
             if (data.DATEFROM.Year != 1)
                 whereString += (whereString == "" ? "" : "AND ") + "QCDATE >= " + OracleDB.QRDate(data.DATEFROM) + " ";
             if (data.DATETO.Year != 1)
                 whereString += (whereString == "" ? "" : "AND ") + "QCDATE <= " + OracleDB.QRDate(data.DATETO) + " ";
             if (data.CODE.Trim() != "")
                 whereString += (whereString == "" ? "" : "AND ") + "CODE = '" + OracleDB.QRText(data.CODE.Trim()) + "' ";
             if (data.STATUSFROM.Trim() != "")
                 whereString += (whereString == "" ? "" : "AND ") + "RANK >= '" + OracleDB.QRText(data.STATUSFROM.Trim()) + "' ";
             if (data.STATUSTO.Trim() != "")
                 whereString += (whereString == "" ? "" : "AND ") + "RANK <= '" + OracleDB.QRText(data.STATUSTO.Trim()) + "' ";

             string sql = "select ROWNUM NO,A.* from (SELECT STLOID, QCCODE, QCDATE, CODE, PDLOID, PDNAME, QTY, UNAME, APPROVER, DVNAME, STATUSVAL,TABLENAME, ";
             sql += "CASE STATUSVAL WHEN '" + Constz.Requisition.Status.SendQC.Name + "' THEN '" + Constz.Requisition.Status.SendQC.Name + "' ";
             sql += "WHEN '" + Constz.Requisition.Status.ReturnQC.Name + "' THEN '" + Constz.Requisition.Status.ReturnQC.Name + "' ";
             sql += "ELSE '' END AS STATUSNAME, ";
             sql += "CASE STATUSVAL WHEN '" + Constz.Requisition.Status.SendQC.Name + "' THEN '" + Constz.Requisition.Status.SendQC.Rank + "' ";
             sql += "WHEN '" + Constz.Requisition.Status.ReturnQC.Name + "' THEN '" + Constz.Requisition.Status.ReturnQC.Rank + "' ";
             sql += "ELSE '' END AS RANK ";
             sql += "FROM V_TODOLIST_QC ) A ";
             sql += (whereString == "" ? "" : "WHERE " + whereString);

             DataTable dt = OracleDB.ExecListCmd(sql);
             
             return dt;
         }
 private QCAnalysisSearchData GetData()
 {
     QCAnalysisSearchData data = new QCAnalysisSearchData();
     data.QCCODE = this.txtCode.Text.Trim();
     data.DATEFROM = this.ctlDateFrom.DateValue;
     data.DATETO = this.ctlDateTo.DateValue;
     data.CODE = this.txtLotNo.Text.Trim();
     data.STATUSFROM = this.cmbStatusFrom.SelectedItem.Value;
     data.STATUSTO = this.cmbStatusTo.SelectedItem.Value;
     return data;
 }