public ActionResult AddTickerAlias(string brokerCodeArg, string tickerNameArg) { if (string.IsNullOrWhiteSpace(brokerCodeArg)) { Logger.Error(string.Format("DeleteTickerAlias - невалидный параметр brokerCodeArg: '{0}'", brokerCodeArg)); return RedirectToAction("TickerAliasEdit", new { brokerCode = brokerCodeArg }); } ViewBag.ServerCodeList = serverInstanceRepository.GetServerCodes(); ViewBag.TickerNameList = tickerRepository.GetTickerNames(); var model = new TickerAlias { Server = brokerCodeArg }; if (!string.IsNullOrEmpty(tickerNameArg)) { var tick = tickerRepository.GetTickerAlias(brokerCodeArg, tickerNameArg); model.Ticker = tickerNameArg; model.Alias = tick == null ? string.Format("{0}_{1}_alias", brokerCodeArg, tickerNameArg) : tick.Alias; } return View(model); }
public ActionResult AddTickerAlias(TickerAlias model) { tickerRepository.AddOrUpdateTickerAlias(model); return RedirectToAction("TickerAliasEdit", new { brokerCode = model.Server }); }