public virtual EmailResult Option(OptionPick optionPick) { To.Add("*****@*****.**"); Subject = "New Option Pick (" + optionPick.Symbol + ")"; return(this.Email(viewName: "OptionPickEmail", model: optionPick)); }
public ActionResult OptionPickDetail(int optionPickId) { OptionPick pick = _database.OptionPicks.Include(o => o.Type).Include(o => o.Updates).Include(o => o.Legs).FirstOrDefault(optionPick => optionPick.PickId == optionPickId); if (pick == null) { return(this.HttpNotFound("Invalid option pick information")); } else if (!pick.ClosingDate.HasValue && !Request.IsAuthenticated) { System.Web.Security.FormsAuthentication.RedirectToLoginPage(); } return(this.View(pick)); }
public ActionResult Create(OptionPickLeg optionpickleg, int optionPickId) { if (ModelState.IsValid) { OptionPick optionPick = db.OptionPicks.Find(optionPickId); if (optionPick != null) { optionPick.Legs.Add(optionpickleg); db.SaveChanges(); return(this.RedirectToAction("Edit", "OptionPicks", new { id = optionPickId })); } } ViewBag.OptionPickId = optionPickId; return(View(optionpickleg)); }
public static void Send(OptionPick optionPick, bool isPreview) { EmailResult email = new Mailers.Picks().Option(optionPick); // Add recepients to the email IQueryable<User> recipients = null; if (isPreview) { recipients = GetAdmins(); } else { recipients = GetActiveUsers().Where(u => u.NotificationSettings.ReceiveOptionPicks); } Email.SendEmail(email, recipients, sendToAutoTrading: !isPreview); }
public FileContentResult OptionPickExpiryGraph(int pickId) { OptionPick optionPick = _database.OptionPicks.Find(pickId); Chart expiryGraph = optionPick.ExpiryGraph(); expiryGraph.Width = 500; expiryGraph.Height = 333; expiryGraph.RenderType = RenderType.ImageTag; MemoryStream imageStream = new MemoryStream(); expiryGraph.ImageType = ChartImageType.Png; expiryGraph.SaveImage(imageStream); imageStream.Seek(0, SeekOrigin.Begin); return(this.File(imageStream.ToArray(), "image/png")); }