Beispiel #1
0
        private void _scanCodes(string text, bool exists)
        {
            ScanEntry _scanEntry = new ScanEntry();

            _scanEntry.DateTime = DateTime.Now;
            _scanEntry.Code     = text;
            _scanEntry.Exist    = exists;
            _scanEntries.Add(_scanEntry);

            if (_scanEntry.Exist && _scanEntries.Count > 1000)
            {
                _scanEntries.RemoveAt(0);
            }
        }
Beispiel #2
0
        private void SendEmail(ScanEntry scanEntry)
        {
            string lastWrongEntryCode = scanEntry.Code;
            string lastWrongEntryTime = scanEntry.DateTime.ToString();

            string lastKnownCodeQuery = "Select Top 1 UserName, UserCode, Preis, Time From VW_Posten order by Time desc;";
            string lastKnownCodePreis;
            string lastKnownCodeTime;
            string lastKnownCodeUserID;
            string lastKnownCode;

            using (SqlDataReader lastKnownCodeReader = _dbconn.GetResult(lastKnownCodeQuery, null))
            {
                lastKnownCodeReader.Read();
                lastKnownCodeUserID = lastKnownCodeReader.GetValue(0).ToString();
                lastKnownCode       = lastKnownCodeReader.GetValue(1).ToString();
                lastKnownCodePreis  = lastKnownCodeReader.GetValue(2).ToString();
                lastKnownCodeTime   = lastKnownCodeReader.GetValue(3).ToString();
            }
            string body = $@"Good day Daniel ! 

Please check out the following Codes 
------------------------------------------------------
Unknown Code: 
Time: {lastWrongEntryTime} 
Code: {lastWrongEntryCode} 

Last recognized Code: 
Time: {lastKnownCodeTime} 
Code: {lastKnownCode} 
UserID: {lastKnownCodeUserID} 
Preis: {lastKnownCodePreis}
------------------------------------------------------



J.A.R.V.I.S.";

            SendMail = new Textmail.sendmail();
            Textmail.sendmail.send("*****@*****.**", _iniObj.ErrorMail, "Snackboxx error! :c", body, "192.168.2.68");
        }