protected void bindfavtask()
        {
            objuser.userid = Session["userid"].ToString();

            objuser.action = "getfavReportHTML";
            ds             = objuser.FavouriteReports();

            StringBuilder sb = new StringBuilder();



            if (ds.Tables[1].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
                {
                    sb.Append("<li class='favtitle'><i class='fa fa-file'></i>" + ds.Tables[1].Rows[i]["rGroup"].ToString() + "</li>");

                    DataTable dt = new DataTable();
                    dt = filterrole("rGroup='" + ds.Tables[1].Rows[i]["rGroup"].ToString() + "'", ds);

                    for (int j = 0; j < dt.Rows.Count; j++)
                    {
                        sb.Append("<li><a href='" + dt.Rows[j]["rlink"].ToString() + "'><i class='reporticon'>" + dt.Rows[j]["rname"].ToString() + "</i></a></li>");
                    }
                }
            }
            else
            {
                sb.Append("<li class='nofavtask'>No Favourite Report in this list</li>");
            }
            litfavtask.Text = sb.ToString();
        }
Beispiel #2
0
        public void fillfavReport()
        {
            objuser.userid = Session["userid"].ToString();

            objuser.action = "getallreports";
            ds             = objuser.FavouriteReports();

            StringBuilder sb = new StringBuilder();

            if (ds.Tables[1].Rows.Count > 0)
            {
                int num = 0;
                for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
                {
                    // sb.Append("<li><a><i>" + ds.Tables[1].Rows[i]["rGroup"].ToString() + "</i></a>");
                    DataTable dt = new DataTable();
                    dt = filterrole("rGroup='" + ds.Tables[1].Rows[i]["rGroup"].ToString() + "'", ds);
                    if (dt.Rows.Count > 0)
                    {
                        // ListItem li = new ListItem(ds.Tables[1].Rows[i]["rGroup"].ToString(), ds.Tables[1].Rows[i]["rGroup"].ToString());
                        // li.Attributes.Add("style", "color:blue");
                        //// li.Enabled = false;
                        // listcode1.Items.Insert(num, li);
                        // num = num + 1;

                        for (int j = 0; j < dt.Rows.Count; j++)
                        {
                            if (dt.Rows[j]["linkname"].ToString() != "")
                            {
                                string[] linkname     = dt.Rows[j]["linkname"].ToString().Split('#');
                                string[] linkpagename = dt.Rows[j]["pages"].ToString().Split('#');
                                for (int k = 0; k < linkname.Length; k++)
                                {
                                    ListItem li = new ListItem(linkname[k], linkpagename[k]);
                                    li.Attributes.Add("data-category", ds.Tables[1].Rows[i]["rGroup"].ToString());
                                    listcode1.Items.Insert(num, li);
                                    num = num + 1;
                                }
                            }
                        }
                    }
                }
            }
        }