public List <ProcessProperty> SearchProcessAll() { List <ProcessProperty> _result = new List <ProcessProperty>(); try { _resultData = _models.SearchProcessAll(); if (_resultData.StatusOnDb == true) { if (_resultData.ResultOnDb.Rows.Count > 0) { for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++) { ProcessProperty _process = new ProcessProperty() { ID = _resultData.ResultOnDb.Rows[i]["ID"].ToString(), PROCESS_NAME = _resultData.ResultOnDb.Rows[i]["PROCESS_NAME"].ToString(), INUSE = _resultData.ResultOnDb.Rows[i]["INUSE"].ToString() }; _result.Add(_process); } } } 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); } }