public static byte[] ExportDataForMetaStoxToExcel(ExportDataForMetaStoxCollection exportDataForMetaStoxCollection, string templatePath) { Dictionary<string, object> model = new Dictionary<string, object>(); model["ExportDataForMetaStoxCollection"] = exportDataForMetaStoxCollection; return ExportToExcel(model, templatePath); }
public virtual ExportDataForMetaStoxCollection GetExportIndexForMetaStoxList(DateTime PermDate, int marketId) { try { Database database = DatabaseFactory.CreateDatabase("DestinationConnection"); DbCommand dbCommand = database.GetStoredProcCommand("spExportIndexForMetaStox"); database.AddInParameter(dbCommand, "@PermDate", DbType.DateTime, PermDate); database.AddInParameter(dbCommand, "@MarketId", DbType.Int32, marketId); ExportDataForMetaStoxCollection EDMetaCollection = new ExportDataForMetaStoxCollection(); using (IDataReader reader = database.ExecuteReader(dbCommand)) { while (reader.Read()) { ExportDataForMetaStox EDMeta = CreateExportDataForMetaStoxFromReader(reader); EDMetaCollection.Add(EDMeta); } reader.Close(); } return EDMetaCollection; } catch (Exception ex) { // log this exception log4net.Util.LogLog.Error(ex.Message, ex); // wrap it and rethrow throw new ApplicationException(SR.DataAccessGetstock_SymbolPermLongListException, ex); } }