Пример #1
0
 private void buttonSearch_Click(object sender, EventArgs e)
 {
     try
     {
         string projectName = textBoxProjectName.Text.Trim();
         if (projectName.Equals(string.Empty))
         {
             ZBMMessageBox.ShowInfo("请输入项目名");
             return;
         }
         ServiceClient client = new ServiceClient();
         DataTable dataTable = client.SelectSensorByProject(projectName);
         if (dataTable != null)
         {
             if (dataTable.Rows.Count > 0)
             {
                 dataGridViewSensor.DataSource = dataTable;
             }
             else
             {
                 ZBMMessageBox.ShowInfo("此项目名下不存在传感器");
             }
         }
         else
         {
             ZBMMessageBox.ShowInfo("查找失败");
         }
     }
     catch (Exception ex)
     {
         ExceptionLog.Instance.WriteLog(ex, LogType.UI);
         ZBMMessageBox.ShowError(ex);
     }
 }