private void GetNewPriceChangeQuoteNumber(string quoteNumber) { ObjectParameter NewQuoteNumber = new ObjectParameter("NewQuoteNumber", typeof(string)); try { Context.usp_QT_GetPriceChangeModificationQuoteNumber(quoteNumber, NewQuoteNumber); layoutView1.SetRowCellValue(0, "QuoteNumber", NewQuoteNumber.Value.ToString()); } catch (Exception ex) { if (ex.InnerException != null) { //MessageBox.Show(ex.InnerException.ToString().Remove(ex.InnerException.ToString().IndexOf("at System.")), "Error"); MessageBox.Show("Error occured. Failed to return a new quote number."); } } }
public string GetNewPriceChangeQuoteNumber(string quoteNumber, out string errorMessage) { errorMessage = ""; ObjectParameter NewQuoteNumber = new ObjectParameter("NewQuoteNumber", typeof(string)); try { _context.usp_QT_GetPriceChangeModificationQuoteNumber(quoteNumber, NewQuoteNumber); if (NewQuoteNumber.Value.ToString().Length > 44) // Instead of a quote number, an error was returned { errorMessage = "There's a more current price for that rev."; return(""); } return(NewQuoteNumber.Value.ToString()); } catch (Exception ex) { errorMessage = "Failed to create a new Quote Number for price change."; } return(""); }