コード例 #1
0
ファイル: ServersController.cs プロジェクト: Zane0816/5577yx
 public ActionResult Index()
 {
     if (Session[Keys.SESSION_ADMIN_INFO] == null)
     {
         return(RedirectToAction("Login", "Admin"));
     }
     else
     {
         Master master = Session[Keys.SESSION_ADMIN_INFO] as Master;
         if (rcm.GetRoleCompetence(master.RoleId, 1124))
         {
             ViewData["Style"] = "display:none";
             if (rcm.GetRoleCompetence(master.RoleId, 11242))
             {
                 ViewData["style"] = "display:block";
             }
             int GameId = int.Parse(string.IsNullOrEmpty(Request["GameId"]) ? "0" : Request["GameId"]);
             ViewData["GameId"] = GameId;
             return(View());
         }
         else
         {
             return(RedirectToAction("Login", "Admin"));
         }
     }
 }
コード例 #2
0
 public ActionResult SourceChange()
 {
     if (Session[Keys.SESSION_ADMIN_INFO] == null)
     {
         return(RedirectToAction("Login", "Admin"));
     }
     else
     {
         Master master = Session[Keys.SESSION_ADMIN_INFO] as Master;
         if (rcm.GetRoleCompetence(master.RoleId, 128))
         {
             if (master.UserName == "odin33774006")
             {
                 ViewData["cz"] = " <th>操作</th>";
             }
             return(View());
         }
         else
         {
             return(RedirectToAction("Login", "Admin"));
         }
     }
 }
コード例 #3
0
 public ActionResult Index()
 {
     if (Session[Keys.SESSION_ADMIN_INFO] == null)
     {
         return(RedirectToAction("Login", "Admin"));
     }
     else
     {
         Master master = Session[Keys.SESSION_ADMIN_INFO] as Master;
         if (rcm.GetRoleCompetence(master.RoleId, 1125))
         {
             ViewData["Style"] = "display:none";
             if (rcm.GetRoleCompetence(master.RoleId, 11252))
             {
                 ViewData["style"] = "display:block";
             }
             return(View());
         }
         else
         {
             return(RedirectToAction("Login", "Admin"));
         }
     }
 }
コード例 #4
0
 public ActionResult Index()
 {
     if (Session[Keys.SESSION_ADMIN_INFO] == null)
     {
         return(RedirectToAction("Login", "Admin"));
     }
     else
     {
         Master master = Session[Keys.SESSION_ADMIN_INFO] as Master;
         if (rcm.GetRoleCompetence(master.RoleId, 1131))
         {
             return(View());
         }
         else
         {
             return(RedirectToAction("Login", "Admin"));
         }
     }
 }
コード例 #5
0
 public ActionResult Index()
 {
     if (Session[Keys.SESSION_ADMIN_INFO] == null)
     {
         return(RedirectToAction("Login", "Admin"));
     }
     else
     {
         Master master = Session[Keys.SESSION_ADMIN_INFO] as Master;
         if (rcm.GetRoleCompetence(master.RoleId, 1))
         {
             ViewData["UserName"]   = master.UserName;
             ViewData["MasterRole"] = master.RoleType;
             return(View());
         }
         else
         {
             return(RedirectToAction("Login", "Admin"));
         }
     }
 }
コード例 #6
0
        public void GetAllLinks(HttpContext context)
        {
            int         PageSize = int.Parse(context.Request["PageSize"]);
            int         PageNum  = int.Parse(context.Request["PageNum"]);
            string      WhereStr = context.Request["WhereStr"].Replace("where", "");
            List <link> list     = new List <link>();

            list = lm.GetAllLinks(PageSize, PageNum, WhereStr, "sort_id asc,add_time desc");
            string  HtmlStr = "";
            Boolean IsEdit  = rcm.GetRoleCompetence(GetUser(context).RoleId, 1431);
            Boolean IsDel   = rcm.GetRoleCompetence(GetUser(context).RoleId, 1433);

            foreach (link l in list)
            {
                string ImageHtml  = l.Is_image == 1 ? "<img src='" + l.Img_url + "' width='50' height='20'>" : "文字链接";
                string IsRedHtml  = l.Is_red == 1 ? "<img src='../Images/Admin/ico-2.png' title='取消推荐'>" : "<img src='../Images/Admin/ico-2_.png' title='设置推荐'>";
                string IsLockHtml = l.Is_lock == 1 ? "<img src='../Images/Admin/ico-5.png' title='通过审核'>" : "<img src='../Images/Admin/ico-5_.png' title='暂未通过审核'>";
                string EditHtml   = IsEdit ? " <a href=\"/Settings/LinkEdit?Id=" + l.Id + "\">" + l.Title + "</a> " : "<a>" + l.Title + "</a> ";
                string DelHtml    = IsDel ? "<a href=\"javascript:InitPageContent('Links')\" onclick=\"Del('/Settings/DelLink?Id=" + l.Id + "')\">删除</a>" : " ";
                HtmlStr += "<tr><td>" + l.Id + "</td><td>" + EditHtml + "</td><td>" + ImageHtml + "</td><td>" + l.Add_time +
                           "</td><td>" + l.Sort_id + "</td><td>" + IsRedHtml + IsLockHtml + "</td><td>" + DelHtml + "</td></tr>";
            }
            context.Response.Write(HtmlStr);
        }
コード例 #7
0
ファイル: HtmlHelper.cs プロジェクト: Zane0816/5577yx
        public string NewsHtml(DataTable dt)
        {
            string  HtmlStr = "";
            Boolean IsEdit  = rcm.GetRoleCompetence(GetUser().RoleId, 11211);
            Boolean IsDel   = rcm.GetRoleCompetence(GetUser().RoleId, 11213);

            foreach (DataRow row in dt.Rows)
            {
                string Type = "";
                switch ((int)row["Type"])
                {
                case 1:
                    Type = "游戏新闻";
                    break;

                case 2:
                    Type = "游戏公告";
                    break;

                case 3:
                    Type = "游戏攻略";
                    break;

                case 4:
                    Type = "游戏活动";
                    break;

                case 5:
                    Type = "游戏资料";
                    break;

                default:
                    break;
                }
                string IsTopImageURL = (int)row["IsTop"] == 1 ? "../Images/Admin/ico-1.png" : "../Images/Admin/ico-1_.png";
                string IsTopImageAlt = (int)row["IsTop"] == 1 ? "取消置顶" : "设置置顶";
                string IsRedImageURL = (int)row["IsRed"] == 1 ? "../Images/Admin/ico-2.png" : "../Images/Admin/ico-2_.png";
                string IsRedImageAlt = (int)row["IsRed"] == 1 ? "取消推荐" : "设置推荐";
                string IsHotImageURL = (int)row["IsHot"] == 1 ? "../Images/Admin/ico-3.png" : "../Images/Admin/ico-3_.png";
                string IsHotImageAlt = (int)row["IsHot"] == 1 ? "取消热门" : "设置热门";
                string PropertyHtml  = "<img src='" + IsTopImageURL + "' title='" + IsTopImageAlt + "' /><img src='" + IsRedImageURL + "'title='" + IsRedImageAlt + "' /> <img src='" + IsHotImageURL + "' title='" + IsHotImageAlt + "' />";
                string EditHtml      = IsEdit ? "<a href=\"/News/EditNews?NewsId=" + row["Id"] + "\">" + row["Title"] + "</a>" : "<a>" + row["Title"] + "</a>";
                string DelHtml       = IsDel ? "<a href=\"javascript:InitPageContent('News')\" onclick=\"Del('/News/DelNews?NewsId=" + row["Id"] + "')\">删除</a>" : "";
                HtmlStr += "<tr><td>" + EditHtml + "</td><td>" + row["GameName"] + "</td><td>" + Type + "</td><td>" + row["ReleaseTime"] + "</td><td>" + row["SortId"] + "</td><td>" + PropertyHtml + "</td><td>" + DelHtml + "</td></tr>";
            }
            return(HtmlStr);
        }
コード例 #8
0
 public ActionResult DelWebInfo(int CompetenceId, int WebInfoId)
 {
     if (Session[Keys.SESSION_ADMIN_INFO] == null)
     {
         return(RedirectToAction("Login", "Admin"));
     }
     else
     {
         Master master = Session[Keys.SESSION_ADMIN_INFO] as Master;
         if (rcm.GetRoleCompetence(master.RoleId, CompetenceId))
         {
             sys_onepage wi = wim.GetWebInfo(WebInfoId);
             ViewData["modelname"]   = wi.modelname;
             ViewData["title"]       = wi.title;
             ViewData["contents"]    = wi.contents;
             ViewData["sort_id"]     = wi.sort_id;
             ViewData["seo_title"]   = wi.seo_title;
             ViewData["seo_keyword"] = wi.seo_keyword;
             ViewData["seo_desc"]    = wi.seo_desc;
             ViewData["img_url"]     = wi.img_url;
             ViewData["id"]          = wi.id;
             ViewData["style"]       = "display:none";
             if (rcm.GetRoleCompetence(master.RoleId, int.Parse(CompetenceId + "1")))
             {
                 ViewData["style"] = "display:block";
             }
             return(View("WebInfo"));
         }
         else
         {
             return(RedirectToAction("Login", "Admin"));
         }
     }
 }