Beispiel #1
0
 //判断是否允许延期,不超过延期限制次数,查询审核通过的管理记录数
 public static int IsCanDelay(WriteUpObject applyObject, int times)
 {
     try
     {
         //获取被延期记录是否也是延期记录,是获取记录的申请ID
         string delayid = WriteUpObject.GetApplyDelayId(applyObject.m_sApply);
         if (delayid == null || delayid.Equals(""))
         {
             return(1);
         }
         else
         {
             string sql = " select id from EMR_RECORDWRITEUP where yanqiflag = '" +
                          delayid + "'" +
                          " and status in(2,5) " +
                          " and applydocid = '" + applyObject.m_sApplyDocId + "'";
             DataSet data = DrectSoft.DSSqlHelper.DS_SqlHelper.ExecuteDataSet(sql);
             if (data.Tables[0].Rows.Count < times)
             {
                 return(1);
             }
             else
             {
                 return(0);
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
 //是否已经存在病历补写申请记录
 /// <summary>
 /// Modify by xlb 2013-05-30
 /// </summary>
 /// <param name="applyObject"></param>
 /// <returns></returns>
 public static int IsExistApply(WriteUpObject applyObject)
 {
     try
     {
         string         sql = @"select * from EMR_RECORDWRITEUP where noofinpat=@nOofinpat 
                                                        and status<2 and applydocid=@applydocId";
         SqlParameter[] sps =
         {
             new SqlParameter("@nOofinpat",  applyObject == null | applyObject.m_sNoOfInpat == null?"":applyObject.m_sNoOfInpat),
             new SqlParameter("@applydocId", applyObject == null | applyObject.m_sApplyDocId == null?"":applyObject.m_sApplyDocId)
         };
         DataSet data = DrectSoft.DSSqlHelper.DS_SqlHelper.ExecuteDataSet(sql, sps, CommandType.Text);
         if (data.Tables[0].Rows.Count > 0)
         {
             return(1);
         }
         else
         {
             return(0);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #3
0
 //延期操作:创建新的申请记录,并保存延期的原有申请ID
 public static int Delay(WriteUpObject applyObject)
 {
     try
     {
         //将原有补写申请剩余的期限加上
         int i = WriteUpObject.GetDelayedApplyTimesResidue(applyObject.m_sApply);
         applyObject.m_iApplyTimes = applyObject.m_iApplyTimes + i;
         //原有记录存在延期申请,
         string delayid = WriteUpObject.GetApplyDelayId(applyObject.m_sApply);
         if (delayid == null || delayid.Equals(""))
         {
             delayid = applyObject.m_sApply;
         }
         string         sql = @"insert into EMR_RECORDWRITEUP(noofinpat,applydocid,applycontent,applytimes,
                                                     status,yanqiflag) values(@nOofinpat,@applydocid,
                                                     @applycontent,@applytimes,@applystatus,@yanqiflag)";
         SqlParameter[] sps =
         {
             new SqlParameter("@nOofinpat",    applyObject == null | applyObject.m_sNoOfInpat == null?"":applyObject.m_sNoOfInpat),
             new SqlParameter("@applydocid",   applyObject == null | applyObject.m_sApplyDocId == null?"":applyObject.m_sApplyDocId),
             new SqlParameter("@applycontent", applyObject == null | applyObject.m_sApplyContent == null?"":applyObject.m_sApplyContent),
             new SqlParameter("@applytimes",   applyObject == null?0:applyObject.m_iApplyTimes),
             new SqlParameter("@applystatus",  applyObject.m_iStatus.ToString()),
             new SqlParameter("@yanqiflag",    delayid)
         };
         DrectSoft.DSSqlHelper.DS_SqlHelper.ExecuteNonQuery(sql, sps, CommandType.Text);
         //原有补写申请状态设置/
         return(1);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #4
0
 /// <summary>
 /// Modify by xlb 2013-05-30
 /// 拼SQL特殊字符引起异常
 /// </summary>
 /// <param name="applyObject"></param>
 public static void Edit(WriteUpObject applyObject)
 {
     try
     {
         //string sql = " update EMR_RECORDWRITEUP set applytimes =" + applyObject.m_iApplyTimes +
         //    ", applycontent = " + "'" + applyObject.m_sApplyContent + "'" +
         //     ", status = " + applyObject.m_iStatus.ToString() +
         //     " where id = " + "'" + applyObject.m_sApply + "'";
         string         sql = @"update EMR_RECORDWRITEUP set applytimes=@applyTimes,applycontent=@applyContent,
                        status=@applyStatus where id=@applyId";
         SqlParameter[] sps =
         {
             new SqlParameter("@applyTimes",   applyObject == null?0:applyObject.m_iApplyTimes),
             new SqlParameter("@applyContent", applyObject == null | applyObject.m_sApplyContent == null?"":applyObject.m_sApplyContent),
             new SqlParameter("@applyStatus",  applyObject == null?0:applyObject.m_iStatus),
             new SqlParameter("@applyId",      applyObject == null | applyObject.m_sApply == null?"":applyObject.m_sApply)
         };
         DrectSoft.DSSqlHelper.DS_SqlHelper.ExecuteNonQuery(sql, sps, CommandType.Text);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }