public HtmlInvestmentProofGenerator(InvestmentTicket ticket) { this.ticket = ticket; user = new Member(ticket.UserId); fileName = string.Format("{0}.pdf", ticket.GenerateTicketNumber()); platformPlan = new InvestmentPlatformPlan(new InvestmentUsersPlans(ticket.UserPlanId).PlanId); }
protected void TicketsGridView_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "download") { int index = e.GetSelectedRowIndex() % TicketsGridView.PageSize; GridViewRow row = TicketsGridView.Rows[index]; var ticket = new InvestmentTicket(Convert.ToInt32(row.Cells[0].Text.Trim())); var proof = new HtmlInvestmentProofGenerator(ticket); proof.DownloadPdf(); } }