init: 导入项目到 meswork Gitea
This commit is contained in:
86
DataMirrorTools_Simulator/P_SignalViewer/ConnectSelect.cs
Normal file
86
DataMirrorTools_Simulator/P_SignalViewer/ConnectSelect.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using DTTest;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DataMirrorToolsPage
|
||||
{
|
||||
public partial class ConnectSelect : ModelManagement
|
||||
{
|
||||
public string connCode = "";
|
||||
|
||||
public ConnectSelect()
|
||||
{
|
||||
InitializeComponent();
|
||||
RefreshConnInfo();
|
||||
}
|
||||
|
||||
private void RefreshConnInfo()
|
||||
{
|
||||
var dt_Connect = SqlOperation.SqlSignalTree.Select_Connect();
|
||||
dgv_ConnInfo.DataSource = dt_Connect;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void ShowAccomplish()
|
||||
{
|
||||
base.OnShown(new EventArgs());
|
||||
}
|
||||
|
||||
|
||||
private void btn_Sure_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
private void btn_Cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void dgv_ConnInfo_CellClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if (e.RowIndex > -1)
|
||||
{
|
||||
try
|
||||
{
|
||||
connCode = GetObjV(e, "连接代码").ToString();
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
LogNet.LogisTrac.WriteLog(typeof(ConnectSelect), err);
|
||||
|
||||
Console.WriteLine(err);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private object GetObjV(DataGridViewCellEventArgs e, string Name)
|
||||
{
|
||||
return dgv_ConnInfo.Rows[e.RowIndex].Cells[Name].Value;
|
||||
}
|
||||
|
||||
private void btn_Refresh_Click(object sender, EventArgs e)
|
||||
{
|
||||
RefreshConnInfo();
|
||||
}
|
||||
|
||||
private void ConnectSelect_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (dgv_ConnInfo.Rows.Count > 0)
|
||||
{
|
||||
//dgv_ConnInfo.SelectedRows[0].Selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user