/// <summary> /// 构造处方明细对象实例 /// </summary> /// <param name="presListType">处方明细类型</param> /// <param name="headId">处方头ID</param> /// <returns></returns> public static IBasePresList CreatePresListObject(HIS.MZDoc_BLL.Public.PresListType presListType, int headId) { switch (presListType) { case HIS.MZDoc_BLL.Public.PresListType.病人处方明细: HIS.MZDoc_BLL.Prescription prescription = new HIS.MZDoc_BLL.Prescription(); prescription.PresHeadId = headId; return(prescription); case HIS.MZDoc_BLL.Public.PresListType.处方模板明细: HIS.MZDoc_BLL.PresMouldList presMouldList = new HIS.MZDoc_BLL.PresMouldList(); presMouldList.PresMouldHeadId = headId; return(presMouldList); default: return(null); } }
/// <summary> /// 获得模板明细 /// </summary> /// <returns></returns> public DataTable GetMouldList() { string strwhere = Tables.mz_doc_presmouldlist.PRESMOULDHEADID + _oleDb.EuqalTo() + this.PresMouldHeadId + _oleDb.And() + Tables.mz_doc_presmouldlist.DELETE_BIT + _oleDb.EuqalTo() + 0 + _oleDb.OrderBy(Tables.mz_doc_presmouldlist.PRESNO, Tables.mz_doc_presmouldlist.ORDERNO); DataTable mouldListTable = BindEntity <Model.Mz_Doc_PresMouldList> .CreateInstanceDAL(_oleDb).GetList(strwhere); List <PresMouldList> mouldLists = new List <PresMouldList>(); foreach (DataRow row in mouldListTable.Rows) { PresMouldList mouldList = new PresMouldList(); mouldList = (PresMouldList)Public.Function.DataRowToObject <PresMouldList>(row); mouldList.Group_Id = 0; mouldList.LoadData(); mouldLists.Add(mouldList); } return(HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(mouldLists)); }
/// <summary> /// 获得模板内容 /// </summary> /// <returns></returns> public DataTable GetMouldContents() { int presNo = 0; int orderNo = 0; string strwhere = Tables.mz_doc_presmouldlist.PRESMOULDHEADID + _oleDb.EuqalTo() + this.PresMouldHeadId + _oleDb.And() + Tables.mz_doc_presmouldlist.DELETE_BIT + _oleDb.EuqalTo() + 0 + _oleDb.OrderBy(Tables.mz_doc_presmouldlist.PRESNO, Tables.mz_doc_presmouldlist.ORDERNO); DataTable mouldListTable = BindEntity <Model.Mz_Doc_PresMouldList> .CreateInstanceDAL(_oleDb).GetList(strwhere); List <PresMouldList> mouldLists = new List <PresMouldList>(); foreach (DataRow row in mouldListTable.Rows) { PresMouldList mouldList = new PresMouldList(); mouldList = (PresMouldList)Public.Function.DataRowToObject <PresMouldList>(row); mouldList.LoadData(); if (mouldList.PresNo != presNo) { if (presNo != 0) { PresMouldList mouldList0 = new PresMouldList(); mouldList0.Item_Name = "小计:"; mouldList0.PresNo = presNo; mouldList0.OrderNo = orderNo + 1; mouldList0.Status = HIS.MZDoc_BLL.Public.PresStatus.保存状态; mouldLists.Add(mouldList0); } //mouldList.TmpNo = Convert.ToString(++presNo); presNo++; } mouldList.Status = HIS.MZDoc_BLL.Public.PresStatus.保存状态; mouldLists.Add(mouldList); orderNo = mouldList.OrderNo; } if (presNo != 0) { PresMouldList mouldList0 = new PresMouldList(); mouldList0.Item_Name = "小计:"; mouldList0.PresNo = presNo; mouldList0.OrderNo = orderNo + 1; mouldList0.Status = HIS.MZDoc_BLL.Public.PresStatus.保存状态; mouldLists.Add(mouldList0); } return(HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(mouldLists)); }