本文整理汇总了C#中ServiceClient.SelectDeviceByProject方法的典型用法代码示例。如果您正苦于以下问题:C# ServiceClient.SelectDeviceByProject方法的具体用法?C# ServiceClient.SelectDeviceByProject怎么用?C# ServiceClient.SelectDeviceByProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServiceClient
的用法示例。
在下文中一共展示了ServiceClient.SelectDeviceByProject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: buttonSearch_Click
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.SelectDeviceByProject(projectName);
if (dataTable != null)
{
if (dataTable.Rows.Count > 0)
{
dataGridViewDevice.DataSource = dataTable;
}
else
{
ZBMMessageBox.ShowInfo("此项目名下不存在设备");
}
}
else
{
ZBMMessageBox.ShowInfo("查找失败");
}
}
catch (Exception ex)
{
ExceptionLog.Instance.WriteLog(ex, LogType.UI);
ZBMMessageBox.ShowError(ex);
}
}
示例2: dataGridViewProject_RowStateChanged
private void dataGridViewProject_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
{
try
{
if (e.StateChanged == DataGridViewElementStates.Selected)
{
if (dataGridViewProject.Rows.Count > 0)
{
dataRowProject = dataTableProject.Rows[e.Row.Index];
string projectName = Convert.ToString(dataRowProject["ProjectName"]);
ServiceClient client = new ServiceClient();
dataTableDevice = client.SelectDeviceByProject(projectName);
dataGridViewProjectDevice.DataSource = dataTableDevice;
}
}
}
catch (Exception ex)
{
ExceptionLog.Instance.WriteLog(ex, LogType.UI);
ZBMMessageBox.ShowError(ex);
}
}