示例#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>
        /// <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();
            }
        }