/// <summary> /// 获取健康专员列表 SYF 20151022 /// </summary> /// <param name="pclsCache"></param> /// <returns></returns> public List<HealthCoachList> GetHealthCoachList(DataConnection pclsCache) { List<HealthCoachList> list = new List<HealthCoachList>(); List<ActiveUser> list1 = new List<ActiveUser>(); GetDoctorInfoDetail list2 = new GetDoctorInfoDetail(); string moudlecodes = ""; string[] moudlecode = null; //string DoctorId = ""; try { list1 = GetActiveUserByRole(pclsCache, "HealthCoach");//根据角色获取已激活的用户 if (list1 != null) { for (int i = 0; i < list1.Count; i++) { DoctorInfo dcf = new DoctorInfo(); HealthCoachList hcf = new HealthCoachList(); //一次循环取一个健康专员的信息 // DoctorId = list1[i].UserId; dcf = new UsersMethod().GetDoctorInfo(pclsCache, list1[i].UserId);//获取基本信息 hcf.healthCoachID = list1[i].UserId; hcf.name = ""; hcf.sex = ""; hcf.age = ""; if (dcf != null) { hcf.name = dcf.DoctorName; hcf.sex = dcf.Gender; hcf.age = Convert.ToString(new UsersMethod().GetAgeByBirthDay(pclsCache, Convert.ToInt32(dcf.Birthday))); } moudlecodes = new UsersMethod().GetModuleByDoctorId(pclsCache, list1[i].UserId); if (moudlecodes != null) { moudlecode = moudlecodes.Split(new char[] { '_' }); for (int k = 0; k < moudlecode.Length; k++) { if (k == 0) { hcf.module = new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]); } else { hcf.module = hcf.module + "/" + new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]); } } } list2 = new UsersMethod().GetDoctorInfoDetail(pclsCache, list1[i].UserId); if (list2 != null) { hcf.imageURL = list2.PhotoAddress; hcf.score = Math.Round(Convert.ToDouble(list2.GeneralScore),1).ToString(); //hcf.score = list2.GeneralScore; //hcf.score = Double.Parse(hcf.score).ToString("F1"); } list.Add(hcf); } } return list; } catch (Exception ex) { HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UserMethod.GetHealthCoachList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace); return null; } finally { pclsCache.DisConnect(); } }
/// <summary> /// 获取健康专员列表 SYF 20151022 /// </summary> /// <param name="pclsCache"></param> /// <returns></returns> public List<HealthCoachList> GetHealthCoachList(DataConnection pclsCache) { List<HealthCoachList> list = new List<HealthCoachList>(); List<ActiveUser> list1 = new List<ActiveUser>(); List<CategoryByDoctorId> list2 = new List<CategoryByDoctorId>(); string moudlecodes = ""; string[] moudlecode = null; //string DoctorId = ""; try { list1 = GetActiveUserByRole(pclsCache, "HealthCoach");//根据角色获取已激活的用户 if (list1 != null) { for (int i = 0; i < list1.Count; i++) { DoctorInfo dcf = new DoctorInfo(); HealthCoachList hcf = new HealthCoachList(); //一次循环取一个健康专员的信息 // DoctorId = list1[i].UserId; dcf = new UsersMethod().GetDoctorInfo(pclsCache, list1[i].UserId);//获取基本信息 hcf.healthCoachID = list1[i].UserId; hcf.name = ""; hcf.sex = ""; hcf.age = ""; if (dcf != null) { hcf.name = dcf.DoctorName; hcf.sex = dcf.Gender; hcf.age = Convert.ToString(new UsersMethod().GetAgeByBirthDay(pclsCache, Convert.ToInt32(dcf.Birthday))); } moudlecodes = new UsersMethod().GetModuleByDoctorId(pclsCache, list1[i].UserId); if (moudlecodes != null) { moudlecode = moudlecodes.Split(new char[] { '_' }); for (int k = 0; k < moudlecode.Length; k++) { if (k == 0) { hcf.module = new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]); } else { hcf.module = hcf.module + "/" + new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]); } } } list2 = new UsersMethod().GetCategoryByDoctorId(pclsCache, list1[i].UserId); //获取某个健康专员的所有CategoryCode信息 if (list2 != null) { #region for (int j = 0; j < list2.Count; j++) { if ((list2[j].CategoryCode == "Contact") && (list2[j].ItemCode == "Contact001_4")) { hcf.imageURL = list2[j].Value; } //获取头像 else if ((list2[j].CategoryCode == "Score") && (list2[j].ItemCode == "Score_1")) { hcf.score = list2[j].Value; } //获取该专员总体评分 } #endregion } list.Add(hcf); } } return list; } catch (Exception ex) { HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UserMethod.GetHealthCoachList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace); return null; } finally { pclsCache.DisConnect(); } }