private void button5_Click(object sender, EventArgs e) { if (this.textBox4.Text == "" || this.queryTextBox1.Text == "") { MessageBox.Show("请填写完整数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } try { OP_Favorable.SaveItemMXFavor(patcode , this.queryTextBox1.MemberValue.ToString() , this.comboBox6.SelectedIndex , Convert.ToDecimal(this.textBox4.Text.Trim())); MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); patcode = this.dgvPatType[code.Name, this.dgvPatType.CurrentCell.RowIndex].Value.ToString(); this.dgvBigItem.AutoGenerateColumns = false; this.dgvItemMx.AutoGenerateColumns = false; this.dgvBigItem.DataSource = OP_Favorable.GetItemFavorData(patcode); DataTable dt = OP_Favorable.GetItemMXFavorData(patcode); this.dgvItemMx.DataSource = OP_Favorable.GetItemMXFavorItemName(dt, dtBaseItem, dtGroupItem, dtDrug); } catch (Exception err) { MessageBox.Show("您填写数据有误!+\n" + err.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void dgvPatType_CurrentCellChanged(object sender, EventArgs e) { if (this.dgvPatType.CurrentCell != null) { this.cbBasePatType.SelectedValue = this.dgvPatType[code.Name, this.dgvPatType.CurrentCell.RowIndex].Value; this.comboBox2.Text = this.dgvPatType[favor_type.Name, this.dgvPatType.CurrentCell.RowIndex].Value.ToString(); this.textBox1.Text = this.dgvPatType[favor_sacle.Name, this.dgvPatType.CurrentCell.RowIndex].Value.ToString(); this.textBox2.Text = this.dgvPatType[medcode.Name, this.dgvPatType.CurrentCell.RowIndex].Value.ToString(); this.checkBox1.Checked = this.dgvPatType[mz_flag.Name, this.dgvPatType.CurrentCell.RowIndex].Value.ToString() == "1" ? true : false; this.checkBox2.Checked = this.dgvPatType[zy_flag.Name, this.dgvPatType.CurrentCell.RowIndex].Value.ToString() == "1" ? true : false; this.checkBox3.Checked = this.dgvPatType[del_flag.Name, this.dgvPatType.CurrentCell.RowIndex].Value.ToString() == "1" ? true : false; patcode = this.dgvPatType[code.Name, this.dgvPatType.CurrentCell.RowIndex].Value.ToString(); this.dgvBigItem.AutoGenerateColumns = false; this.dgvItemMx.AutoGenerateColumns = false; this.dgvBigItem.DataSource = OP_Favorable.GetItemFavorData(patcode); DataTable dt = OP_Favorable.GetItemMXFavorData(patcode); this.dgvItemMx.DataSource = OP_Favorable.GetItemMXFavorItemName(dt, dtBaseItem, dtGroupItem, dtDrug); } }