/// <summary>
        /// 添加一个病历
        /// </summary>
        /// <param name="templateInfo"></param>
        /// <returns></returns>
        /// <summary>
        public bool AddHisDetail(string strHisGid, string strTitle, string strDesc, string strDoctorGid, List <String> lstPic)
        {
            DataBaseHelper.BeginTransaction();
            try
            {
                TMedicalHisDetail detail = new TMedicalHisDetail();
                detail.DetailGid      = Guid.NewGuid().ToString();
                detail.HisID          = strHisGid;
                detail.DetailTitle    = strTitle;
                detail.DetailDescribe = strDesc;
                detail.CreateUser     = strDoctorGid;

                List <TMedicalHisDetailPic> lstDetailPic = new List <TMedicalHisDetailPic>();
                foreach (string strImgUrl in lstPic)
                {
                    TMedicalHisDetailPic detailPic = new TMedicalHisDetailPic();
                    detailPic.DetailGid = detail.DetailGid;
                    detailPic.PicUrl    = strImgUrl;
                    lstDetailPic.Add(detailPic);
                }
                Save(lstDetailPic);
                Save <TMedicalHisDetail>(detail);
                DataBaseHelper.CommitTransaction();
                return(true);
            }
            catch
            {
                //事务回滚
                DataBaseHelper.RollbackTransaction();
                return(false);
            }
        }
        /// <summary>
        /// 添加一个病历
        /// </summary>
        /// <param name="templateInfo"></param>
        /// <returns></returns>
        /// <summary>
        public bool UpdateHisDetail(string strDetailGid, string strTitle, string strDesc, string strDoctorGid, List <String> lstPic)
        {
            //开启事务
            DataBaseHelper.BeginTransaction();
            try
            {
                String   strSql = "select * from T_Medical_HisDetail where DETAIL_GID=@DETAIL_GID AND Status =1";
                ParamMap param  = ParamMap.newMap();
                param.setParameter("DETAIL_GID", strDetailGid);
                TMedicalHisDetail detail = DataBaseHelper.FindOne <TMedicalHisDetail>(strSql, param);
                if (detail != null)
                {
                    detail.DetailTitle    = strTitle != null ? strTitle : detail.DetailTitle;
                    detail.DetailDescribe = strDesc != null ? strDesc : detail.DetailDescribe;
                    detail.CreateUser     = strDoctorGid != null?strDoctorGid:detail.CreateUser;

                    String   strSql1     = "select * from T_Medical_HisDetailPic where Detail_Gid=@Detail_Gid and status =1";
                    ParamMap paramDetail = ParamMap.newMap();
                    paramDetail.setParameter("Detail_Gid", strDetailGid);
                    List <TMedicalHisDetailPic> lstDetailPic = DataBaseHelper.FindBySql <TMedicalHisDetailPic>(strSql1, paramDetail);

                    if (lstDetailPic != null && lstDetailPic.Count > 0)
                    {
                        List <String> lstDeletePic = new List <string>();
                        String        strPicUrl    = "";
                        foreach (TMedicalHisDetailPic mhp in lstDetailPic)
                        {
                            strPicUrl = "";
                            strPicUrl = mhp.PicUrl;
                            if (strPicUrl.Trim() != "")
                            {
                                lstDeletePic.Add(strPicUrl.Trim());
                            }
                        }

                        Zelo.Common.Common.ImageSave.DeletePic(lstDeletePic);
                    }
                    //Update(ttem);
                    DataBaseHelper.Remove(lstDetailPic);

                    lstDetailPic = new List <TMedicalHisDetailPic>();
                    ///提交模版下的每个动作
                    foreach (string strImgUrl in lstPic)
                    {
                        TMedicalHisDetailPic detailPic = new TMedicalHisDetailPic();
                        detailPic.DetailGid = detail.DetailGid;
                        detailPic.PicUrl    = strImgUrl;
                        lstDetailPic.Add(detailPic);
                    }
                    Update <TMedicalHisDetail>(detail);
                    Save(lstDetailPic);
                    //提交事务
                    DataBaseHelper.CommitTransaction();
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                //事务回滚
                DataBaseHelper.RollbackTransaction();
                return(false);
            }
        }