/// <summary> /// 医嘱冲正(单条冲正及数量冲正) /// </summary> private void btnsinglecanfee() { int preorderid; DateTime datetime; bool cancelresult; List <DateTime> datelist = new List <DateTime>(); List <int> canorderlist = new List <int>(); if (radiobtnsingle.Checked == true) { for (int rownum = 0; rownum < dtgrdaccount.Rows.Count; rownum++) { if (Convert.ToBoolean(dtgrdaccount[dataGridViewCheckBoxColumn1.Name, rownum].Value) == true) { int flag = Convert.ToInt32(dtgrdaccount[dataGridViewTextBoxColumn10.Name, rownum].Value.ToString()); if (flag == 0) { datetime = Convert.ToDateTime(dtgrdaccount[dataGridViewTextBoxColumn4.Name, rownum].Value.ToString()); int presorderid = Convert.ToInt32(dtgrdaccount[dataGridViewTextBoxColumn3.Name, rownum].Value.ToString()); datelist.Add(datetime); canorderlist.Add(presorderid); } else { MessageBox.Show("该条费用不能进行冲正操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } HIS.MedicalConfir_BLL.MedicalInterface iConfir = new HIS.MedicalConfir_BLL.InterfaceOperation(); int type = Convert.ToInt32(dtgrdaccount["prestype", rownum].Value.ToString()); if (type > 3) { if (iConfir.HasMedical() && iConfir.IsConfirmed(Convert.ToInt32(dtgrdaccount[dataGridViewTextBoxColumn3.Name, rownum].Value.ToString()), HIS.MedicalConfir_BLL.ConfirType.住院)) { MessageBox.Show("该费用已确费,不能冲正"); return; } } } } if (canorderlist.Count == 0 || canorderlist.Count > 1) { MessageBox.Show("请选择一条医嘱项目进行冲正操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { decimal amount = op_order.getspecsingleresult(canorderlist, Convert.ToInt32(_currentDept.DeptID)); if (amount > 0) { cancelresult = op_order.canamountaccount(patlistid, canorderlist, datelist, amount); } else { MessageBox.Show("该条医嘱不能再次进行冲正操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } if (cancelresult == true) { MessageBox.Show("您的医嘱费用已成功冲正", "提示", MessageBoxButtons.OK); DataTable dt = op_order.getCanaccount(presorderidlist); dtgrdaccount.DataSource = dt; } else { MessageBox.Show("您的费用冲正操作失败", "提示", MessageBoxButtons.OK); } } } else//数量冲正 { for (int rownum = 0; rownum < dtgrdaccount.Rows.Count; rownum++) { if (Convert.ToBoolean(dtgrdaccount[dataGridViewCheckBoxColumn1.Name, rownum].Value) == true) { int flag = Convert.ToInt32(dtgrdaccount[dataGridViewTextBoxColumn10.Name, rownum].Value.ToString()); if (flag == 0) { datetime = Convert.ToDateTime(dtgrdaccount[dataGridViewTextBoxColumn4.Name, rownum].Value.ToString()); int presorderid = Convert.ToInt32(dtgrdaccount[dataGridViewTextBoxColumn3.Name, rownum].Value.ToString()); datelist.Add(datetime); canorderlist.Add(presorderid); } else { MessageBox.Show("该条费用不能进行冲正操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } } } if (canorderlist.Count == 0 || canorderlist.Count > 1) { MessageBox.Show("请选择一条医嘱项目进行冲正操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { loadfrmamount(); bool result = op_order.getspecamountresult(canorderlist, amount, Convert.ToInt32(_currentDept.DeptID)); if (result) { if (amount == 0) { return; } cancelresult = op_order.canamountaccount(patlistid, canorderlist, datelist, amount); } else { MessageBox.Show("该条医嘱冲正数量总和已超出冲正范围!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } if (cancelresult == true) { MessageBox.Show("您的医嘱费用已成功冲正", "提示", MessageBoxButtons.OK); DataTable dt = op_order.getCanaccount(presorderidlist); dtgrdaccount.DataSource = dt; } else { MessageBox.Show("您的费用冲正操作失败", "提示", MessageBoxButtons.OK); } } } }
/// <summary> /// 成组冲正 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btncanfee_Click(object sender, EventArgs e) { if (op_order.IsPatOut(patlistid)) { MessageBox.Show("该病人已结算,不能冲正"); return; } if (radiobtnsingle.Checked == false && radiobtnamount.Checked == false) { int preorderid; DateTime datetime; List <DateTime> datelist = new List <DateTime>(); List <int> canorderlist = new List <int>(); for (int rownum = 0; rownum < dtgrdaccount.Rows.Count; rownum++) { if (Convert.ToBoolean(dtgrdaccount[dataGridViewCheckBoxColumn1.Name, rownum].Value) == true) { int flag = Convert.ToInt32(dtgrdaccount[dataGridViewTextBoxColumn10.Name, rownum].Value.ToString()); if (flag == 0) { datetime = Convert.ToDateTime(dtgrdaccount[dataGridViewTextBoxColumn4.Name, rownum].Value.ToString()); int presorderid = Convert.ToInt32(dtgrdaccount[dataGridViewTextBoxColumn3.Name, rownum].Value.ToString()); datelist.Add(datetime); canorderlist.Add(presorderid); } else { MessageBox.Show("该组费用不能进行冲正操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } int type = Convert.ToInt32(dtgrdaccount["prestype", rownum].Value.ToString()); if (type > 3) { HIS.MedicalConfir_BLL.MedicalInterface iConfir = new HIS.MedicalConfir_BLL.InterfaceOperation(); if (iConfir.HasMedical() && iConfir.IsConfirmed(Convert.ToInt32(dtgrdaccount[dataGridViewTextBoxColumn3.Name, rownum].Value.ToString()), HIS.MedicalConfir_BLL.ConfirType.住院)) { MessageBox.Show("该费用已确费,不能冲正"); return; } } } } if (datelist.Count == 0) { MessageBox.Show("您还未选择冲正医嘱,请选择医嘱后再进行冲正操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { bool result = op_order.IsGroupCancelFee(canorderlist, Convert.ToInt32(_currentDept.DeptID)); if (result) { if (op_order.canaccount(patlistid, canorderlist, datelist)) { MessageBox.Show("您的医嘱费用已成功冲正", "提示", MessageBoxButtons.OK); DataTable dt = op_order.getCanaccount(presorderidlist); dtgrdaccount.DataSource = dt; } else { MessageBox.Show("您的费用冲正操作失败", "提示", MessageBoxButtons.OK); } } else { MessageBox.Show("该组医嘱不能进行成组冲正操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } } } else { btnsinglecanfee(); } }