private void link_bianji_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { //获得通知公告表中标题对应的信息,实例化一个jjtongzhiinfo string biaoti = lbl_mingcheng.Text; string leixing = lbl_leixing.Text; //实例化一个mftongzhigonggao,把jjtongzhiinfo传递进来,mftongzhigonggao的状态设置为编辑模式(还有一个是创建模式) string str_sql = $"select * from jjdbrenwutaizhang.通知公告表 " + $"where 标题='{biaoti}'"; DataTable mydt = _mysql.ExecuteDataTable(str_sql); List <string> list_fanwei = new List <string>(); foreach (DataRow dataRow in mydt.Rows) { list_fanwei.Add(dataRow["阅读范围"].ToString()); } JJTongzhiInfo myinfo = new JJTongzhiInfo() { _biaoti = mydt.Rows[0]["标题"].ToString(), _qianfaren = mydt.Rows[0]["签发人"].ToString(), _qingzhonghuanji = mydt.Rows[0]["轻重缓急"].ToString(), _neirongpath = mydt.Rows[0]["内容"].ToString(), _shixian = mydt.Rows[0]["时限"].ToString(), _fujian = mydt.Rows[0]["附件"].ToString(), _chuangjianren = mydt.Rows[0]["创建人"].ToString(), _yuedufanwei = string.Join(",", list_fanwei) }; WFtongzhigonggao mywin = new WFtongzhigonggao(myinfo); mywin.mode = "编辑"; if (mywin.ShowDialog() == DialogResult.OK) { JJMethod.a_shuaxinzhuye(null, null); } }
private void label5_Click(object sender, EventArgs e) { var mywin = new WFtongzhigonggao() { WindowState = FormWindowState.Maximized, StartPosition = FormStartPosition.CenterParent }; //mywin.TopLevel = false; mywin.MdiParent = this.ParentForm; panel_task.Controls.Add(mywin); mywin.Show(); }