Ejemplo n.º 1
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (CurrentUser.Instance.AccessLevelID != (int)AccessLevel.SystemAdministrator)
            {
                Response.Redirect(UrlsData.AP_Home());
            }

            Title = "Сайты - LeadForce";

            if (Page.RouteData.Values["id"] != null)
            {
                _siteId = Guid.Parse(Page.RouteData.Values["id"] as string);
            }

            hlCancel.NavigateUrl = UrlsData.AP_Sites();

            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(rcbAccessProfile, plAccessBlock, null, UpdatePanelRenderMode.Inline);

            tagsSite.ObjectID = _siteId;

            if (!Page.IsPostBack)
            {
                BindData();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "Настройки домена - LeadForce";

            if (Page.RouteData.Values["id"] != null)
            {
                _siteDomainId = Guid.Parse(Page.RouteData.Values["id"] as string);
            }

            if (Page.RouteData.Values["siteId"] != null)
            {
                _siteId = Guid.Parse(Page.RouteData.Values["siteId"] as string);
            }

            if (Request.Url.ToString().ToLower().Contains("sites"))
            {
                hlCancel.NavigateUrl = UrlsData.AP_Sites();
            }
            else
            {
                hlCancel.NavigateUrl = UrlsData.AP_Settings();
            }

            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(lbtnSave, ucNotificationMessage);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(lbtnSave, lrlSiteDomainStatus, null, UpdatePanelRenderMode.Inline);
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ucCheckSite, lrlSiteDomainStatus);

            if (!Page.IsPostBack)
            {
                BindData();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "Настройки портала - LeadForce";

            if (Page.RouteData.Values["id"] != null)
            {
                _portalSettingsId = Guid.Parse(Page.RouteData.Values["id"] as string);
            }

            if (Page.RouteData.Values["siteId"] != null)
            {
                _siteId = Guid.Parse(Page.RouteData.Values["siteId"] as string);
            }

            RadAjaxManager = RadAjaxManager.GetCurrent(Page);
            RadAjaxManager.AjaxSettings.AddAjaxSetting(RadAjaxManager, rbiLogo);
            rauLogo.Localization.Select = "Выбрать";
            rauLogo.Localization.Remove = "Удалить";
            rauLogo.Localization.Cancel = "Отмена";

            txtTwitterProfile.Attributes.Add("style", "display:none");
            txtVkontakteProfile.Attributes.Add("style", "display:none");
            txtFacebookProfile.Attributes.Add("style", "display:none");

            if (Request.Url.ToString().ToLower().Contains("sites"))
            {
                hlCancel.NavigateUrl = UrlsData.AP_Sites();
            }
            else
            {
                hlCancel.NavigateUrl = UrlsData.AP_Settings();
            }

            if (!Page.IsPostBack)
            {
                BindData();
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Handles the OnClick event of the lbtnSave control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void lbtnSave_OnClick(object sender, EventArgs e)
        {
            var site = DataManager.Sites.SelectById(_siteId) ?? new tbl_Sites();

            site.Name = txtName.Text;
            site.LinkProcessingURL = txtLinkProcessingURL.Text;
            site.IsActive          = chxIsActive.Checked;
            site.IsTemplate        = chxIsTemplate.Checked;
            site.SmtpHost          = txtSmtpHost.Text;
            site.SmtpUsername      = txtSmtpUsername.Text;
            site.SmtpPassword      = txtSmtpPassword.Text;

            int smtpPort;

            if (int.TryParse(txtSmtpPort.Text, out smtpPort))
            {
                site.SmtpPort = smtpPort;
            }
            else
            {
                site.SmtpPort = null;
            }

            site.SystemEmail                 = txtSystemEmail.Text;
            site.IsAllowUseSystemEmail       = chxIsAllowUseSystemEmail.Checked;
            site.IsSendEmailToSubscribedUser = chxIsSendEmailToSubscribedUser.Checked;
            site.IsSendFromLeadForce         = chxIsSendFromLeadForce.Checked;

            if (rblUnsubscribeActions.SelectedValue != string.Empty)
            {
                site.UnsubscribeActionID = int.Parse(rblUnsubscribeActions.SelectedValue);
            }
            else
            {
                site.UnsubscribeActionID = null;
            }

            if (rblServiceAdvertisingActions.SelectedValue != string.Empty)
            {
                site.ServiceAdvertisingActionID = int.Parse(rblServiceAdvertisingActions.SelectedValue);
            }
            else
            {
                site.ServiceAdvertisingActionID = null;
            }

            int maxFileSize;

            if (int.TryParse(txtMaxFileSize.Text, out maxFileSize))
            {
                site.MaxFileSize = maxFileSize;
            }

            int fileQuota;

            if (int.TryParse(txtFileQuota.Text, out fileQuota))
            {
                site.FileQuota = fileQuota;
            }

            int sessionTimeout;

            if (int.TryParse(txtSessionTimeout.Text, out sessionTimeout))
            {
                site.SessionTimeout = sessionTimeout;
            }

            int userSessionTimeout;

            if (int.TryParse(txtUserSessionTimeout.Text, out userSessionTimeout))
            {
                site.UserSessionTimeout = userSessionTimeout;
            }

            if (rcbAccessProfile.SelectedValue != Guid.Empty.ToString())
            {
                site.AccessProfileID = Guid.Parse(rcbAccessProfile.SelectedValue);
            }
            else
            {
                site.AccessProfileID = null;
            }

            site.IsBlockAccessFromDomainsOutsideOfList = chxIsBlockAccessFromDomainsOutsideOfList.Checked;
            site.MainUserID      = ucMainUser.SelectedIdNullable;
            site.ActiveUntilDate = rdpActiveUntilDate.SelectedDate;
            site.PriceListID     = ucPriceList.SelectedIdNullable;
            site.PayerCompanyID  = ucPayerCompany.SelectedIdNullable;

            if (site.ID == Guid.Empty)
            {
                if (site.AccessProfileID != null)
                {
                    var accessProfile = DataManager.AccessProfile.SelectById(site.AccessProfileID.Value);
                    if (accessProfile != null && accessProfile.DomainsCount > 0)
                    {
                        site.IsBlockAccessFromDomainsOutsideOfList = true;
                    }
                }

                site.ID = Guid.NewGuid();
                site    = DataManager.Sites.Add(site);

                var contact = new tbl_Contact
                {
                    SiteID        = site.ID,
                    Email         = txtEmail.Text,
                    UserFullName  = txtEmail.Text,
                    RefferID      = null,
                    RefferURL     = string.Empty,
                    IsNameChecked = false,
                    UserIP        = string.Empty,
                    StatusID      = DataManager.Status.SelectDefault(site.ID).ID
                };
                DataManager.Contact.Add(contact);

                var user = new tbl_User
                {
                    SiteID        = site.ID,
                    Login         = txtEmail.Text,
                    Password      = txtPassword.Text,
                    IsActive      = true,
                    AccessLevelID = 1,
                    ContactID     = contact.ID
                };

                DataManager.User.Add(user);
                site.MainUserID = user.ID;
                DataManager.Sites.Update(site);
            }
            else
            {
                DataManager.Sites.Update(site);
            }

            tagsSite.SaveTags(site.ID);

            Response.Redirect(UrlsData.AP_Sites());
        }