/// <summary> /// 取消删除医嘱时的操作和条件控制 /// </summary> /// <param name="orders"></param> /// <returns></returns> public bool DeleteOrder(HIS.Model.ZY_PatList zy_Patlist, int rowindex, int sign, int deptid, int employid, out bool IsOut) { List <HIS.Model.ZY_DOC_ORDERRECORD> orders = DeleteDeal.DeleteOrder(recordsSon, zy_Patlist, rowindex, sign, deptid, employid, out IsOut); if (orders == null) { return(true); } try { oleDb.BeginTransaction(); string strsql = ""; string strwhere = ""; for (int i = 0; i < orders.Count; i++) { //if (orders[i].ORDER_DOC != employid) //* 20100603.1.07 医生删除时,限制只能删除本医生开的医嘱 //{ // string docname = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.GetUserName(orders[i].ORDER_DOC.ToString()); // throw new Exception("" + orders[i].ORDER_CONTENT + "是由" + docname + "开的医嘱,只能由" + docname + "删除!"); //} strsql = Tables.zy_doc_orderrecord.DELETE_FLAG + oleDb.EuqalTo() + 1; strwhere = Tables.zy_doc_orderrecord.STATUS_FALG + oleDb.LessThan() + 2 + oleDb.And() + Tables.zy_doc_orderrecord.ORDER_ID + oleDb.EuqalTo() + orders[i].ORDER_ID; BindEntity <HIS.Model.ZY_DOC_ORDERRECORD> .CreateInstanceDAL(oleDb).Update(strwhere, strsql); } oleDb.CommitTransaction(); return(true); } catch (System.Exception e) { oleDb.RollbackTransaction(); throw new Exception(e.Message); } }
/// <summary> /// 出院,死亡医嘱,转科医嘱删除 /// </summary> /// <param name="records"></param> /// <param name="rowindex"></param> /// <param name="zy_Patlist"></param> /// <param name="deptid"></param> /// <param name="flag"></param> /// <param name="sign"></param> /// <returns></returns> private static List <HIS.Model.ZY_DOC_ORDERRECORD> OutDelete(List <HIS.Model.zy_doc_orderrecord_son> records, int rowindex, HIS.Model.ZY_PatList zy_Patlist, int deptid, int emploeeid, int flag, int sign) { if (sign == 0 || records[rowindex].ITEM_TYPE == 10) { records[rowindex].DELETE_FLAG = 1; if (flag == 2) { LeaveDeath leave = new LeaveDeath(); if (leave.updatePatType(zy_Patlist.PatListID, 0, deptid, records[rowindex])) { return(null); } } if (flag == 1) { TurnDept turndept = new TurnDept(); if (turndept.DelTurn(zy_Patlist.PatListID, Convert.ToInt32(zy_Patlist.CurrDeptCode), emploeeid, records[rowindex])) { return(null); } } if (flag == 0) { return(DeleteOneOrder(records, zy_Patlist, rowindex)); } } if (sign == 1 && records[rowindex].ITEM_TYPE != 10) { records[rowindex].DELETE_FLAG = 1; return(DeleteDeal.DeleteGroupOrder(records, rowindex)); } return(null); }