private void button1_Click(object sender, EventArgs e) { surgery_output output = new surgery_output(); output.surgery_id = 0; //麻醉科编号为0 output.room_id = int.Parse(roomId_com.Text.Trim()); output.medicine_number = medNub_com.Text.Trim(); output.output_count = int.Parse(count_txt.Text.Trim()); output.confirm_person = confirmPerson_txt.Text; output.output_time = DateTime.Now; int test = bll.TestSub_surgery_stock(output); if (0 == test) { MessageBox.Show("药库中没有这种药", "警告"); return; } if (1 == test) { MessageBox.Show("药库中这种药的库存不足", "警告"); return; } int flag = 0; flag = bll.Add_surgery_output(output); if (flag == 0) { MessageBox.Show("添加分发记录失败"); } if (flag == -2) { MessageBox.Show("逻辑错误"); } bll.UpdateSub_surgery_stock(output); output_set = bll.select_surgery_output(); dataGridView2.DataSource = output_set.Tables[0]; room_input input = new room_input(); input.surgery_id = 0; //麻醉科编号为0 input.room_id = int.Parse(roomId_com.Text); input.medicine_number = medNub_com.Text; input.input_count = int.Parse(count_txt.Text); input.confirm_person = confirmPerson_txt.Text; input.input_time = DateTime.Now; bll.UpdateAdd_room_stock(input); bll.Add_room_input(input); room_stock_set = bll.select_room_stock(int.Parse(roomId_com.Text)); dataGridView3.DataSource = room_stock_set.Tables[0]; stock_set = bll.select_surgery_stock(); dataGridView1.DataSource = stock_set.Tables[0]; }
private void button1_Click(object sender, EventArgs e) { if (medNub_IN_txt.Text.Trim() == "") { MessageBox.Show("药品编号不能为空"); medNub_IN_txt.Focus(); } else if (medName_IN_txt.Text.Trim() == "") { MessageBox.Show("药品名称不能为空"); medName_IN_txt.Focus(); } else if (count_IN_txt.Text.Trim() == "") { MessageBox.Show("进药数量不能为空"); count_IN_txt.Focus(); } else if (confirmPerson_IN_txt.Text.Trim() == "") { MessageBox.Show("确认人不能为空"); confirmPerson_IN_txt.Focus(); } else { room_input input = new room_input(); medicine_info medicine = new medicine_info(); input.room_id = int.Parse(roomId_IN_com.Text); input.medicine_number = medNub_IN_txt.Text; input.input_count = int.Parse(count_IN_txt.Text); input.confirm_person = confirmPerson_IN_txt.Text; input.input_time = DateTime.Now; medicine.medicine_number = medNub_IN_txt.Text; medicine.medicine_name = medName_IN_txt.Text; medicine.phonetic_prefix = phoneticPrefix_IN_txt.Text; medicine.toxicology = toxicology_IN_txt.Text; medicine.state = state_IN_txt.Text; medicine.dosagy_form = dosagyForm_IN_txt.Text; medicine.specification = specification_IN_txt.Text; medicine.produce_time = produceTime_picker.Value; medicine.deadline = deadline_picker.Value; medicine.batch_number = batchNum_IN_txt.Text; medicine.origin_place = originPlace_IN_txt.Text; bll.Add_medicine_info(medicine); bll.UpdateAdd_room_stock(input); bll.Add_room_input(input); input_set = bll.select_room_input(); dataGridView1.DataSource = input_set.Tables[0]; } }
private void button1_Click(object sender, EventArgs e) { room_input input = new room_input(); input.surgery_id = int.Parse(surgeryId_IN_com.Text.Trim()); input.room_id = int.Parse(roomId_IN_com.Text); input.medicine_number = medNub_IN_txt.Text; input.input_count = int.Parse(count_IN_txt.Text); input.confirm_person = confirmPerson_IN_txt.Text; input.input_time = DateTime.Now; bll.UpdateAdd_room_stock(input); bll.Add_room_input(input); input_set = bll.select_room_input(); dataGridView1.DataSource = input_set.Tables[0]; }