private void button2_Click(object sender, EventArgs e) { DataTable dt = dal.GetYongYaoBag(this.cmbYB.Text.Trim()); for (int i = 0; i < dt.Rows.Count; i++) { if (sss.Count < 11 || (sss.Count == 11 && sss.Contains(dt.Rows[i]["ypname"].ToString()))) { int m = 0; adims_MODEL.mzyt yt1 = new adims_MODEL.mzyt(); yt1.Ytname = dt.Rows[i]["ypname"].ToString(); yt1.Yl = Convert.ToDouble(dt.Rows[i]["yl"]); yt1.Dw = Convert.ToString(dt.Rows[i]["dw"]); m = bll.addZTB(mzjldid, yt1); if (m > 0 && !sss.Contains(yt1.Ytname)) { sss.Add(yt1.Ytname); datagridBind(); } } else { MessageBox.Show("镇痛药标记数超标," + dt.Rows[i]["ypname"].ToString() + " 未添加成功!"); } } }
private void button1_Click(object sender, EventArgs e) { if (sss.Count < 20 || (sss.Count == 20 && sss.Contains(tbName.Text.Trim()))) { if (string.IsNullOrEmpty(tbName.Text.Trim())) { MessageBox.Show("药名称不能为空!"); tbName.Focus(); return; } else if (string.IsNullOrEmpty(tbYL.Text.Trim())) { MessageBox.Show("用量不能为空!"); tbYL.Focus(); return; } else { int m = 0; adims_MODEL.mzyt yt1 = new adims_MODEL.mzyt(); yt1.Ytname = tbName.Text.Trim(); yt1.Yl = Convert.ToDouble(tbYL.Text.Trim()); yt1.Dw = comboBox2.Text.Trim(); yt1.Yyfs = cmbYYFS.Text.Trim(); yt1.Cxyy = cbCXYY.Checked; yt1.Sysj = DateTime.Now; if (cbCXYY.Checked) { yt1.Bz = 1; m = bll.addyt1(mzjldID, yt1); } else { yt1.Bz = 2; yt1.Jssj = yt1.Sysj; m = bll.addyt2(mzjldID, yt1); } if (m > 0) { tbName.Text = ""; BindYdyList(); } else { MessageBox.Show(yt1.Ytname + "—添加失败请重试!"); } } } else { MessageBox.Show("全麻药区域标记数超标,请添加到其他用药。"); } }
private void button1_Click(object sender, EventArgs e) { if (sss.Count < 11 || (sss.Count == 11 && sss.Contains(tbName.Text.Trim()))) { if (tbYL.Text.Trim().ToDouble() <= 0) { MessageBox.Show("用量必须大于0"); return; } if (tbName.Text.Trim() == "") { MessageBox.Show("用量或诱导药名称不能为空"); return; } int m = 0; adims_MODEL.mzyt yt1 = new adims_MODEL.mzyt(); yt1.Ytname = tbName.Text.Trim(); yt1.Yl = tbYL.Text.Trim().ToDouble(); yt1.Dw = comboBox2.Text.Trim(); yt1.Yyfs = cmbYYFS.Text.Trim(); yt1.Cxyy = cbCXYY.Checked; yt1.Sysj = DateTime.Now; if (cbCXYY.Checked) { yt1.Bz = 1; yt1.Dw = yt1.Dw; m = bll.addyt1(mzjldID, yt1); } else { yt1.Bz = 2; yt1.Jssj = yt1.Sysj; m = bll.addyt2(mzjldID, yt1); } if (m > 0) { BindYdyList(); } } else { MessageBox.Show("诱导药标记数超标,请添加到特殊用药"); } }
private void btnBagUse_Click(object sender, EventArgs e) { DataTable dt = dal.GetYongYaoBag(this.cmbBagName.Text.Trim()); for (int i = 0; i < dt.Rows.Count; i++) { if (sss.Count < 20 || (sss.Count == 20 && sss.Contains(dt.Rows[i]["ypname"].ToString()))) { int m = 0; adims_MODEL.mzyt yt1 = new adims_MODEL.mzyt(); yt1.Ytname = dt.Rows[i]["ypname"].ToString(); yt1.Yl = Convert.ToDouble(dt.Rows[i]["yl"]); yt1.Dw = Convert.ToString(dt.Rows[i]["dw"]); yt1.Yyfs = Convert.ToString(dt.Rows[i]["zrff"]); int cxyy = Convert.ToInt32(dt.Rows[i]["cxyy"]); yt1.Sysj = DateTime.Now; if (cxyy == 1) { yt1.Cxyy = true; yt1.Bz = 1; m = bll.addyt1(mzjldID, yt1); } else { yt1.Cxyy = false; yt1.Bz = 2; yt1.Jssj = yt1.Sysj; m = bll.addyt2(mzjldID, yt1); } if (m > 0 && !sss.Contains(yt1.Ytname)) { sss.Add(yt1.Ytname); } } else { MessageBox.Show("全麻药区域标记数超标," + dt.Rows[i]["ypname"].ToString() + " 未添加成功!"); } } BindYdyList(); }