예제 #1
0
        public ActionResult Videos()
        {
            Logger.InitLogger();
            bool check = false;
            InstructionsVideos load_inst = new InstructionsVideos();
            ArrayList          inst_data = new ArrayList();

            load_inst.LoadInstructions(check);
            inst_data.Add(load_inst);
            return(View("InstructionsAndTests", inst_data));
        }
예제 #2
0
        //[OutputCache(Duration = 30, Location = OutputCacheLocation.Downstream)]
        public ActionResult InstructionsAndTests()
        {
            try
            {
                Logger.InitLogger();
                ClaimsIdentity user  = (ClaimsIdentity)(User.Identity);
                string         type  = string.Empty;
                string         right = string.Empty;

                IEnumerable <Claim> claims = user.Claims;

                try
                {
                    type  = claims.ElementAt(4).Type;
                    right = claims.ElementAt(4).Value;
                }
                catch (Exception ex)
                {
                    Logger.Log.Error("Попытка несанкционированный доступ!" + ex.Message);
                    return(Redirect("/Account/Login"));
                }
                if (type == "Rights" && right == "Мастер" || right == "Работник ОК")
                {
                    bool check = true;
                    InstructionsVideos load_inst = new InstructionsVideos();
                    ArrayList          inst_data = new ArrayList();
                    load_inst.LoadInstructions(check);
                    inst_data.Add(load_inst);

                    return(View(inst_data));
                }
                else
                {
                    return(View("ErrorRight"));
                }
            }
            catch (Exception ex)
            {
                return(Content("<script language='javascript' type='text/javascript'>alert('Ошибка в ходе загрузки страницы!" + ex.Message + "');window.location.href = 'Index';</script>"));
            }
        }