Пример #1
0
        protected void cmdSaveNewRecipientList_ClickHandler(object sender, EventArgs e)
        {
            string name = txtRecipientListName.Text;
            string desc = txtRecipientListDesc.Text;

            if (string.IsNullOrEmpty(name))
            {
                ShowError("Name cannot be empty");
                return;
            }

            // Create and Save
            RecipientList newList = new RecipientList((RecipientListType)Int32.Parse(dropListRecipientTypes.SelectedValue), name, desc);

            try
            {
                newList.Save();
            }
            catch (ArgumentException ex)
            {
                ShowError(ex.Message.ToString());
                return;
            }

            //Redirect to the new recipient list page
            if (newList.Id != 0)
            {
                Response.Redirect(BVNetwork.EPiSendMail.Configuration.NewsLetterConfiguration.GetModuleBaseDir() + "/plugin/recipientlists/listedit.aspx?recipientlistid=" + newList.Id);
            }
            else
            {
                ShowError("Something went wrong saving new recipient list");
            }
        }