예제 #1
0
        /// <summary>
        /// 获取某专员相关信息 SYF 20151022
        /// </summary>
        /// <param name="pclsCache"></param>
        /// <param name="HealthCoachID"></param>
        /// <returns></returns>
        public HealthCoachInfo GetHealthCoachInfo(DataConnection pclsCache, string HealthCoachID)
        {
            HealthCoachInfo ret = new HealthCoachInfo();
            try
            {
                DoctorInfo ret1 = GetDoctorInfo(pclsCache, HealthCoachID);//获取基本信息
                ret.name = "";
                ret.sex = "";
                ret.age = "";
                if (ret1 != null)
                {
                    ret.name = ret1.DoctorName;
                    ret.sex = ret1.Gender;
                    ret.age = Convert.ToString(new UsersMethod().GetAgeByBirthDay(pclsCache, Convert.ToInt32(ret1.Birthday)));
                }
                string moudlecodes = "";
                string[] moudlecode = null;
                moudlecodes = new UsersMethod().GetModuleByDoctorId(pclsCache, HealthCoachID);
                if (moudlecodes != null)
                {
                    moudlecode = moudlecodes.Split(new char[] { '_' });
                    for (int k = 0; k < moudlecode.Length; k++)
                    {
                        if (k == 0)
                        {
                            ret.module = new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]);
                        }
                        else
                        {
                            ret.module = ret.module + "/" + new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]);
                        }
                    }
                }

                GetDoctorInfoDetail ret2 = new GetDoctorInfoDetail();
                ret2 = new UsersMethod().GetDoctorInfoDetail(pclsCache, HealthCoachID);
                if (ret2 != null)
                {                   
                    ret.imageURL = ret2.PhotoAddress;
                    ret.generalscore = Math.Round(Convert.ToDouble(ret2.GeneralScore), 1).ToString(); 
                    //ret.generalscore = Double.Parse(ret2.GeneralScore).ToString("F1");
                    ret.activityDegree = ret2.ActivityDegree;
                    ret.generalComment = ret2.GeneralComment;
                    ret.commentNum = ret2.commentNum;
                    ret.Description = ret2.Description;
                    ret.UnitName = ret2.UnitName;
                    ret.UnitCode = ret2.UnitCode;
                    ret.Dept = ret2.DeptName;
                    ret.DeptCode = ret2.DeptCode;
                    ret.JobTitle = ret2.JobTitle;
                    ret.Level = ret2.Level;
                    ret.AssessmentNum = ret2.AssessmentNum;
                    ret.MSGNum = ret2.MSGNum;
                    ret.AppointmentNum = ret2.AppointmentNum;
                    ret.Activedays = ret2.Activedays;

                }
                ret.PatientNum = GetPatientNumByDoctorId(pclsCache, HealthCoachID);
                //管理病人数量
                ret.OnPlanPatientNum = GetOnPlanPatientNumByDoctorId(pclsCache, HealthCoachID);
                //管理病人中有正在计划的人数量
                ret.DoneCalendarNum = 0;
                List<Calendar> ListCal = new List<Calendar>();
                ListCal = GetCalendar(pclsCache, HealthCoachID);
                if(ListCal != null)
                {
                    for (int Cali = 0; Cali < ListCal.Count; Cali++)
                    {
                        if(ListCal[Cali].Status == 2)
                        {
                            ret.DoneCalendarNum++;
                        }                        
                    }
                }
                return ret;
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.ToString(), "获取名称失败!");
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UsersMethod.GetDoctorInfo", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return null;
            }
            finally
            {
                pclsCache.DisConnect();
            }
        }
예제 #2
0
        /// <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();
            }
        }
예제 #3
0
        /// <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();
            }
        }
예제 #4
0
        /// <summary>
        /// 获取某专员相关信息 SYF 20151022
        /// </summary>
        /// <param name="pclsCache"></param>
        /// <param name="HealthCoachID"></param>
        /// <returns></returns>
        public HealthCoachInfo GetHealthCoachInfo(DataConnection pclsCache, string HealthCoachID)
        {
            HealthCoachInfo ret = new HealthCoachInfo();
            try
            {
                DoctorInfo ret1 = GetDoctorInfo(pclsCache, HealthCoachID);//获取基本信息
                ret.name = "";
                ret.sex = "";
                ret.age = "";
                if (ret1 != null)
                {
                    ret.name = ret1.DoctorName;
                    ret.sex = ret1.Gender;
                    ret.age = Convert.ToString(new UsersMethod().GetAgeByBirthDay(pclsCache, Convert.ToInt32(ret1.Birthday)));
                }
                string moudlecodes = "";
                string[] moudlecode = null;
                moudlecodes = new UsersMethod().GetModuleByDoctorId(pclsCache, HealthCoachID);
                if (moudlecodes != null)
                {
                    moudlecode = moudlecodes.Split(new char[] { '_' });
                    for (int k = 0; k < moudlecode.Length; k++)
                    {
                        if (k == 0)
                        {
                            ret.module = new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]);
                        }
                        else
                        {
                            ret.module = ret.module + "/" + new UsersMethod().GetCategoryName(pclsCache, moudlecode[k]);
                        }
                    }
                }

                List<CategoryByDoctorId> ret2 = new List<CategoryByDoctorId>();
                ret2 = new UsersMethod().GetCategoryByDoctorId(pclsCache, HealthCoachID);
                if (ret2 != null)
                {
                    #region
                    for (int j = 0; j < ret2.Count; j++)
                    {
                        if ((ret2[j].CategoryCode == "Contact") && (ret2[j].ItemCode == "Contact001_4"))
                        {
                            ret.imageURL = ret2[j].Value;
                        }
                        //获取头像
                        else if ((ret2[j].CategoryCode == "Score") && (ret2[j].ItemCode == "Score_1"))
                        {
                            ret.generalscore = ret2[j].Value;
                        }
                        //获取该专员总体评分
                        else if ((ret2[j].CategoryCode == "Score") && (ret2[j].ItemCode == "activityDegree"))
                        {
                            ret.activityDegree = ret2[j].Value;
                        }
                        //获取该专员活跃度
                        else if ((ret2[j].CategoryCode == "Score") && (ret2[j].ItemCode == "generalComment"))
                        {
                            ret.generalComment = ret2[j].Value;
                        }
                        //获取该专员整体评价
                        else if ((ret2[j].CategoryCode == "Score") && (ret2[j].ItemCode == "patientNum"))
                        {
                            ret.patientNum = ret2[j].Value;
                        }
                        //获取该专员负责病人数量
                        else if ((ret2[j].CategoryCode == "Personal") && (ret2[j].ItemCode == "Description"))
                        {
                            ret.Description = ret2[j].Value;
                        }
                        //获取该专员的简介
                    }
                    #endregion
                }
                return ret;
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.ToString(), "获取名称失败!");
                HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UsersMethod.GetDoctorInfo", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace);
                return null;
            }
            finally
            {
                pclsCache.DisConnect();
            }
        }