Exemple #1
0
        /// <summary>
        /// /// <summary>
        /// 添加床位操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btninsertbed_Click(object sender, EventArgs e)
        {
            OP_Bed op_bed = new OP_Bed();
            bool   insertResult;

            HIS.Model.ZY_NURSE_BED bedlist = new HIS.Model.ZY_NURSE_BED();
            if (chkaddbed.Checked == false)
            {
                bedlist.BED_NO = queryTextBox1.Text;
            }
            else
            {
                bedlist.BED_NO = "加" + queryTextBox1.Text;
            }
            //如果只显示当前科室
            if (currdeptonly)
            {
                bedlist.DEPT_ID = Convert.ToInt32(_currentDept.DeptID);
            }
            else
            {
                bedlist.DEPT_ID = Convert.ToInt32(cmbDeptName.SelectedValue.ToString());
            }
            bedlist.ROOM_NO = textBox3.Text;
            if (bedlist.BED_NO == "")
            {
                MessageBox.Show("床号不能为空,请输入床号!", "提示", MessageBoxButtons.OK);
                return;
            }
            else
            {
                insertResult = op_bed.insertNewBed(bedlist);
            }
            if (insertResult == true)
            {
                MessageBox.Show("添加床位成功", "提示", MessageBoxButtons.OK);
                dataGridViewEx1.DataSource = op_bed.getAllBedInfo(_currentDept.DeptID);
                InitListView(Convert.ToInt64(cmbDeptName.SelectedValue.ToString()));
                InitGroupBox2(Convert.ToInt64(cmbDeptName.SelectedValue.ToString()));
            }
            else
            {
                MessageBox.Show("该床位已经存在,请重新输入床位号", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }