Ejemplo n.º 1
0
        /// <summary>
        /// 记录数据库日志
        /// </summary>
        /// <param name="userId">操作员id</param>
        /// <param name="userName">操作员当前名</param>
        /// <param name="logTypeId">操作类型</param>
        /// <param name="remark">备注</param>
        public static void DbLog(int userId, string userName, int logTypeId, string remark)
        {
            var yunEntities = new IYunEntities();
            var dbLog       = new YD_Sys_DbLog()
            {
                y_userID    = userId,
                y_remark    = remark,
                y_time      = DateTime.Now,
                Y_userName  = userName,
                Y_logTypeID = logTypeId,
            };

            yunEntities.Entry(dbLog).State = EntityState.Added;
            yunEntities.SaveChanges();
            yunEntities.Dispose();
        }