private void button1_Click(object sender, EventArgs e) { if (count_txt.Text.Trim() != "") { room_output output = new room_output(); output.room_id = int.Parse(roomId_com.Text.Trim()); output.medicine_number = medNub_com.Text; output.output_count = int.Parse(count_txt.Text.Trim()); output.output_time = DateTime.Now; output.confirm_person = confirmPerson_txt.Text; int test = bll.TestSub_room_stock(output); if (0 == test) { MessageBox.Show("手术间里没有这种药品", "警告"); return; } if (1 == test) { MessageBox.Show("手术间里这种药品不足", "警告"); return; } bll.UpdateSub_room_stock(output); surgery_checkin checkin = new surgery_checkin(); checkin.surgery_id = 0; //麻醉科编号为0 checkin.room_id = int.Parse(roomId_com.Text.Trim()); checkin.medicine_number = medNub_com.Text; checkin.count = int.Parse(count_txt.Text); checkin.checkin_time = DateTime.Now; checkin.confirm_person = confirmPerson_txt.Text; if (0 == bll.Test_surgery_checkin(checkin)) { MessageBox.Show("该手术室没有向该手术间输出过此类药品", "警告"); return; } bll.Update_surgery_stock(checkin); bll.Add_surgery_checkin(checkin); return_set = bll.select_surgery_checkin(); dataGridView2.DataSource = return_set.Tables[0]; room_stock_set = bll.select_room_stock(int.Parse(roomId_com.Text.Trim())); dataGridView3.DataSource = room_stock_set.Tables[0]; stock_set = bll.select_surgery_stock(); dataGridView1.DataSource = stock_set.Tables[0]; } else { MessageBox.Show("退库数量不能为空"); } }
private void button3_Click(object sender, EventArgs e) { surgery_checkin checkin = new surgery_checkin(); checkin.surgery_id = int.Parse(surgeryId_CHECK_com.Text.Trim()); checkin.room_id = int.Parse(roomId_CHECK_com.Text.Trim()); checkin.medicine_number = medNub_CHECK_txt.Text; checkin.count = int.Parse(count_CHECK_txt.Text); checkin.checkin_time = DateTime.Now; checkin.confirm_person = confirm_CHECK_txt.Text; if (0 == bll.Test_surgery_checkin(checkin)) { MessageBox.Show("该手术室没有向该手术间输出过此类药品", "警告"); return; } bll.Update_surgery_stock(checkin); bll.Add_surgery_checkin(checkin); checkin_set = bll.select_surgery_checkin(); dataGridView3.DataSource = checkin_set.Tables[0]; }