コード例 #1
0
 /// <summary>
 /// 检查病人当前科室与医生科室(包含权限科室)是否一致
 /// </summary>
 /// <auth>Yanqiao.Cai</auth>
 /// <date>2013-03-01</date>
 /// <param name="noofinpat">首页序号</param>
 /// <returns></returns>
 private string CheckIfCurrentDept(int noofinpat)
 {
     try
     {
         DataTable inpDt = DS_SqlService.GetInpatientByID(noofinpat, 2);
         if (null == inpDt || inpDt.Rows.Count == 0)
         {
             return("该病人不存在,请刷新数据重试。");
         }
         string dept = null == inpDt.Rows[0]["outhosdept"] ? "" : inpDt.Rows[0]["outhosdept"].ToString().Trim();
         if (dept != DS_Common.currentUser.CurrentDeptId)
         {//该病人已转科
             if (string.IsNullOrEmpty(dept.Trim()))
             {
                 return("该病人所属科室异常,请联系管理员。");
             }
             string          deptName = DS_BaseService.GetDeptNameByID(dept);
             List <string[]> list     = DS_BaseService.GetDeptAndWardInRight(DS_Common.currentUser.Id);
             if (null != list && list.Count > 0 && list.Any(p => p[0] == dept))
             {//转科后科室在医生权限范围内
                 return("该病人已转至 " + deptName + "(" + dept + ")" + ",请切换科室。");
             }
             else
             {
                 return("该病人已转至 " + deptName + "(" + dept + ")" + ",您无权操作。");
             }
         }
         return(string.Empty);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }