Exemplo n.º 1
0
        protected void OnSave(object sender, EventArgs e)
        {
            if(m_oIAProperty == null)
            {
                m_oIAProperty = new IAProperty();
                DataAccess.IAProperties.InsertOnSubmit(m_oIAProperty);
            }

            MemberProtect.Email.SetSmtpSettings(m_txtSmtpHost.Text, MemberProtect.Utility.ValidateInteger(m_txtSmtpPort.Text), m_txtSmtpUsername.Text, m_txtSmtpPassword.Text);

            // Save Information
            m_oIAProperty.SiteName = m_txtSiteName.Text;
            m_oIAProperty.HostName = m_txtHostName.Text;
            m_oIAProperty.SiteDomain = m_txtSiteDomain.Text;
            m_oIAProperty.EmailNewAccount = m_txtEmailNewAccount.Text;
            m_oIAProperty.EmailAddressFrom = m_txtEmailAddressFrom.Text;
            m_oIAProperty.EmailAddressFromName = m_txtEmailAddressFromName.Text;
            m_oIAProperty.AuthorizeNetIsDebug = m_chkAuthorizeNetIsDebug.Checked;
            m_oIAProperty.AuthorizeNetLoginID = MemberProtect.Cryptography.Encrypt(m_txtAuthorizeNetLoginID.Text);
            m_oIAProperty.AuthorizeNetTransactionKey = MemberProtect.Cryptography.Encrypt(m_txtAuthorizeNetTransactionKey.Text);

            DataAccess.SubmitChanges();

            ShowMessage("Site properties have been saved.", MessageTone.Positive);
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            m_oIAProperty = DataAccess.IAProperties.SingleOrDefault();

            if(!IsPostBack)
            {
                if(m_oIAProperty != null)
                {
                    m_txtSiteName.Text = m_oIAProperty.SiteName;
                    m_txtHostName.Text = m_oIAProperty.HostName;
                    m_txtSiteDomain.Text = m_oIAProperty.SiteDomain;
                    m_txtEmailNewAccount.Text = m_oIAProperty.EmailNewAccount;
                    m_txtEmailAddressFrom.Text = m_oIAProperty.EmailAddressFrom;
                    m_txtEmailAddressFromName.Text = m_oIAProperty.EmailAddressFromName;
                    m_chkAuthorizeNetIsDebug.Checked = m_oIAProperty.AuthorizeNetIsDebug;
                    m_txtAuthorizeNetLoginID.Text = MemberProtect.Cryptography.Decrypt(m_oIAProperty.AuthorizeNetLoginID);
                    m_txtAuthorizeNetTransactionKey.Text = MemberProtect.Cryptography.Decrypt(m_oIAProperty.AuthorizeNetTransactionKey);
                }

                m_txtSmtpHost.Text = MemberProtect.Email.SmtpHost;
                m_txtSmtpPort.Text = MemberProtect.Utility.FormatInteger(MemberProtect.Email.SmtpPort);
                m_txtSmtpUsername.Text = MemberProtect.Email.SmtpUsername;
                m_txtSmtpPassword.Text = MemberProtect.Email.SmtpPassword;
                m_txtEmailNewAccount.Text = m_oIAProperty.EmailNewAccount;
                m_txtEmailAddressFrom.Text = m_oIAProperty.EmailAddressFrom;
                m_txtEmailAddressFromName.Text = m_oIAProperty.EmailAddressFromName;
            }
        }
        public void UpdateSiteProperties(IAProperty newProperties)
        {
            IAProperty properties = GetSiteProperties(true);
            properties.SiteName = newProperties.SiteName;
            properties.SiteDomain = newProperties.SiteDomain;
            properties.EmailNewAccount = newProperties.EmailNewAccount;
            properties.EmailAddressFrom = newProperties.EmailAddressFrom;
            properties.EmailAddressFromName = newProperties.EmailAddressFromName;
            properties.EmailBillings = newProperties.EmailBillings;
            properties.AuthorizeNetIsDebug = newProperties.AuthorizeNetIsDebug;
            properties.AuthorizeNetLoginID = newProperties.AuthorizeNetLoginID;
            properties.AuthorizeNetTransactionKey = newProperties.AuthorizeNetTransactionKey;
            properties.ClosedMessage = newProperties.ClosedMessage;
            properties.ClosedMessageDisplayAlways = newProperties.ClosedMessageDisplayAlways;
            properties.MondayInDateTime = newProperties.MondayInDateTime;
            properties.MondayOutDateTime = newProperties.MondayOutDateTime;
            properties.TuesdayInDateTime = newProperties.TuesdayInDateTime;
            properties.TuesdayOutDateTime = newProperties.TuesdayOutDateTime;
            properties.WednesdayInDateTime = newProperties.WednesdayInDateTime;
            properties.WednesdayOutDateTime = newProperties.WednesdayOutDateTime;
            properties.ThursdayInDateTime = newProperties.ThursdayInDateTime;
            properties.ThursdayOutDateTime = newProperties.ThursdayOutDateTime;
            properties.FridayInDateTime = newProperties.FridayInDateTime;
            properties.FridayOutDateTime = newProperties.FridayOutDateTime;
            properties.RecutRequestThreshold = newProperties.RecutRequestThreshold;
            properties.FeedbackEmailProblem = newProperties.FeedbackEmailProblem;
            properties.FeedbackEmailQuestion = newProperties.FeedbackEmailQuestion;
            properties.EmailSystemNotifications = newProperties.EmailSystemNotifications;
            properties.ActivityInterval = newProperties.ActivityInterval;
            properties.EmailEstimatePayment = newProperties.EmailEstimatePayment;
            properties.EnableCreditCardShadowCopy = newProperties.EnableCreditCardShadowCopy;
            Business.RequestContextHelper.CurrentDB().SubmitChanges();

            FlushCache();
            GetSiteProperties(true);
        }