Exemple #1
0
        internal static ObservableCollection<QuoteMasterEntity> GetQuoteMasterData()
        {
            ObservableCollection<QuoteMasterEntity> quoteMasterData = null;
            try
            {
                var result = SQLHelper.ExecuteStoredProcedure(StoredProcedures.GetQuoteMasterData, null);

                if (result == null || result.Tables == null || result.Tables.Count == 0)
                { return quoteMasterData; }

                quoteMasterData = new ObservableCollection<QuoteMasterEntity>();
                QuoteMasterEntity temp = null;
                for (int rowIndex = 0; rowIndex < result.Tables[0].Rows.Count; rowIndex++)
                {
                    temp = new QuoteMasterEntity();
                    temp.QuoteStatus = result.Tables[0].Rows[rowIndex][ColumnNames.Status] == DBNull.Value ? string.Empty : result.Tables[0].Rows[rowIndex][ColumnNames.Status].ToString();
                    temp.QuoteNumber = result.Tables[0].Rows[rowIndex][ColumnNames.QuoteNumber] == DBNull.Value ? string.Empty : result.Tables[0].Rows[rowIndex][ColumnNames.QuoteNumber].ToString();
                    temp.FullName = result.Tables[0].Rows[rowIndex][ColumnNames.FullName] == DBNull.Value ? string.Empty : result.Tables[0].Rows[rowIndex][ColumnNames.FullName].ToString();
                    temp.CreatedOn = result.Tables[0].Rows[rowIndex][ColumnNames.CreatedOn] == DBNull.Value ? string.Empty : result.Tables[0].Rows[rowIndex][ColumnNames.CreatedOn].ToString();
                    temp.Total = result.Tables[0].Rows[rowIndex][ColumnNames.Total] == DBNull.Value ? string.Empty : double.Parse(result.Tables[0].Rows[rowIndex][ColumnNames.Total].ToString()).ToString("0.00");
                    temp.EstimatedShipDate = result.Tables[0].Rows[rowIndex][ColumnNames.EstimatedShipDate] == DBNull.Value ? string.Empty : result.Tables[0].Rows[rowIndex][ColumnNames.EstimatedShipDate].ToString();
                    temp.PaymentType = result.Tables[0].Rows[rowIndex][ColumnNames.PaymentType] == DBNull.Value ? string.Empty : result.Tables[0].Rows[rowIndex][ColumnNames.PaymentType].ToString();
                    temp.CustomerPONumber = result.Tables[0].Rows[rowIndex][ColumnNames.CustomerPONumber] == DBNull.Value ? string.Empty : result.Tables[0].Rows[rowIndex][ColumnNames.CustomerPONumber].ToString();

                    quoteMasterData.Add(temp);
                }
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
            return quoteMasterData;
        }
        private bool IsSearchCriteriaMatched(QuoteMasterEntity currentRow)
        {
            return currentRow.QuoteStatus.ToString()
                                              .ToLower()
                                              .Contains(txtSearch.Text
                                                                .ToLower()) ||
                                        currentRow.QuoteNumber.ToString()
                                              .ToLower()
                                              .Contains(txtSearch.Text
                                                                .ToLower()) ||
                                    currentRow.FullName.ToString()
                                              .ToLower()
                                              .Contains(txtSearch.Text
                                                                .ToLower()) ||

                                    currentRow.CreatedOn.ToString()
                                              .ToLower()
                                              .Contains(txtSearch.Text
                                                                .ToLower()) ||
                                    currentRow.Total.ToString()
                                              .ToLower()
                                              .Contains(txtSearch.Text
                                                                .ToLower()) ||
                                    currentRow.EstimatedShipDate.ToString()
                                              .ToLower()
                                              .Contains(txtSearch.Text
                                                                .ToLower()) ||
                                    currentRow.PaymentType.ToString()
                                              .ToLower()
                                              .Contains(txtSearch.Text
                                                                .ToLower()) ||
                                    currentRow.CustomerPONumber.ToString()
                                              .ToLower()
                                              .Contains(txtSearch.Text
                                                                .ToLower());
        }