protected void ShowEdit(int emailTemplateId) { Rock.CRM.EmailTemplate emailTemplate = _emailTemplateService.Get(emailTemplateId); if (emailTemplate != null) { lAction.Text = "Edit"; hfEmailTemplateId.Value = emailTemplate.Id.ToString(); tbCategory.Text = emailTemplate.Category; tbTitle.Text = emailTemplate.Title; tbFrom.Text = emailTemplate.From; tbTo.Text = emailTemplate.To; tbCc.Text = emailTemplate.Cc; tbBcc.Text = emailTemplate.Bcc; tbSubject.Text = emailTemplate.Subject; tbBody.Text = emailTemplate.Body; } else { lAction.Text = "Add"; tbCategory.Text = string.Empty; tbTitle.Text = string.Empty; tbFrom.Text = string.Empty; tbTo.Text = string.Empty; tbCc.Text = string.Empty; tbBcc.Text = string.Empty; tbSubject.Text = string.Empty; tbBody.Text = string.Empty; } phList.Visible = false; pnlDetails.Visible = true; }
protected void rGrid_Delete(object sender, RowEventArgs e) { Rock.CRM.EmailTemplate emailTemplate = _emailTemplateService.Get(( int )rGrid.DataKeys[e.RowIndex]["id"]); if (emailTemplate != null) { _emailTemplateService.Delete(emailTemplate, CurrentPersonId); _emailTemplateService.Save(emailTemplate, CurrentPersonId); } BindGrid(); }