Esempio n. 1
0
        public void CreateDataLog(ObjectId uId, string message, Risk risk, bool visible = true)
        {
            if (string.IsNullOrWhiteSpace(message))
            {
                return;
            }

            DataLog dataLog = new DataLog
            {
                UserId    = uId,
                Message   = message,
                Risk      = risk,
                TimeStamp = DateTime.Now,
                Visible   = visible
            };

            database.StoreDataLog(dataLog);
        }
Esempio n. 2
0
        // Datalog store
        public DataResult <DataLog> StoreDataLog(DataLog log)
        {
            DataResult <DataLog> result = new DataResult <DataLog>();

            if (!mOnline)
            {
                result.Success      = false;
                result.ErrorMessage = DB_ERROR;
                return(result);
            }

            try
            {
                GetDataLogCollection().InsertOne(log);
                result.Success = true;
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }

            return(result);
        }