protected void gvDonorEvents_RowCommand(object sender, GridViewCommandEventArgs e) { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = gvDonorEvents.Rows[index]; int intEL = int.Parse(ddlEvents.SelectedValue.ToString()); string strDonor = row.Cells[0].Text.ToString(); DonorEventList DEL = new DonorEventList(User.Identity.Name); DEL.Load(intEL, strDonor); DEL.TicketsMailed_Date = DateTime.Now; DEL.TicketsMailed_User = User.Identity.Name; //DEL.TicketsRequested = int.Parse(txtAttending.Text.ToString()); DEL.MailCards(); LoadGrid(); //gvDonorEvents.Rows[index].Visible = false; }
protected void btnMailNow_OnClick(object sender, EventArgs e) { for (var i = 0; i < gvReport.Rows.Count; i++) { var chkMail = gvReport.Rows[i].FindControl("chkMail") as CheckBox; if (chkMail == null || !chkMail.Checked) continue; var ticketCount = gvReport.Rows[i].Cells[8].Text; var dataKey = gvReport.DataKeys[i]; if (dataKey == null) continue; var key = dataKey.Value; var DEL = new DonorEventList(User.Identity.Name, int.Parse(key.ToString())) { TicketsMailed_Date = DateTime.Now, TicketsMailed_User = User.Identity.Name, TicketsRequested = int.Parse(ticketCount), Response_Type = "SPLC Admin", WaitingListOrder = 0, UpdatedInfoDateTime = DateTime.Now }; DEL.MailCards(); } DataBind(); }