Ejemplo n.º 1
0
    private void Bind_DashboardGrid()
    {
        try
        {
            string usertype = string.Empty;
            usertype = (SessionManager.GetUserType(HttpContext.Current));
            int i = 0;
            if (usertype == "Internal")
            {
                i = 1;
            }
            else if (usertype == "External")
            {
                i = 2;
            }
            else
            {
                i = 0;
            }


            List <DashboardLink> list = DashboardLink.DashboardFill(SessionManager.GetAgentCode(HttpContext.Current), i, Convert.ToString(SessionManager.GetItemCategoryCode(HttpContext.Current)));
            if (list != null && list.Count > 0)
            {
                if (list.Count > 0)
                {
                    rpt_Dashboard.DataSource = list;
                    rpt_Dashboard.DataBind();
                }
                else
                {
                    rpt_Dashboard.DataSource = null;
                    rpt_Dashboard.DataBind();
                    // l_Error.Text = "Data not found.";
                    // l_Error.Visible = true;
                }
            }
            else
            {
                rpt_Dashboard.DataSource = null;
                rpt_Dashboard.DataBind();
                // l_Error.Text = "Data not found.";
                //l_Error.Visible = true;
            }
        }
        catch (Exception ex)
        {
            var message = new JavaScriptSerializer().Serialize(ex.Message.ToString());
            var script  = string.Format("alert({0});window.location='DashBoard.aspx';", message);
            ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "", script, true);
        }
    }
Ejemplo n.º 2
0
        private static List <DashboardLink> GetDashboardLinksFromContent(IContent prontoContentItem, string propertyAlias)
        {
            var usefulLinks     = prontoContentItem.GetValue(propertyAlias);
            var usefulLinkItems = Newtonsoft.Json.Linq.JArray.Parse(usefulLinks.ToString());

            List <DashboardLink> usefulLinkList = new List <DashboardLink>();

            foreach (var item in usefulLinkItems)
            {
                DashboardLink link = new DashboardLink();
                link.Title       = item["title"].ToString();
                link.Description = item["description"].ToString();
                link.Url         = item["linkUrl"].ToString();
                usefulLinkList.Add(link);
            }

            return(usefulLinkList);
        }
Ejemplo n.º 3
0
 public void GoToDashboard()
 {
     DashboardLink.Click();
 }