private void button4_Click(object sender, EventArgs e) { if (txtSaddr.Text == "" && txtSname.Text == "" && txtSprice.Text == "") { return; } treeView1.Nodes.Clear(); SectionRoom s = new SectionRoom(); s.Sname = txtSname.Text; s.Saddr = txtSaddr.Text; s.Sprice = int.Parse(txtSprice.Text); string result = new SectionRoomBLL().Chuan(s); if (result == 1 + "") { se.Add(s); } else { MessageBox.Show(result); } SectionRoomSon_Load(null, null); }
public void SectionRoomDelte(SectionRoom s) { SqlParameter Sname = new SqlParameter("@Sname", SqlDbType.VarChar); Sname.Value = s.Sname; bool f = DBHelper.ExecuteNonQueryProc("p_SectionRoom_Delete", Sname); }
private void button1_Click(object sender, EventArgs e) { SectionRoom s = new SectionRoom(); s.Sname = txtSname.Text; s.Saddr = txtSaddr.Text; s.Sprice = int.Parse(txtSprice.Text); new SectionRoomBLL().Update(s); listView1.Items.Clear(); SectionRoomDelete_Load(null, null); }
//修改 private void BtnRevise_Click(object sender, RoutedEventArgs e) { SectionRoom s = new SectionRoom(); s.Sname = txtSname.Text; s.Saddr = txtSaddr.Text; s.Sprice = int.Parse(txtSprice.Text); new SectionRoomBLL().Update(s); listView1.Items.Clear(); Init_Load(null, null); }
public void SectionRoomUpdate(SectionRoom s) { SqlParameter Sname = new SqlParameter("@Sname", SqlDbType.VarChar); SqlParameter Saddr = new SqlParameter("@Saddr", SqlDbType.VarChar); SqlParameter Sprice = new SqlParameter("@Sprice", SqlDbType.Int); Sname.Value = s.Sname; Saddr.Value = s.Saddr; Sprice.Value = s.Sprice; SqlParameter[] ps = { Sname, Saddr, Sprice }; DBHelper.ExecuteNonQueryProc("p_SectionRoom_Update", ps); }
/// <summary> /// 科室查询 /// </summary> /// <returns></returns> public List <SectionRoom> p_SectionRoom_select() { List <SectionRoom> section = new List <SectionRoom>(); SqlDataReader reader = DBHelper.SectionRoomSelect("p_SectionRoom_select"); while (reader.Read()) { SectionRoom ses = new SectionRoom(); ses.Sname = reader[1] + ""; ses.Saddr = reader[2] + ""; ses.Sprice = int.Parse(reader[3] + ""); section.Add(ses); } DBHelper.con.Close(); DBHelper.con.Dispose(); DBHelper.cmd.Dispose(); return(section); }
//删除 private void BtnDelete_Click(object sender, RoutedEventArgs e) { SectionRoom s = new SectionRoom(); if (listView1.SelectedItems.Count > 0) { s.Sname = txtSname.Text; new SectionRoomBLL().Delete(s); listView1.Items.RemoveAt(listView1.SelectedIndex); } listView1.Items.Clear(); Init_Load(null, null); txtSname.Text = ""; txtSaddr.Text = ""; txtSprice.Text = ""; Tip p = new Tip("删除成功"); p.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { SectionRoom s = new SectionRoom(); if (listView1.SelectedItems.Count > 0) { int i = listView1.SelectedItems[0].Index; s.Sname = listView1.Items[i].Text + ""; new SectionRoomBLL().Delete(s); } listView1.Items.Clear(); SectionRoomDelete_Load(null, null); PromptingForm p = new PromptingForm("删除成功"); p.ShowDialog(); txtSname.Text = ""; txtSaddr.Text = ""; txtSprice.Text = ""; }
public string SectionRoomChuan(SectionRoom s) { SqlParameter Sname = new SqlParameter("@Sname", SqlDbType.VarChar); SqlParameter Saddr = new SqlParameter("@Saddr", SqlDbType.VarChar); SqlParameter Sprice = new SqlParameter("@Sprice", SqlDbType.Int); SqlParameter result = new SqlParameter("@result", SqlDbType.VarChar, 10); result.Direction = ParameterDirection.Output; Sname.Value = s.Sname; Saddr.Value = s.Saddr; Sprice.Value = s.Sprice; SqlParameter[] ps = { Sname, Saddr, Sprice, result }; bool f = DBHelper.ExecuteNonQueryProc("p_SectionRoom", ps); if (f) { return(1 + ""); } else { return(result + ""); } }
//添加科别 private void BtnSecAdd_Click(object sender, RoutedEventArgs e) { if (txtSaddr.Text == "" && txtSname.Text == "" && txtSprice.Text == "") { return; } SectionRoom s = new SectionRoom(); s.Sname = txtSname.Text; s.Saddr = txtSaddr.Text; s.Sprice = int.Parse(txtSprice.Text); string result = new SectionRoomBLL().Chuan(s); if (result == 1 + "") { se.Add(s); } else { MessageBox.Show(result); } SectionroomManage_Load(null, null); }
public void Update(SectionRoom s) { new SectionRoomDAL().SectionRoomUpdate(s); }
public void Delete(SectionRoom s) { new SectionRoomDAL().SectionRoomDelte(s); }
public string Chuan(SectionRoom s) { return(new SectionRoomDAL().SectionRoomChuan(s)); }