Пример #1
0
        public List <ResultProperty> SearchResultAll()
        {
            List <ResultProperty> _result = new List <ResultProperty>();

            try
            {
                _resultData = _models.SearchResultAll();
                if (_resultData.StatusOnDb == true)
                {
                    if (_resultData.ResultOnDb.Rows.Count > 0)
                    {
                        for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++)
                        {
                            ResultProperty _resultInDB = new ResultProperty()
                            {
                                ID     = _resultData.ResultOnDb.Rows[i]["ID"].ToString(),
                                RESULT = _resultData.ResultOnDb.Rows[i]["RESULT"].ToString()
                            };
                            _result.Add(_resultInDB);
                        }
                    }
                }
                else
                {
                    MessageBox.Show(_resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                return(_result);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(_result);
            }
        }