Exemplo 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();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Handles the OnLogoutClick event of the MainMenu 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 MainMenu_OnLogoutClick(object sender, EventArgs e)
 {
     HttpContext.Current.Session.Remove("siteID");
     CurrentUser.UserInstanceFlush();
     FormsAuthentication.SignOut();
     Response.Redirect(UrlsData.AP_Home());
 }
Exemplo 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)
        {
            if (!Request.Url.ToString().ToLower().Contains("leadforce/main/list"))
            {
                Response.Redirect(UrlsData.AP_Home());
            }

            Title = "LeadForce";

            AjaxManager = RadAjaxManager.GetCurrent(Page);
            AjaxManager.AjaxSettings.AddAjaxSetting(AjaxManager, rcbReports, null, UpdatePanelRenderMode.Inline);
            AjaxManager.AjaxSettings.AddAjaxSetting(AjaxManager, txtName, null, UpdatePanelRenderMode.Inline);
            AjaxManager.AjaxSettings.AddAjaxSetting(rcbReports, txtName, null, UpdatePanelRenderMode.Inline);
            AjaxManager.AjaxSettings.AddAjaxSetting(rcbReports, plSelectAxis, null, UpdatePanelRenderMode.Inline);
            AjaxManager.AjaxSettings.AddAjaxSetting(rcbReports, plSelectedAxisValues, null, UpdatePanelRenderMode.Inline);
            AjaxManager.AjaxSettings.AddAjaxSetting(ddlSelectAxis, chxlSeries, null, UpdatePanelRenderMode.Inline);

            RadAjaxManager.GetCurrent(Page).AjaxRequest += Default_AjaxRequest;

            var showDomainStatusSettings = ((LeadForceBasePage)Page).CurrentModuleEditionOptions.SingleOrDefault(a => a.SystemName == "ShowDomainStatusSettings");

            if (showDomainStatusSettings == null && !((LeadForceBasePage)Page).IsDefaultEdition)
            {
                plShowDomainStatusSettings.Visible = false;
            }
            else
            {
                var siteDomain = DataManager.SiteDomain.SelectBySiteId(CurrentUser.Instance.SiteID);
                plShowDomainStatusSettings.Visible = ucNotificationMessage.Visible = siteDomain == null;
                if (ucNotificationMessage.Visible)
                {
                    var site = DataManager.Sites.SelectById(CurrentUser.Instance.SiteID);
                    if (site != null)
                    {
                        ucNotificationMessage.Text =
                            string.Format(
                                "Для начала работы Вам необходимо привязать {0} к домену. Для этого укажите Ваш домен в форме ниже и нажмите кнопку [Проверить и сохранить]",
                                site.Name);
                    }

                    if (siteDomain != null)
                    {
                        if (!Page.IsPostBack)
                        {
                            txtDomain.Text  = siteDomain.Domain;
                            txtAliases.Text = siteDomain.Aliases;
                            lrlNote.Text    = siteDomain.Note;
                        }
                    }
                }
            }

            if (!string.IsNullOrEmpty(Request.QueryString["tab"]) && Request.QueryString["tab"] == "chart")
            {
                RadTabStrip1.Tabs[1].Selected       = true;
                RadMultiPage1.PageViews[1].Selected = true;
                plCharts.Visible = true;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Handles the OnClick event of the lbtnAdd 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 lbtnAdd_OnClick(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                return;
            }

            var analyticReportId = Guid.Parse(rcbReports.SelectedValue);
            var analyticReport   = DataManager.AnalyticReport.SelectById(CurrentUser.Instance.SiteID, analyticReportId);

            if (plSelectAxis.Visible)
            {
                Guid?axisToBuild        = Guid.Parse(ddlSelectAxis.SelectedValue);
                var  reportUserSettings = DataManager.AnalyticReportUserSettings.SelectByAnalyticReportId(CurrentUser.Instance.ID, analyticReportId) ?? new tbl_AnalyticReportUserSettings();

                reportUserSettings.AxisToBuildID = axisToBuild;

                if (plSelectedAxisValues.Visible)
                {
                    var selectedItems = (from ListItem listItem in chxlSeries.Items where listItem.Selected select listItem.Value).ToList();
                    reportUserSettings.DataSetValues = string.Join("#", selectedItems);
                }

                if (reportUserSettings.ID == Guid.Empty)
                {
                    reportUserSettings.UserID           = CurrentUser.Instance.ID;
                    reportUserSettings.AnalyticReportID = analyticReportId;
                    DataManager.AnalyticReportUserSettings.Add(reportUserSettings);
                }
                else
                {
                    DataManager.AnalyticReportUserSettings.Update(reportUserSettings);
                }
            }

            RadDock radDock = null;

            radDock = (RadDock)radDockLayout.FindControl(analyticReportId.ToString());
            if (radDock == null)
            {
                radDock = AddReport(analyticReport);
                radDockLayout.GetRegisteredDocksState().Add(radDock.GetState());
            }

            radDock.GetState().Closed = false;
            radDock.Title = txtName.Text;

            SaveSettings();


            Response.Redirect(UrlsData.AP_Home() + "?tab=chart");
        }
Exemplo n.º 5
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";

            gridSites.AddNavigateUrl = UrlsData.AP_SiteAdd();
            gridSites.Actions.Add(new GridAction {
                Text = "Карточка сайта", NavigateUrl = string.Format("~/{0}/Sites/Edit/{{0}}", CurrentTab), ImageUrl = "~/App_Themes/Default/images/icoView.png"
            });
        }