Esempio n. 1
0
        private void bt_delete_Click(object sender, EventArgs e)
        {
            if (dgv_tjdjb.Rows.Count < 1)
            {
                return;
            }

            if (txt_zhxm.Text.Trim() == "")
            {
                MessageBox.Show("请选择组合项目名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.ActiveControl = txt_zhxm;
                return;
            }
            bool    exists   = false;//是否选择了人员
            tjdjBiz tjdjbiz1 = new tjdjBiz();

            foreach (DataGridViewRow dgr in dgv_tjdjb.Rows)
            {
                if (dgr.Cells["selected"].Value.ToString().Trim() == "1")
                {
                    exists = true;
                    string str_tjbh = dgr.Cells["tjbh"].Value.ToString().Trim();
                    string str_tjcs = dgr.Cells["tjcs"].Value.ToString().Trim();
                    //string str_djlsh = dgr.Cells["djlsh"].Value.ToString().Trim();
                    string str_sumover = dgr.Cells["sumover"].Value.ToString().Trim();
                    if (str_sumover == "2")//总检
                    {
                        MessageBox.Show("体检编号为:【" + str_tjbh + "】的人员已经总检,不允许调整项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        continue;
                    }
                    tjdjbiz1.str_Delete_tj_tjjlb(str_tjbh, str_tjcs, txt_zhxm.Tag.ToString().Trim());
                }
            }
            if (!exists)//没有选择人员
            {
                return;
            }
            tjdjbiz1.Exec_ArryList();
            MessageBox.Show("批量调整成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            if (!object.Equals(null, dgv_tjdjb.CurrentRow))
            {
                BindYxzhxm(dgv_tjdjb.CurrentRow);
            }
            txt_zhxm.Text = "";
            txt_zhxm.Tag  = "";
        }