public MySqlDataReader Search(TransferInItemStatus TransferInItemstatus, string SearchKey, string SortField, SortOption SortOrder) { try { if (SortField == string.Empty || SortField == null) { SortField = "TransferInItemID"; } string SQL = SQLSelect() + "WHERE (ProductCode LIKE @SearchKey or BarCode LIKE @SearchKey or Description LIKE @SearchKey " + "or MatrixDescription LIKE @SearchKey or ProductGroup LIKE @SearchKey or ProductSubGroup LIKE @SearchKey " + "or Remarks LIKE @SearchKey) " + "ORDER BY " + SortField; if (SortOrder == SortOption.Ascending) { SQL += " ASC"; } else { SQL += " DESC"; } MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; MySqlParameter prmTransferInItemStatus = new MySqlParameter("@TransferInItemStatus", MySqlDbType.Int16); prmTransferInItemStatus.Value = TransferInItemstatus.ToString("d"); cmd.Parameters.Add(prmTransferInItemStatus); MySqlParameter prmSearchKey = new MySqlParameter("@SearchKey", MySqlDbType.String); prmSearchKey.Value = "%" + SearchKey + "%"; cmd.Parameters.Add(prmSearchKey); MySqlDataReader myReader = base.ExecuteReader(cmd); return(myReader); } catch (Exception ex) { throw base.ThrowException(ex); } }
public MySqlDataReader List(TransferInItemStatus TransferInItemstatus, string SortField, SortOption SortOrder) { try { if (SortField == string.Empty || SortField == null) { SortField = "TransferInItemID"; } string SQL = SQLSelect() + "WHERE TransferInItemStatus = @TransferInItemStatus " + "ORDER BY " + SortField; if (SortOrder == SortOption.Ascending) { SQL += " ASC"; } else { SQL += " DESC"; } MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; MySqlParameter prmTransferInItemStatus = new MySqlParameter("@TransferInItemStatus", MySqlDbType.Int16); prmTransferInItemStatus.Value = TransferInItemstatus.ToString("d"); cmd.Parameters.Add(prmTransferInItemStatus); MySqlDataReader myReader = base.ExecuteReader(cmd); return(myReader); } catch (Exception ex) { throw base.ThrowException(ex); } }
public MySqlDataReader Search(TransferInItemStatus TransferInItemstatus, string SearchKey, string SortField, SortOption SortOrder) { try { if (SortField == string.Empty || SortField == null) SortField = "TransferInItemID"; string SQL = SQLSelect() + "WHERE (ProductCode LIKE @SearchKey or BarCode LIKE @SearchKey or Description LIKE @SearchKey " + "or MatrixDescription LIKE @SearchKey or ProductGroup LIKE @SearchKey or ProductSubGroup LIKE @SearchKey " + "or Remarks LIKE @SearchKey) " + "ORDER BY " + SortField; if (SortOrder == SortOption.Ascending) SQL += " ASC"; else SQL += " DESC"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; MySqlParameter prmTransferInItemStatus = new MySqlParameter("@TransferInItemStatus",MySqlDbType.Int16); prmTransferInItemStatus.Value = TransferInItemstatus.ToString("d"); cmd.Parameters.Add(prmTransferInItemStatus); MySqlParameter prmSearchKey = new MySqlParameter("@SearchKey",MySqlDbType.String); prmSearchKey.Value = "%" + SearchKey + "%"; cmd.Parameters.Add(prmSearchKey); MySqlDataReader myReader = base.ExecuteReader(cmd); return myReader; } catch (Exception ex) { throw base.ThrowException(ex); } }
public MySqlDataReader List(TransferInItemStatus TransferInItemstatus, string SortField, SortOption SortOrder) { try { if (SortField == string.Empty || SortField == null) SortField = "TransferInItemID"; string SQL = SQLSelect() + "WHERE TransferInItemStatus = @TransferInItemStatus " + "ORDER BY " + SortField; if (SortOrder == SortOption.Ascending) SQL += " ASC"; else SQL += " DESC"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; MySqlParameter prmTransferInItemStatus = new MySqlParameter("@TransferInItemStatus",MySqlDbType.Int16); prmTransferInItemStatus.Value = TransferInItemstatus.ToString("d"); cmd.Parameters.Add(prmTransferInItemStatus); MySqlDataReader myReader = base.ExecuteReader(cmd); return myReader; } catch (Exception ex) { throw base.ThrowException(ex); } }