Exemple #1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (txt_jyxtbh.Text.ToString() == "")
     {
         MessageBox.Show("请填写检验科室项目编码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     lisbiz.str_Insert_TJ_JGXMDZB(txt_tjxtbh.Text, txt_jyxtbh.Text, txt_sm.Text.Trim());
     LoadDgvXmdz(txt_tjxtbh.Text);
 }
        private void bt_save_Click(object sender, EventArgs e)
        {
            if (txt_jyxtbh.Text.ToString() == "")
            {
                MessageBox.Show("请填写检验科室项目编码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //判断检验科编码是否已经对照
            DataTable dt = lisbiz.Get_LIS_JGXMDZB(txt_jyxtbh.Text.Trim(), txt_tjxtbh.Text.Trim());

            if (dt.Rows.Count > 0)
            {
                MessageBox.Show("检验项目编码已经被体检项目【" + dt.Rows[0]["mc"].ToString() + "】对照,请检查!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            lisbiz.str_Insert_TJ_JGXMDZB(txt_tjxtbh.Text.Trim(), txt_jyxtbh.Text.Trim(), txt_sm.Text.Trim());
            MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        private void bt_save_Click(object sender, EventArgs e)
        {
            string tjmxxm  = txt_tjxtbh.Text.Trim();
            LisBiz lisbiz1 = new LisBiz();

            lisbiz1.str_Delete_TJ_JGXMDZB(tjmxxm);
            dt_TJ_JGXMDZB.AcceptChanges();
            foreach (DataRow dr in dt_TJ_JGXMDZB.Rows)
            {
                string jyjx = dr["jyjx"].ToString().Trim();
                string gjc  = dr["gjc"].ToString().Trim();
                string sm   = dr["sm"].ToString().Trim();
                if (jyjx != "" && gjc != "")
                {
                    lisbiz1.str_Insert_TJ_JGXMDZB(tjmxxm, jyjx, gjc, sm);
                }
            }
            lisbiz1.Exec_ArrayList();
            MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }