public override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     if (!BGKFunction.GetMyRole().BakimdaGiris&& BGKFunction.GetConfig("site-on/off").ToString() == "0")
     {
         UrlHelper url = new UrlHelper(filterContext.RequestContext);
         filterContext.Result = new EmptyResult();
         filterContext.Result = new RedirectResult(url.Action("Maintenance", "Home", new { area = "" }));
     }
     base.OnActionExecuting(filterContext);
 }
Exemplo n.º 2
0
        public static MvcHtmlString GetMemberCard(this bgk_uye member)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("<div style=\"display: none; background-color: #fff; padding: 5px; width: 150px; height: 75px; border: 1px solid #ccc\">" +
                      "<b>@member.AdSoyad</b><br />" +
                      member.GetMemberRole().Adi + "<br />" +
                      BGKFunction.GetGrade(member.Puan) +
                      "</div>" + member.AdSoyad);
            return(MvcHtmlString.Create(sb.ToString()));
        }
Exemplo n.º 3
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            bool isRole = true;
            var  role   = BGKFunction.GetMyRole();

            switch (_role)
            {
            case "PostManagement":
                if (!role.Yazi)
                {
                    isRole = false;
                }
                break;

            case "CommentManagement":
                if (!role.Yorum)
                {
                    isRole = false;
                }
                break;

            case "PageManagement":
                if (!role.Sayfa)
                {
                    isRole = false;
                }
                break;

            case "ConfigManagement":
                if (!role.Ayar)
                {
                    isRole = false;
                }
                break;

            case "ActivityManagement":
                if (!role.Etkinlik)
                {
                    isRole = false;
                }
                break;

            case "BudgetManagement":
                if (!role.Butce)
                {
                    isRole = false;
                }
                break;

            case "FileManagement":
                if (!role.Dosya)
                {
                    isRole = false;
                }
                break;

            case "GroupManagement":
                if (!role.Grup)
                {
                    isRole = false;
                }
                break;

            case "MissionManagement":
                if (!role.Gorev)
                {
                    isRole = false;
                }
                break;

            case "NotificationManagement":
                if (!role.Bildirim)
                {
                    isRole = false;
                }
                break;

            case "FactoryManagement":
                if (!role.Firma)
                {
                    isRole = false;
                }
                break;

            case "MenuManagement":
                if (!role.Link)
                {
                    isRole = false;
                }
                break;

            case "MemberManagement":
                if (!role.Uye)
                {
                    isRole = false;
                }
                break;

            case "GradeManagement":
                if (!role.Seviye)
                {
                    isRole = false;
                }
                break;

            case "RoleManagement":
                if (false)     //Ayarlanacak
                {
                    isRole = false;
                }
                break;

            case "DocumentManagement":
                if (!role.Dokuman)
                {
                    isRole = false;
                }
                break;

            case "NoteManagement":
                if (!role.Not)
                {
                    isRole = false;
                }
                break;

            case "GalleryManagement":
                if (!role.Galeri)
                {
                    isRole = false;
                }
                break;

            case "PollManagement":
                if (!role.Anket)
                {
                    isRole = false;
                }
                break;

            case "CreatePost":
                if (!role.YaziYazma)
                {
                    isRole = false;
                }
                break;

            case "GiveMission":
                if (!role.GorevVerme)
                {
                    isRole = false;
                }
                break;
            }
            if (!isRole)
            {
                UrlHelper url = new UrlHelper(filterContext.RequestContext);
                filterContext.Result = new EmptyResult();
                filterContext.Result = new RedirectResult(url.Action("NoRole", "Error", new { area = "" }));
            }
            base.OnActionExecuting(filterContext);
        }