//Data Received Event Handler private void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e) { char c1 = getSignal(sender); HidePictureBox(); LogControl.Write("Signal from COMport" + c1); // Рекламные ролики if (c1 == '1') { SetTemperature(""); InitializeVideoPlayer(1); } // Демонстрация else if (c1 == '2') { ShowPictureBox(); SetTemperature(getTemperature()); InitializeVideoPlayer(2); } // Положите телефон else if (c1 == '3') { SetTemperature(getTemperature()); ShowPictureBox(); InitializeVideoPlayer(3); } // Обработка телефона else if (c1 == '4') { InitializeVideoPlayer(4); SetTemperature(""); } // Не успешная обработка else if (c1 == '5') { InitializeVideoPlayer(5); SetTemperature(""); } //Показ фотографий и температуры else if (c1 == '7') { SetTemperature(getTemperature()); ShowPictureBox(); } else if (c1 == '8') { Emailer.getInstance().logOnLiquidEnded(); } }
private void sendMessageToClientWithSubject(String message, String clientEmail, String subject) { try { MailMessage mail = new MailMessage(); mail.From = this.sender; mail.To.Add(clientEmail); mail.Subject = subject; mail.Body = message; this.smtp.Send(mail); } catch { LogControl.Write(subject + " " + message); } }