Exemplo n.º 1
0
    private void SearchData()
    {
        ProductionToDoListFlow flow = new ProductionToDoListFlow();
        ProductionDuringListSearchData data = new ProductionDuringListSearchData();
        data.LOTNO = this.txtLotNo.Text.Trim();
        data.DATEFROM = this.dtpDateFrom.DateValue;
        data.DATETO = this.dtpDateTo.DateValue;
        data.PDNAME = this.txtPDName.Text.Trim();

        this.grvProductionDuring.DataSource = flow.GetProductionDuringList(data);
        this.grvProductionDuring.DataBind();
    }
Exemplo n.º 2
0
        public DataTable GetProductionDuringList(ProductionDuringListSearchData data)
        {
            string where = "";

            if (data.LOTNO.Trim() != "")
                where += (where == "" ? "" : "AND ") + "UPPER(LOTNO) LIKE '%" + data.LOTNO.Trim().ToUpper() + "%' ";

            if (data.DATEFROM.Year != 1)
                where += (where == "" ? "" : "AND ") + "TO_DATE(MFGDATE, 'DDMMYYYY') >= " + OracleDB.QRDate(data.DATEFROM) + " ";

            if (data.DATETO.Year != 1)
                where += (where == "" ? "" : "AND ") + "TO_DATE(MFGDATE, 'DDMMYYYY') <= " + OracleDB.QRDate(data.DATETO) + " ";

            if (data.PDNAME.Trim() != "")
                where += (where == "" ? "" : "AND ") + "UPPER(PDNAME) LIKE '%" + data.PDNAME.Trim().ToUpper() + "%' ";

            string sql = "SELECT PDPLOID, POLOID, LOTNO, PDNAME, MFGDATE, STDQTY, PDQTY, UNAME, DUEDATE, SUPPLIERNAME, QUARANTINEDATE, SENDQCDATE, QCDUEDATE, QCRESULT, SENDFGDATE ";
            sql += "FROM V_TODOLIST_PD_DURING ";
            sql += (where == "" ? "" : "WHERE " + where);
            return OracleDB.ExecListCmd(sql);
        }