public void show()
        {
            int     ID      = 4;
            soption options = db.soptions.First(use => use.id == ID);//call soption db
            var     mnu     = from p in db.menus
                              where p.menu_type == ID
                              orderby p.menu_id ascending
                              select p;

            listmenu.DataSource = mnu;
            listmenu.DataBind();
        }
Beispiel #2
0
        public void tabview()
        {
            HttpCookie cookie = Request.Cookies["rowenref"];// declaration cookie

            if (cookie == null)
            {
                Response.Redirect("home.aspx");
            }
            else if (cookie["perms"] == "3")
            {
                var mnu = from p in db.menus
                          where p.menu_type == 5
                          orderby p.menu_id ascending
                          select p;
                listadmintab.DataSource = mnu;
                listadmintab.DataBind();

                listidtab.DataSource = mnu;
                listidtab.DataBind();
                soption optiontab = db.soptions.First(use => use.id == 3);
                lbltab.Text   = optiontab.name.ToString() + " tab";
                lbltitle.Text = optiontab.name.ToString();
            }
            else if (cookie["perms"] == "5")
            {
                var mnu = from p in db.menus
                          where p.menu_perms == 1
                          orderby p.menu_id ascending
                          select p;
                listadmintab.DataSource = mnu;
                listadmintab.DataBind();

                listidtab.DataSource = mnu;
                listidtab.DataBind();

                soption optiontab = db.soptions.First(use => use.id == 5);
                lbltab.Text   = optiontab.name.ToString() + " tab";
                lbltitle.Text = optiontab.name.ToString();
            }
        }
Beispiel #3
0
        public void set()
        {
            carousel();
            //site name
            sitename Sitnme = db.sitenames.First();

            lbl_sitename.Text   = Sitnme.title.ToString();//call sitename
            lblfootertitle.Text = Sitnme.title.ToString();
            Page.Title          = string.Format(Sitnme.title.ToString());
            HttpCookie cookie = Request.Cookies["rowenref"];// declaration cookie


            if (cookie == null)//if cookie null
            {
                int     ID      = 4;
                soption options = db.soptions.First(use => use.id == ID);//call soption db
                var     mnu     = from p in db.menus
                                  where p.menu_type == ID
                                  orderby p.menu_id ascending
                                  select p;
                ListView1.DataSource = mnu;
                ListView1.DataBind();



                var mnuvisible = from p in db.menus
                                 where p.status == 15
                                 orderby p.menu_id ascending
                                 select p;
                ListView1.DataSource = mnuvisible;
                ListView1.DataBind();

                lnklogin.Visible  = true;
                lblSignUp.Visible = true;
            }
            else
            {
                //Image1.Visible = true;
                cookie.Expires = DateTime.Now.AddMinutes(30);
                Response.Cookies.Add(cookie);
                user User = db.users.First(aa => aa.id == Convert.ToInt16(cookie["userid"]));
                lbluser.Text = "<li class='dropdown'><a href='#' class='dropdown-toggle' data-toggle='dropdown'>"
                               + "Hi " + User.username
                               + "<b class='caret'></b></a>"
                               + "<ul class='dropdown-menu'>"
                               + "<li><a href='account.aspx'>My Account</a></li>"
                               + "<li><a href='logout.aspx'>Logout</a></li>"
                               + "</ul></li>";
                // Image1.ImageUrl = ("../profilepic/thumb/" + cookie["profilepic"]);
                // lnk_logout.Visible = true;
                lnklogin.Visible  = false;
                lblSignUp.Visible = false;
                // lnkregister.Visible = false;
                //acount type "guest"
                if (cookie["usertype"] == "4")
                {
                    var mnuvisible = from p in db.menus
                                     where p.status == 15
                                     orderby p.menu_id ascending
                                     select p;
                    ListView1.DataSource = mnuvisible;
                    ListView1.DataBind();
                }
                //acount type "admin"
                else if (cookie["perms"] == "3")
                {
                    var mnuvisible = from p in db.menus
                                     where p.status == 15
                                     orderby p.menu_id ascending
                                     select p;
                    ListView1.DataSource = mnuvisible;
                    ListView1.DataBind();
                    lbladmin.Visible = true;
                    soption optiontab = db.soptions.First(use => use.id == 3);

                    lbladmin.Text = "<li><a href='admin.aspx'>" + optiontab.name + "</a></li>";
                }
                else if (cookie["perms"] == "5")
                {
                    var mnuvisible = from p in db.menus
                                     where p.status == 15
                                     orderby p.menu_id ascending
                                     select p;
                    ListView1.DataSource = mnuvisible;
                    ListView1.DataBind();
                    lbladmin.Visible = true;
                    soption optiontab = db.soptions.First(use => use.id == 5);

                    lbladmin.Text = "<li><a href='admin.aspx'>" + optiontab.name + "</a></li>";
                }
            }
        }