private void BindEmailList() { EmailAddressCollection emailList = EmailAddressManager.GetCollection(base.InstructorId); rptEmailList.DataSource = emailList; rptEmailList.DataBind(); }
private void BindUpdateInfo(int emailId) { EmailAddress emailAddress = EmailAddressManager.GetItem(emailId); if (emailAddress != null) { hdnEmailId.Value = emailAddress.EmailId.ToString(); if (emailAddress.EmailValue != null) { txtEmailAddress.Text = emailAddress.EmailValue; } if (emailAddress.EmailType != null) { drpEmailType.SelectedValue = emailAddress.EmailType.EntityTypeId.ToString(); } SaveButton.Text = "Save Email"; } else { this.DisplayLocalMessage("Email Address could not be retrieved. Contact an administrator"); } }
private void BindUpdateInfo(int emailId) { EmailAddress emailAddress = EmailAddressManager.GetItem(emailId); if (emailAddress != null) { //notes: set hidden fields so page knows to update hidEmailId.Value = emailAddress.EmailId.ToString(); //notes: set textbox for email address if (emailAddress.EmailValue != null) { txtEmailAddress.Text = emailAddress.EmailValue; } //notes: select item from drop-down if (emailAddress.EmailType != null) { drpEmailType.SelectedValue = emailAddress.EmailType.EntityTypeId.ToString(); } //notes: set the display text of the button to indicate if it is an UPDATE btnSaveEmail.Text = "Save Email"; } else { base.DisplayPageMessage(lblPageMessage, "Email Address could not be retrieved. Contact and administrator."); } }
private void DeleteEmail(int emailId) { try { if (EmailAddressManager.Delete(emailId)) { Response.Redirect("ContactInfo.aspx?InstructorId=" + base.InstructorId.ToString()); } else { this.DisplayLocalMessage("Delete of Email failed. Contact Administrator."); } } catch (BLLException ex) { if (ex.BrokenRules != null && ex.BrokenRules.Count() > 0) { this.DisplayLocalMessage(ex.Message, ex.BrokenRules); } else { this.DisplayLocalMessage(ex.Message); } } }
private void DeleteEmail(int emailId) { if (EmailAddressManager.Delete(emailId)) { //notes: redirects back to page refresh list. Response.Redirect("ContactInfo.aspx?InstructorId=" + base.InstructorId.ToString()); } else { //notes: display message to user base.DisplayPageMessage(lblPageMessage, "Delete of email failed. Contact administrator."); } }