示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _EmailListId = AlwaysConvert.ToInt(Request.QueryString["EmailListId"]);
     _EmailList   = EmailListDataSource.Load(_EmailListId);
     if (_EmailList == null)
     {
         Response.Redirect("Default.aspx");
     }
     if (!Page.IsPostBack)
     {
         Caption.Text = string.Format(Caption.Text, _EmailList.Name);
         int userCount = EmailListUserDataSource.CountForEmailList(_EmailListId);
         Members.Text = userCount.ToString();
         ManageMembersLink.NavigateUrl += "?EmailListId=" + _EmailListId.ToString();
         if (userCount > 0)
         {
             ExportUsersLink.NavigateUrl += "?EmailListId=" + _EmailListId.ToString();
             ExportEmailLink.NavigateUrl += "?EmailListId=" + _EmailListId.ToString();
             SendMessageLink.NavigateUrl += "?EmailListId=" + _EmailListId.ToString() + "&ReturnUrl=" + Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes("~/Admin/Marketing/Email/ManageList.aspx?EmailListId=" + _EmailListId.ToString()));
         }
         else
         {
             ExportUsersLink.Visible = false;
             ExportEmailLink.Visible = false;
             SendMessageLink.Visible = false;
         }
         if (_EmailList.LastSendDate == null || _EmailList.LastSendDate.Equals(DateTime.MinValue))
         {
             LastSendDate.Text = "No mail sent yet.";
         }
         else
         {
             LastSendDate.Text = string.Format(LastSendDate.Text, _EmailList.LastSendDate);
         }
     }
     EditEmailListDialog1.ItemUpdated += new PersistentItemEventHandler(EditEmailListDialog1_ItemUpdated);
 }
示例#2
0
        protected int GetUserCount(object dataItem)
        {
            EmailList m = (EmailList)dataItem;

            return(EmailListUserDataSource.CountForEmailList(m.Id));
        }