public void GetQuoteFile(string quote, string attachmentCategory, out string fileName, out byte[] fileContents) { ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?)); ObjectParameter result = new ObjectParameter("Result", typeof(Int32?)); Error = ""; fileName = ""; fileContents = null; try { using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer()) { var collection = context.usp_QT_FileManagement_Get(quote, attachmentCategory, tranDT, result); var item = collection.ToList().First(); fileName = item.FileName; fileContents = item.FileContents; } } catch (Exception ex) { string err = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message; } }
public void ShowQuoteFileInfo(string quote, string attachmentCategory) { ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?)); ObjectParameter result = new ObjectParameter("Result", typeof(Int32?)); Error = QuoteFileName = ""; try { using (var context = new MONITOREntitiesQuoteLogIntegrationQuoteTransfer()) { var collection = context.usp_QT_FileManagement_Get(quote, attachmentCategory, tranDT, result).ToList(); foreach (var item in collection) { QuoteFileName = item.FileName; } } } catch (Exception ex) { Error = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message; } }