/// <summary> /// 修改所选项目信息 /// </summary> public void ChangeMedicalItem() { BaseMedical medicalApply = _view.CurrentMedicalApply; if (medicalApply.Status == HIS.MZDoc_BLL.Public.PresStatus.保存状态) { medicalApply.Status = HIS.MZDoc_BLL.Public.PresStatus.修改状态; } if (_view.ApplyRowIndex >= 0 && (medicalApply.Status == HIS.MZDoc_BLL.Public.PresStatus.新建状态 || medicalApply.Status == HIS.MZDoc_BLL.Public.PresStatus.修改状态)) { SetCellColor(_view.ApplyRowIndex, -1); _view.SelecedMecicalItems.Rows[_view.ApplyRowIndex].ItemArray = HIS.MZDoc_BLL.Public.Function.ObjectToDataRow(medicalApply).ItemArray; } }
/// <summary> /// 显示已选项目列表 /// </summary> public void SelectMedicalItem() { DataTable table = _view.SelecedMecicalItems.Copy(); for (int index = 0; index < table.Rows.Count; index++) { if ((HIS.MZDoc_BLL.Public.PresStatus)table.Rows[index]["Status"] == HIS.MZDoc_BLL.Public.PresStatus.新建状态) { bool isExsit = false; foreach (HIS.MZDoc_BLL.Medical_Order_Item item in _view.CurrentMecicalItems) { if (Convert.ToInt32(table.Rows[index]["Item_Id"]) == item.Order_Id) { isExsit = true; break; } } if (!isExsit) { table.Rows[index]["Status"] = HIS.MZDoc_BLL.Public.PresStatus.除状态; } } } foreach (HIS.MZDoc_BLL.Medical_Order_Item item in _view.CurrentMecicalItems) { bool isExsit = false; for (int index = 0; index < table.Rows.Count; index++) { if ((HIS.MZDoc_BLL.Public.PresStatus)table.Rows[index]["Status"] == HIS.MZDoc_BLL.Public.PresStatus.新建状态) { if (Convert.ToInt32(table.Rows[index]["Item_Id"]) == item.Order_Id) { isExsit = true; break; } } } if (!isExsit) { BaseMedical medical = MedicalApplyFactory.CreateMedicalApplyObject(_view.CurrentApplyType); medical.CreateApply(item); DataRow row = HIS.MZDoc_BLL.Public.Function.ObjectToDataRow(medical); table.Rows.Add(row.ItemArray); } } int i = 0; while (i < table.Rows.Count) { if ((HIS.MZDoc_BLL.Public.PresStatus)table.Rows[i]["Status"] == HIS.MZDoc_BLL.Public.PresStatus.除状态) { table.Rows.RemoveAt(i); } else { i++; } } _view.SelecedMecicalItems = table; if (table.Rows.Count > 0) { _view.ApplyRowIndex = table.Rows.Count - 1; } for (int index = 0; index < _view.SelecedMecicalItems.Rows.Count; index++) { SetCellColor(index, -1); } ShowItemMoneyStatus(); }