Exemple #1
0
        /// <summary>
        /// SYF 20151109
        /// </summary>
        /// <param name="pclsCache"></param>
        /// <param name="PatientId"></param>
        /// <returns></returns>
        public List<HealthCoachListByPatient> GetHealthCoachListByPatient(DataConnection pclsCache, string PatientId)
        {
            List<HealthCoachListByPatient> list = new List<HealthCoachListByPatient>();
            List<DoctorsByPatientId> list1 = new List<DoctorsByPatientId>();
            List<ModulesByPID> list2 = new List<ModulesByPID>();
            try
            {
                list2 = GetHModulesByPID(pclsCache, PatientId);

                if (list2 != null)
                {
                    for (int i = 0; i < list2.Count; i++)
                    {
                        list1 = GetDoctorsByPatientId(pclsCache, PatientId, list2[i].CategoryCode);//根据PatientId和CategoryCode取对应模块医生列表
                        if (list1 != null)
                        {
                            for (int j = 0; j < list1.Count; j++)
                            {
                                HealthCoachListByPatient lt = new HealthCoachListByPatient();
                                lt.HealthCoachID = list1[j].DoctorId;//专员Id
                                lt.Name = list1[j].DoctorName;//专员名字
                                lt.imageURL = list1[j].ImageURL;//专员照片
                                lt.CategoryCode = list2[i].CategoryCode;//负责模块编码,由输入决定
                                lt.module = list2[i].Modules;//负责模块名称,由输入决定
                                lt.MessageNo = list1[j].MessageNo;//最新消息 
                                lt.Content = list1[j].Content;
                                lt.SendDateTime = list1[j].SendDateTime;
                                lt.SendByName = list1[j].SendByName;
                                lt.Flag = list1[j].Flag;
                                lt.Count = list1[j].Count;

                                list.Add(lt);
                            }
                        }
                    }
                }
                return list;
            }
            catch (Exception ex)
            {
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UserMethod.GetCommentList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return null;
            }
            finally
            {
                pclsCache.DisConnect();
            }
        }
 public List<HealthCoachListByPatient> GetHealthCoachListByPatient(DataConnection pclsCache, string PatientId, string CategoryCode)
 {
     List<HealthCoachListByPatient> list = new List<HealthCoachListByPatient>();
     List<DoctorsByPatientId> list1 = new List<DoctorsByPatientId>();
     try
     {
         list1 = GetDoctorsByPatientId(pclsCache, PatientId, CategoryCode);//根据PatientId和CategoryCode取对应模块医生列表
         if (list1 != null)
         {
             for (int i = 0; i < list1.Count; i++)
             {
                 HealthCoachListByPatient lt = new HealthCoachListByPatient();
                 lt.HealthCoachID = list1[i].DoctorId;//专员Id
                 lt.Name = list1[i].DoctorName;//专员名字
                 lt.imageURL = new UsersMethod().GetValue(pclsCache, lt.HealthCoachID, "Contact", "Contact001_4", 1);//专员照片
                 lt.module = new UsersMethod().GetCategoryName(pclsCache, CategoryCode);//负责模块,由输入决定
                 if (lt.HealthCoachID != "")
                 {
                     lt.latestMessage = new MessageMethod().GetLatestSMS(pclsCache, lt.HealthCoachID, PatientId);//最新消息
                 }
                 list.Add(lt);
             }
         }
         return list;
     }
     catch (Exception ex)
     {
         HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UserMethod.GetCommentList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
         return null;
     }
     finally
     {
         pclsCache.DisConnect();
     }
 }