コード例 #1
0
        /// <summary>
        /// 根据ID获得用户实体类
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public GI_UserInfo GetInfoById(string userid)
        {
            GI_UserInfo info = EntityOperate <GI_UserInfo> .GetEntityById(userid, "USERID");

            //职位
            GI_CodeDict job = new CodeDictService().GetCodeDictByDictCodeAndEName(info.Job, "Job");

            info.JobName = job == null ? "" : job.DictName;
            //职称
            GI_CodeDict userPosition = new CodeDictService().GetCodeDictByDictCodeAndEName(info.UserPosition, "Position");

            info.UserPositionName = userPosition == null ? "" : userPosition.DictName;
            //职务级别
            GI_CodeDict joblevel = new CodeDictService().GetCodeDictByDictCodeAndEName(info.JobLevel, "JobLevel");

            info.JobLevelName = joblevel == null ? "" : joblevel.DictName;

            #region 科室和病区组
            List <AI_DeptInfo> userDepts = deptinfoservice.GetDeptInfoByUserId(info.UserID);
            //科室
            info.DpetList = (from u in userDepts where u.IsInpatient == 0 select u).ToList();
            //病区
            info.InpatientList = (from u in userDepts where u.IsInpatient == 1 select u).ToList();
            #endregion
            //用户医疗组
            info.MedicalList = new DoctorGroupService().GetDoctorGroupByUserId(info.UserID);

            return(info);
        }
コード例 #2
0
        /// <summary>
        /// 获取查询列表
        /// </summary>
        /// <param name="_TreeNodeFilter">过滤条件</param>
        /// <returns></returns>
        public List <GI_UserInfo> GetAll(TreeNodeFilter _TreeNodeFilter)
        {
            string filter = "1=1";

            if (!string.IsNullOrWhiteSpace(_TreeNodeFilter.ParentID))
            {
                filter += string.Format("  and ParentID='{0}'", _TreeNodeFilter.ParentID);
            }
            if (!string.IsNullOrWhiteSpace(_TreeNodeFilter.keyword))
            {
                filter += string.Format(" and (Name like '%{0}%' or SpellCode like '%{0}%') ", _TreeNodeFilter.keyword.ToUpper());
            }
            List <GI_UserInfo> list = EntityOperate <GI_UserInfo> .GetEntityList(filter, "UserId");

            if (list == null || list.Count <= 0)
            {
                return(new List <GI_UserInfo>());
            }


            list.ForEach((f) =>
            {
                f.IsCanceName   = f.IsCance != 1 ? "正常" : "作废";
                f.DpetName      = "";
                f.InpatientName = "";
                f.MedicalName   = "";
                //职位
                GI_CodeDict job = new CodeDictService().GetCodeDictByDictCodeAndEName(f.Job, "Job");
                f.JobName       = job == null ? "" : job.DictName;
                //职称
                GI_CodeDict userPosition = new CodeDictService().GetCodeDictByDictCodeAndEName(f.UserPosition, "Position");
                f.UserPositionName       = userPosition == null ? "" : userPosition.DictName;
                //职位级别
                GI_CodeDict joblevel = new CodeDictService().GetCodeDictByDictCodeAndEName(f.JobLevel, "JobLevel");
                f.JobLevelName       = joblevel == null ? "" : joblevel.DictName;

                #region 科室和病区组
                List <AI_DeptInfo> userDepts = deptinfoservice.GetDeptInfoByUserId(f.UserID);
                //科室
                f.DpetList = (from u in userDepts where u.IsInpatient == 0 select u).ToList();
                //病区
                f.InpatientList = (from u in userDepts where u.IsInpatient == 1 select u).ToList();
                #endregion
                //用户医疗组
                f.MedicalList = new DoctorGroupService().GetDoctorGroupByUserId(f.UserID);
            });
            return(list);
        }