private void SearchData() { SearchFlow flow = new SearchFlow(); SearchInvoiceData data = new SearchInvoiceData(); data.CUSTOMER = this.txtCustomerName.Text.Trim(); data.INVCODEFROM = this.txtCodeFrom.Text.Trim(); data.INVCODETO = this.txtCodeTo.Text.Trim(); data.REQUISITIONTYPE = Convert.ToDouble(this.cmbRequisitionType.SelectedItem.Value); this.grvReserve.DataSource = flow.GetInvoiceList(data); this.grvReserve.DataBind(); }
public static DataTable GetInvoiceList(SearchInvoiceData data) { string where = ""; if (data.CUSTOMER.Trim() != "") where += (where == "" ? "" : "AND ") + "UPPER(CUSTOMERNAME) LIKE '%" + data.CUSTOMER.Trim().ToUpper() + "%' "; if (data.INVCODEFROM.Trim() != "") where += (where == "" ? "" : "AND ") + "UPPER(INVCODE) >= '%" + data.INVCODEFROM.Trim().ToUpper() + "%' "; if (data.INVCODETO.Trim() != "") where += (where == "" ? "" : "AND ") + "UPPER(INVCODE) <= '%" + data.INVCODETO.Trim().ToUpper() + "%' "; if (data.REQUISITIONTYPE != 0) where += (where == "" ? "" : "AND ") + "REFTYPELOID = " + data.REQUISITIONTYPE.ToString() + " "; string sql = "SELECT LOID, INVCODE, TYPENAME, CUSTOMERNAME FROM V_INVOICE_FOR_DELIVERLY "; sql += (where == "" ? "" : "WHERE " + where); sql += "ORDER BY TYPENAME, CUSTOMERNAME, INVCODE"; return OracleDB.ExecListCmd(sql); }
public DataTable GetInvoiceList(SearchInvoiceData data) { return SearchDAL.GetInvoiceList(data); }