public Dictionary<string, int> GetLastRefreshNr(String marketIds) { Dictionary<string, int> result = new Dictionary<string, int>(); try { string query = null; using (var ctx = new bfmsEntities()) { query = "SELECT MAX(RefreshNr) as RefreshNr,Marketbook.* from Marketbook where Marketid in (" + marketIds + ") group by marketid"; var RefrNrList = ctx.Database.SqlQuery<marketbook>(query).ToList(); foreach (var row in RefrNrList) { result.Add(row.MarketId, row.RefreshNr); } } } catch (Exception ex) { logger.Fatal(Util.FormatExc(ex)); } return result; }
static ExportCSV() { reportFields = new Dictionary<string, Dictionary<string, string[]>>(); reportFields.Add("data_account", new Dictionary<string, string[]> { { "month", new string[] { "出账月份", "date", "{0:yyyy-MM}" } }, { "city", new string[] { "地市", "param" } }, { "product", new string[] { "产品", "param" } }, { "type", new string[] { "出账类型", "param" } }, { "money", new string[] { "出账金额", "money" } } }); reportFields.Add("data_cardsale", new Dictionary<string, string[]> { { "date", new string[] { "销售日期", "date", "{0:yyyy-MM-dd}" } }, { "city", new string[] { "地市", "param" } }, { "product", new string[] { "产品", "param" } }, { "number", new string[] { "卡销售数量", "int" } }, { "unit_price", new string[] { "面值金额", "money" } }, { "total_price", new string[] { "总金额", "money" } }, { "final_price", new string[] { "实售金额", "money" } } }); reportFields.Add("data_notice", new Dictionary<string, string[]> { { "date", new string[] { "营业收款日期", "date", "{0:yyyy-MM-dd}" } }, { "city", new string[] { "地市", "param" } }, { "product", new string[] { "产品", "param" } }, { "type", new string[] { "通知单类型", "param" } }, { "money", new string[] { "营业收入金额", "money" } } }); reportFields.Add("data_prestore", new Dictionary<string, string[]> { { "date", new string[] { "销账日期", "date", "{0:yyyy-MM-dd}" } }, { "city", new string[] { "地市", "param" } }, { "product", new string[] { "产品", "param" } }, { "type", new string[] { "销账类型", "param" } }, { "money", new string[] { "销账金额", "money" } } }); reportFields.Add("data_settlement", new Dictionary<string, string[]> { { "month", new string[] { "结算月份", "date", "{0:yyyy-MM}" } }, { "city", new string[] { "地市", "param" } }, { "product", new string[] { "产品", "param" } }, { "operator", new string[] { "结算运营商", "param" } }, { "type", new string[] { "结算类型", "param" } }, { "money", new string[] { "结算金额", "money" } } }); }
public ActionResult DownloadOrderAsPdf(int id = 0) { string cookieName = OpenIdMembershipService.LOGIN_COOKIE_NAME; HttpCookie cookie = Request.Cookies[cookieName]; Dictionary<string, string> cookies = new Dictionary<string, string>(); cookies.Add(cookieName, cookie.Value); int? historyActionId = null; Order order; using (OrdersHistoryRepository ordersHistoryRep = new OrdersHistoryRepository(CurrentUser.CompanyId, CurrentUser.UserId, id)) using (OrdersRepository ordersRep = new OrdersRepository(CurrentUser.CompanyId)) { order = ordersRep.GetEntity(id); historyActionId = (int)HistoryActions.OrderPrinted; Orders_History orderHistory = new Orders_History(); if (historyActionId.HasValue) ordersHistoryRep.Create(orderHistory, historyActionId.Value); } return new ActionAsPdf("PrintOrderToScreen", new { password = PRINT_PASSWORD, id = id, companyId = CurrentUser.CompanyId, userId = CurrentUser.UserId, userRoles = CurrentUser.Roles, languageCode = CurrentUser.LanguageCode, coinSign = CurrentUser.CompanyCoinSign }) { FileName = String.Format("Order_{0}.pdf", order.OrderNumber) }; }