Ejemplo n.º 1
0
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            var db = new Loiloc.Models.LoilocContext();

            if (values[parameterName] != null)
            {
                var tag = values[parameterName].ToString();
                return(db.tblGroupNews.Any(p => p.Tag == tag));
            }
            return(false);
        }
Ejemplo n.º 2
0
        public static void UpdateHistory(string task, string FullName, string UserID)
        {
            LoilocContext   db = new LoilocContext();
            tblHistoryLogin tblhistorylogin = new tblHistoryLogin();

            tblhistorylogin.FullName   = FullName;
            tblhistorylogin.Task       = task;
            tblhistorylogin.idUser     = int.Parse(UserID);
            tblhistorylogin.DateCreate = DateTime.Now;
            tblhistorylogin.Active     = true;

            db.tblHistoryLogins.Add(tblhistorylogin);
            db.SaveChanges();
        }
Ejemplo n.º 3
0
        public static bool  CheckQuyen(int Module, int Role, int idUser)
        {
            LoilocContext db        = new LoilocContext();
            var           listRight = db.tblRights.Where(p => p.idUser == idUser && p.idModule == Module && p.Role == Role).ToList();

            if (listRight.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }