private void SearchData()
    {
        SearchFlow flow = new SearchFlow();
        PopupProductPRSearchData data = new PopupProductPRSearchData();
        data.PRCODEFROM = this.txtFromPRCode.Text.Trim();
        data.PRCODETO = this.txtToPRCode.Text.Trim();
        data.DUEDATEFROM = this.ctlFromDueDate.DateValue;
        data.DUEDATETO = this.ctlToDueDate.DateValue;
        if (Convert.ToDouble(this.cmbPurchaseType.SelectedValue) != 0)
        {
            data.PURCHASETYPE = this.cmbPurchaseType.SelectedItem.Text;
        }
        if (Convert.ToDouble(this.cmbProduct.SelectedValue) != 0)
        {
            data.PRODUCT = this.cmbProduct.SelectedItem.Text;
        }
        if (Convert.ToDouble(this.cmbDivision.SelectedValue) != 0)
        {
            data.DIVISION = this.cmbDivision.SelectedItem.Text;
        }

        this.grvReserve.DataSource = flow.GetProductPRList(data);
        this.grvReserve.DataBind();
    }
Beispiel #2
0
        public static DataTable GetProductPRList(PopupProductPRSearchData data)
        {
            string where = "QTY > 0 ";

            if (data.PRCODEFROM.Trim() != "")
                where += (where == "" ? "" : "AND ") + "UPPER(PRCODE) >= '" + OracleDB.QRText(data.PRCODEFROM.Trim()).ToUpper() + "' ";

            if (data.PRCODETO.Trim() != "")
                where += (where == "" ? "" : "AND ") + "UPPER(PRCODE) <= '" + OracleDB.QRText(data.PRCODETO.Trim()).ToUpper() + "' ";

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

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

            if (data.PURCHASETYPE.Trim() != "")
                where += (where == "" ? "" : "AND ") + "UPPER(PURCHASETYPE) = '" + OracleDB.QRText(data.PURCHASETYPE.Trim()).ToUpper() + "' ";

            if (data.PRODUCT.Trim() != "")
                where += (where == "" ? "" : "AND ") + "UPPER(PDNAME) = '" + OracleDB.QRText(data.PRODUCT.Trim()).ToUpper() + "' ";

            if (data.DIVISION.Trim() != "")
                where += (where == "" ? "" : "AND ") + "UPPER(DVNAME) = '" + OracleDB.QRText(data.DIVISION.Trim()).ToUpper() + "' ";

            string sql = "SELECT * FROM v_product_po_popup_list ";
            sql += (where == "" ? "" : "WHERE " + where);
            sql += "ORDER BY PRCODE ";
            return OracleDB.ExecListCmd(sql);
        }
Beispiel #3
0
 public DataTable GetProductPRList (PopupProductPRSearchData data)
 {
     return SearchDAL.GetProductPRList(data);
 }