private IEnumerable <string> SelectHistoryLogs(string radioButtonName)
        {
            HistoryOperations    history = new HistoryOperations();
            IEnumerable <string> logsEntry;

            switch (radioButtonName)
            {
            case "AllRadioButton":
                logsEntry = history.ReadAllHistoryLog();
                break;

            case "RegNoRadioButton":
                if (string.IsNullOrEmpty(this.RegNoHistoryTextBox.Text))
                {
                    return(new List <string> {
                        "Enter register number!"
                    });
                }

                logsEntry = history.SelectLogsEntry(this.RegNoHistoryTextBox.Text);
                break;

            default:
                return(new List <string> {
                    "Problem with history selection"
                });
            }

            return(logsEntry);
        }
Exemple #2
0
        public static void Start(object clientSocket)
        {
            Socket     socket           = (Socket)clientSocket;
            var        OperationsBuffer = new HistoryOperations();
            var        _InOutStream     = new InOutStream(socket);
            var        Buffer           = new ValuesBuffer(socket);
            IOperation currentOperation = new SaveNumberOperation();

            _InOutStream.HelpMessage();
            try
            {
                while (currentOperation.Run(Buffer, _InOutStream, OperationsBuffer, socket))
                {
                    currentOperation = _InOutStream.ReadOperation(operations);
                }
            }
            catch (Exception e) {
                Console.WriteLine(e.Message);
            }
        }