//删除当前病例 private void BtnCaseDel_Click(object sender, RoutedEventArgs e) { SectionRoomSo s = new SectionRoomSo(); foreach (SectionRoomSo item in sw) { if (treeView1.SelectedItem.ToString() == item.SonSname) { s.SonSname = item.SonSname; foreach (TreeViewItem node in node_list) { foreach (SectionRoomSo it in sw) { if (it.Sname == item.Sname) { node.Items.Remove(it.SonSname); } } } sw.Remove(item); txtSonName.Text = ""; new SectionRoomSonBLL().SonDelet(s); SectionroomManage_Load(null, null); return; } } }
public List <SectionRoomSo> SectionRoomSonCheck() { SqlDataReader reader = DBHelper.SectionRoomSelect("p_SectionRooomSon_select"); while (reader.Read()) { SectionRoomSo sr = new SectionRoomSo(); sr.Sname = reader[1] + ""; sr.SonSname = reader[2] + ""; sw.Add(sr); } DBHelper.cmd.Dispose(); DBHelper.reader.Dispose(); DBHelper.con.Close(); return(sw); }
private void button3_Click(object sender, EventArgs e) { SectionRoomSo s = new SectionRoomSo(); foreach (SectionRoomSo item in sw) { if (treeView1.SelectedNode.Text == item.SonSname) { s.SonSname = item.SonSname; treeView1.Nodes.Remove(treeView1.SelectedNode); sw.Remove(item); txtSonName.Text = ""; new SectionRoomSonBLL().SonDelet(s); return; } } }
//添加病例 private void BtnCaseAdd_Click(object sender, RoutedEventArgs e) { SectionRoomSo w = new SectionRoomSo(); w.Sname = cboSectionRoom.Text; w.SonSname = txtSonName.Text; string str = new SectionRoomSonBLL().Son(w); if (str == "") { sw.Add(w); } else { MessageBox.Show(str); } SectionroomManage_Load(null, null); }
private void button1_Click(object sender, EventArgs e) { treeView1.Nodes.Clear(); SectionRoomSo w = new SectionRoomSo(); w.Sname = cboSectionRoom.Text; w.SonSname = txtSonName.Text; string str = new SectionRoomSonBLL().Son(w); if (str == "") { sw.Add(w); } else { MessageBox.Show(str); } SectionRoomSon_Load(null, null); }
public string SonDelteDal(SectionRoomSo s) { SqlParameter SonName = new SqlParameter("@SonName", SqlDbType.VarChar); SqlParameter result = new SqlParameter("@result", SqlDbType.VarChar, 20); result.Direction = ParameterDirection.Output; SonName.Value = s.SonSname; SqlParameter[] ps = { SonName, result }; bool f = DBHelper.ExecuteNonQueryProc("p_SectionRooomSonDelete", ps); if (f) { return(result.Value + ""); } else { return("出现异常"); } }
public string SonDelet(SectionRoomSo s) { return(new SectionRoomSonDAL().SonDelteDal(s)); }
public string Son(SectionRoomSo s) { return(new SectionRoomSonDAL().SonInsert(s)); }