コード例 #1
0
        public static void UpdateHistory(string task, string FullName, string UserID)
        {
            CaesarContext   db = new CaesarContext();
            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();
        }
コード例 #2
0
        public static bool  CheckQuyen(int Module, int Role, int idUser)
        {
            CaesarContext db        = new CaesarContext();
            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);
            }
        }