コード例 #1
0
        void _port_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
Line:
            string data = _port.ReadExisting();

            if (data != "")
            {
                _lastData += data;
                System.Threading.Thread.Sleep(60);
                goto Line;
            }

            //listBox1.Items.Add(_lastData);

            //Send Data to be saved in the database and business checks.

            string[] _lastDataSplit = _lastData.Split('_');

            BusinessWorkFlowService.BusinessWorkFlowsClient _businessWorkFlowObj = new BusinessWorkFlowsClient();

            //_businessWorkFlowObj.SaveDeviceEventLog(_lastDataSplit);

            string _resultOfSavingEvent = _businessWorkFlowObj.SaveDeviceEventLogWithAlarmChecks(_lastDataSplit);

            //END Send Data to be saved in the database and business checks.

            _lastData = null;
        }
コード例 #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            BusinessWorkFlowService.BusinessWorkFlowsClient _bwfc = new BusinessWorkFlowsClient();

            string[] _loginResults = _bwfc.VerifyUserNameAndPassword(textBoxUserName.Text.Trim(), textBoxPassword.Text.Trim());

            if (_loginResults[0] != "0")
            {
                UserObjectId = _loginResults[0];
                UserRole     = _loginResults[1];
                IsValid      = true;
                this.Close();
            }

            else
            {
                IsValid = false;
                MessageBox.Show("UserName or password is wrong");
            }
        }