public ActionResult Index()
        {
            ViewData.Clear();
            DBManager DBMn = new DBManager(new EFFacade());

            string company = (User.Identity as ClaimsIdentity).Claims.First(x => x.Type == ClaimTypes.UserData).Value;
            DayReport DR = DBMn.getDayReport(DateTime.Now.Date, company);
            if (DR != null)
            {
                ViewData["Note"] = DR.Message;
                ViewData["Back"] = true;
            }
            string OperatorName = ((ClaimsIdentity)User.Identity).Claims.First(x => x.Type == ClaimTypes.Surname).Value;

            ViewData["Operator"] = OperatorName;
            return View();
        }
 void IActionFilter.OnActionExecuting(ActionExecutingContext filterContext)
 {
     DBManager DBMn = new DBManager(new EFFacade());
     ClaimsIdentity user = filterContext.Controller.ControllerContext.HttpContext.User.Identity as ClaimsIdentity;
     string role = user.Claims.First(x => x.Type == ClaimTypes.Role).Value;
     string company = user.Claims.First(x => x.Type == ClaimTypes.UserData).Value;
     if (role == "Operator")
     {
         if (DBMn.getDayReport(DateTime.Now.Date, company) == null)
         {
             filterContext.Result = new RedirectToRouteResult(new System.Web.Routing.RouteValueDictionary{
                 { "controller", "Form" },
                 { "action", "Index" }
              });
         }
     }
 }