/// <summary> /// 保存模板 /// </summary> /// <param name="headModel">模板头</param> /// <param name="detailModel">模板明细</param> /// <returns>true成功</returns> public bool AsSaveTmp(OPD_OMRTmpHead headModel, OPD_OMRTmpDetail detailModel) { headModel.CreateDate = DateTime.Now; //覆盖原来的 if (headModel.OMRTmpHeadID != 0) { List <OPD_OMRTmpDetail> detailList = NewObject <OPD_OMRTmpDetail>().getlist <OPD_OMRTmpDetail>("OMRTmpHeadID=" + headModel.OMRTmpHeadID); if (detailList.Count > 0) { detailModel.OMRTmpDetailID = detailList[0].OMRTmpDetailID; } } this.BindDb(headModel); int iHeadRtn = headModel.save(); detailModel.OMRTmpHeadID = headModel.OMRTmpHeadID; this.BindDb(detailModel); int iDetailRtn = detailModel.save(); if (iHeadRtn > 0 && iDetailRtn > 0) { return(true); } else { return(false); } }
/// <summary> /// 保存模板 /// </summary> /// <param name="info">模板信息</param> /// <param name="resFlag">保存成功失败标志</param> /// <returns>模板实体</returns> public OPD_OMRTmpHead SaveMouldInfo(OPD_OMRTmpHead info, out int resFlag) { this.BindDb(info); resFlag = info.save(); return(info); }