Ejemplo n.º 1
0
        public MySqlDataReader Search(WBranchTransferItemStatus WBranchTransferItemstatus, string SearchKey, string SortField, SortOption SortOrder)
        {
            try
            {
                if (SortField == string.Empty || SortField == null)
                {
                    SortField = "WBranchTransferItemID";
                }

                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;

                cmd.Parameters.AddWithValue("@WBranchTransferItemStatus", WBranchTransferItemstatus.ToString("d"));
                cmd.Parameters.AddWithValue("@SearchKey", "%" + SearchKey + "%");

                MySqlDataReader myReader = base.ExecuteReader(cmd);

                return(myReader);
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Ejemplo n.º 2
0
        public MySqlDataReader List(WBranchTransferItemStatus WBranchTransferItemstatus, string SortField, SortOption SortOrder)
        {
            try
            {
                if (SortField == string.Empty || SortField == null)
                {
                    SortField = "WBranchTransferItemID";
                }

                string SQL = SQLSelect() + "WHERE WBranchTransferItemStatus = @WBranchTransferItemStatus " +
                             "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;

                cmd.Parameters.AddWithValue("@WBranchTransferItemStatus", WBranchTransferItemstatus.ToString("d"));

                MySqlDataReader myReader = base.ExecuteReader(cmd);

                return(myReader);
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Ejemplo n.º 3
0
		public MySqlDataReader Search(WBranchTransferItemStatus WBranchTransferItemstatus, string SearchKey, string SortField, SortOption SortOrder)
		{
			try
			{
                if (SortField == string.Empty || SortField == null) SortField = "WBranchTransferItemID";

				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;
				
                cmd.Parameters.AddWithValue("@WBranchTransferItemStatus", WBranchTransferItemstatus.ToString("d"));
                cmd.Parameters.AddWithValue("@SearchKey", "%" + SearchKey + "%");

				MySqlDataReader myReader = base.ExecuteReader(cmd);
				
				return myReader;			
			}
			catch (Exception ex)
			{
				throw base.ThrowException(ex);
			}	
		}		
Ejemplo n.º 4
0
		public MySqlDataReader List(WBranchTransferItemStatus WBranchTransferItemstatus, string SortField, SortOption SortOrder)
		{
			try
			{
                if (SortField == string.Empty || SortField == null) SortField = "WBranchTransferItemID";

				string SQL = SQLSelect() + "WHERE WBranchTransferItemStatus = @WBranchTransferItemStatus " +
							"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;
				
				cmd.Parameters.AddWithValue("@WBranchTransferItemStatus", WBranchTransferItemstatus.ToString("d"));

				MySqlDataReader myReader = base.ExecuteReader(cmd);
				
				return myReader;			
			}
			catch (Exception ex)
			{
				throw base.ThrowException(ex);
			}	
		}