private bool IsSearchCriteriaMatched(SaleOrderEntity currentRow) { return currentRow.SaleOrderNumber.ToString() .ToLower() .Contains(txtSearch.Text .ToLower()) || currentRow.QuoteNumber.ToString() .ToLower() .Contains(txtSearch.Text .ToLower()) || currentRow.FullName.ToString() .ToLower() .Contains(txtSearch.Text .ToLower()) || currentRow.RecordedDate.ToString() .ToLower() .Contains(txtSearch.Text .ToLower()) || currentRow.Total.ToString() .ToLower() .Contains(txtSearch.Text .ToLower()) || currentRow.PaymentType.ToString() .ToLower() .Contains(txtSearch.Text .ToLower()) || currentRow.WorksheetNumber.ToString() .ToLower() .Contains(txtSearch.Text .ToLower()) || currentRow.CustomerPONumber.ToString() .ToLower() .Contains(txtSearch.Text .ToLower()); }
internal static ObservableCollection<SaleOrderEntity> GetSaleOrderMasterData() { ObservableCollection<SaleOrderEntity> quoteMasterData = null; try { var result = SQLHelper.ExecuteStoredProcedure(StoredProcedures.GetSaleOrderMasterData, null); if (result == null || result.Tables == null || result.Tables.Count == 0) { return quoteMasterData; } quoteMasterData = new ObservableCollection<SaleOrderEntity>(); SaleOrderEntity temp = null; object dbValue = null; for (int rowIndex = 0; rowIndex < result.Tables[0].Rows.Count; rowIndex++) { temp = new SaleOrderEntity(); dbValue = result.Tables[0].Rows[rowIndex][ColumnNames.SONumber]; temp.SaleOrderNumber = dbValue == DBNull.Value ? string.Empty : dbValue.ToString(); dbValue = result.Tables[0].Rows[rowIndex][ColumnNames.QuoteNumber]; temp.QuoteNumber = dbValue == DBNull.Value ? string.Empty : dbValue.ToString(); dbValue = result.Tables[0].Rows[rowIndex][ColumnNames.FullName]; temp.FullName = dbValue == DBNull.Value ? string.Empty : dbValue.ToString(); dbValue = result.Tables[0].Rows[rowIndex][ColumnNames.ConfirmedDate]; temp.RecordedDate = dbValue == DBNull.Value ? string.Empty : dbValue.ToString(); dbValue = result.Tables[0].Rows[rowIndex][ColumnNames.GrandTotal]; temp.Total = dbValue == DBNull.Value ? string.Empty : double.Parse(dbValue.ToString()).ToString("0.00"); dbValue = result.Tables[0].Rows[rowIndex][ColumnNames.PaymentType]; temp.PaymentType = dbValue == DBNull.Value ? string.Empty : dbValue.ToString(); dbValue = result.Tables[0].Rows[rowIndex][ColumnNames.WSNumber]; temp.WorksheetNumber = dbValue == DBNull.Value ? string.Empty : dbValue.ToString(); dbValue = result.Tables[0].Rows[rowIndex][ColumnNames.CustomerPO]; temp.CustomerPONumber = dbValue == DBNull.Value ? string.Empty : dbValue.ToString(); quoteMasterData.Add(temp); } } catch (Exception ex) { Logger.LogException(ex); } return quoteMasterData; }