Esempio n. 1
0
        protected void radDockLayout_OnLoadDockLayout(object sender, DockLayoutEventArgs e)
        {
            if (!CurrentUser.Instance.SiteAccessProfileID.HasValue)
            {
                this.Visible = false;
                return;
            }

            var page        = ((LeadForceBasePage)Page);
            var dataManager = new DataManager();
            var widgets     = dataManager.WidgetToAccessProfile.SelectByAccessProfileAndModuleIds(CurrentUser.Instance.SiteAccessProfileID.Value, page.CurrentModuleId).ToList();

            //widgets.AddRange(dataManager.WidgetToAccessProfile.SelectByAccessProfileForAllModules(CurrentUser.Instance.SiteAccessProfileID.Value));

            if (!widgets.Any())
            {
                this.Visible = false;
                return;
            }

            foreach (var widget in widgets)
            {
                var radDock = AddRadDock(widget);
                if (radDock != null)
                {
                    radDockLayout.RegisteredZones[widget.Order % 4].Controls.Add(radDock);
                }
            }
        }
Esempio n. 2
0
        protected void radDockLayout_OnLoadDockLayout(object sender, DockLayoutEventArgs e)
        {
            if (!CurrentUser.Instance.SiteAccessProfileID.HasValue)
            {
                this.Visible = false;
                return;
            }

            var page        = ((LeadForceBasePage)HttpContext.Current.Handler);
            var dataManager = new DataManager();
            var widgets     = dataManager.WidgetToAccessProfile.SelectByAccessProfileAndModuleIds(CurrentUser.Instance.SiteAccessProfileID.Value, page.CurrentModuleId).ToList();

            widgets.AddRange(dataManager.WidgetToAccessProfile.SelectByAccessProfileForAllModules(CurrentUser.Instance.SiteAccessProfileID.Value));

            if (!widgets.Any())
            {
                this.Visible = false;
                return;
            }

            foreach (var widget in widgets)
            {
                AddRadDock(widget);
            }
        }
Esempio n. 3
0
				protected void DockPositionChanged(object sender, DockLayoutEventArgs e)
				{
						if (OnTileSort != null)
						{
								OnTileSort(sender, e);
						}
				}
Esempio n. 4
0
        /// <summary>
        /// Handles the OnLoadDockLayout event of the radDockLayout control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.DockLayoutEventArgs"/> instance containing the event data.</param>
        protected void radDockLayout_OnLoadDockLayout(object sender, DockLayoutEventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CurrentModuleId = Guid.Empty;
            }

            BindRadDocks();
        }
Esempio n. 5
0
    protected void RadDockLayout_DesignMode_SaveDockLayout(object sender, DockLayoutEventArgs e)
    {
        List <DockState> _CurrentDockStates = ((RadDockLayout)this.Page.Master.FindControl("RadDockLayout_DesignMode")).GetRegisteredDocksState();

        CurrentDockStates = ((RadDockLayout)this.Page.Master.FindControl("RadDockLayout_DesignMode")).GetRegisteredDocksState();

        PageEditorMgr myPageEditorMgr = new PageEditorMgr();

        myPageEditorMgr.Edit_DesignMode_Control_Position(this.Page, myPage_Loading_Info, CurrentDockStates);
    }
Esempio n. 6
0
    protected void RadDockLayout_DesignMode_LoadDockLayout(object sender, DockLayoutEventArgs e)
    {
        foreach (DockState state in CurrentDockStates)
        {
            // Comment these two lines and you will see that the indices are not applied correctly

            e.Positions[state.UniqueName] = state.DockZoneID;
            e.Indices[state.UniqueName]   = state.Index;
        }
    }
Esempio n. 7
0
 protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)
 {
     //Populate the event args with the state information. The RadDockLayout control
     // will automatically move the docks according that information.
     foreach (DockState state in CurrentDockStates)
     {
         e.Positions[state.UniqueName] = state.DockZoneID;
         e.Indices[state.UniqueName]   = state.Index;
     }
 }
 protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)
 {
     DockPositionChanged(sender, e);
 }
Esempio n. 9
0
        /// <summary>
        /// Handles the OnLoadDockLayout event of the radDockLayout control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.DockLayoutEventArgs"/> instance containing the event data.</param>
        protected void radDockLayout_OnLoadDockLayout(object sender, DockLayoutEventArgs e)
        {
            if (string.IsNullOrEmpty(Request.QueryString["tab"]) || Request.QueryString["tab"] != "chart")
            {
                return;
            }

            radDockZone.Controls.Clear();

            var userSettings = DataManager.UserSettings.SelectByClassName(CurrentUser.Instance.ID,
                                                                          "WebCounter.AdminPanel.HomePageWidgets");

            var serializer = new JavaScriptSerializer();
            var converters = new List <JavaScriptConverter> {
                new UnitConverter()
            };

            serializer.RegisterConverters(converters);
            var reportInSettings = new List <Guid>();

            if (userSettings != null)
            {
                reportInSettings.AddRange(from str in userSettings.UserSettings.Split('|')
                                          where str != String.Empty
                                          select serializer.Deserialize <DockState>(str)
                                          into state
                                          where !state.Closed
                                          select Guid.Parse(state.UniqueName));
            }

            var reports = DataManager.AnalyticReport.SelectAll(CurrentUser.Instance.ID);

            foreach (var analyticReport in reports)
            {
                if (reportInSettings.Count == 0 ||
                    (reportInSettings.Count > 0 && !reportInSettings.Contains(analyticReport.ID)))
                {
                    continue;
                }

                AddReport(analyticReport);
            }

            if (radDockZone.Controls.Count == 0)
            {
                radDockLayout.Visible  = false;
                plEmptyMessage.Visible = true;
            }
            else
            {
                radDockLayout.Visible  = true;
                plEmptyMessage.Visible = false;
            }

            if (userSettings == null)
            {
                return;
            }

            foreach (string str in userSettings.UserSettings.Split('|'))
            {
                if (str != String.Empty)
                {
                    var state = serializer.Deserialize <DockState>(str);
                    var dock  = radDockLayout.FindControl(state.UniqueName) as RadDock;
                    if (dock != null)
                    {
                        dock.ApplyState(state);
                    }
                    e.Positions[state.UniqueName] = state.DockZoneID;
                    e.Indices[state.UniqueName]   = state.Index;
                }
            }
        }
        protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)
        {
            List<DockState> stateList = RadDockLayout1.GetRegisteredDocksState();
            StringBuilder serializedList = new StringBuilder();
            int i = 0;

            // 
            ArrayList arrCurrentDockTags = new ArrayList();
            ArrayList arrClosedDockTags = new ArrayList();
            //

            while (i < stateList.Count)
            {
                serializedList.Append(stateList[i].ToString());
                serializedList.Append("|");

                //add tag (Custom Gadget's Path) to array which are not closed.
                if (!stateList[i].Closed)
                {
                    arrCurrentDockTags.Add(stateList[i].Tag);
                }
                else
                {
                    arrClosedDockTags.Add(stateList[i].Tag);
                }
                i++;
            }

            //code to hide check box and show label 'Added' in Gadget Box

            string dockState = serializedList.ToString();
            int Result;
            if (dockState.Trim() != String.Empty)
            {
                objDefaultGadgetsDAL = new DefaultGadgetsDAL();
                Result = objDefaultGadgetsDAL.SaveDashBoardPersonalization(_userID, dockState);
            }
            loadalldashboard();
        }
 protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)
 {
     foreach (DockState state in CurrentDockStates)
     {
         e.Positions[state.UniqueName] = state.DockZoneID;
         e.Indices[state.UniqueName] = state.Index;
     }
 }
Esempio n. 12
0
 protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)
 {
     //Save the dock state in the session. This will enable us
     // to recreate the dock in the next Page_Init.
     CurrentDockStates = RadDockLayout1.GetRegisteredDocksState();
 }