111,126
社区成员
发帖
与我相关
我的任务
分享
//创建工具栏响应
private void toolStripButton5_Click(object sender, EventArgs e)
{
toolStripMenuItem28_Click(sender, e);
}
//创建工具栏事件
private void toolStripMenuItem28_Click(object sender, EventArgs e)
{
if (dgvEquipmentList.RowCount > 1)
{
DataSet ds = oper.GetDataSetZC(dgvEquipmentList.SelectedCells[1].Value.ToString());
if (ds.Tables[0].Rows.Count > 0)
{
test pdf = new test();//创建子窗体对象
pdf.M_frmMain = this;
pdf.M_str_BH = dgvEquipmentList.SelectedCells[1].Value.ToString();
pdf.ShowDialog();//显示子窗体
}
else
{
MessageBox.Show("用户选择的数据不存在!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.DataBindGridViewList();
}
}
}
BaseClass.Operation oper = new EquipmentMS.BaseClass.Operation();//创建数据连接对象
public frmMain M_frmMain = null;
public string M_str_BH = "";
public test()
{
InitializeComponent();
}
private void test_Load(object sender, EventArgs e)
{
DataSet ds = oper.GetDataSetZC(M_str_BH);
txtBH.Text = ds.Tables[0].Rows[0]["BH"].ToString();
}