Beispiel #1
0
        string GetAdviceTypeID(string ModelName)
        {
            List <AdviceType> list = AdviceTypeHelper.GetAdviceTypes();

            foreach (AdviceType advicetype in list)
            {
                if (advicetype.ModelName == ModelName)
                {
                    return(advicetype.ID);
                }
            }
            return(String.Empty);
        }
Beispiel #2
0
        void BindingTypeData()
        {
            List <AdviceType> list = AdviceTypeHelper.GetAdviceTypes();

            if (list == null)
            {
                return;
            }
            foreach (AdviceType adviceType in list)
            {
                string   name  = adviceType.Title;
                string   value = adviceType.ID;
                ListItem item  = new ListItem(name, value);
                MenuDropDownList.Items.Add(item);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 绑定反馈类别
        /// </summary>
        void BindAdvice()
        {
            AdviceTypeDropDownList.Items.Clear();
            List <AdviceType> adviceType = AdviceTypeHelper.GetAdviceTypes();

            if (adviceType != null)
            {
                for (int i = 0; i < adviceType.Count; i++)
                {
                    if (adviceType[i].MailMode != "")
                    {
                        string   name  = adviceType[i].Title;
                        string   value = adviceType[i].ID;
                        ListItem item  = new ListItem(name, value);
                        AdviceTypeDropDownList.Items.Add(item);
                    }
                }
            }
        }
Beispiel #4
0
        void BindAdvice()
        {
            AdviceTypeDropDownList.Items.Clear();
            List <AdviceType> adviceType = AdviceTypeHelper.GetAdviceTypes();

            AdviceTypeDropDownList.Items.Add("=====切换到其他模型=====");
            if (adviceType != null)
            {
                for (int i = 0; i < adviceType.Count; i++)
                {
                    if (adviceType[i].MailMode != "")
                    {
                        string   name  = adviceType[i].Title;
                        string   value = We7Helper.AddParamToUrl(Request.RawUrl, "adviceTypeID", adviceType[i].ID);
                        ListItem item  = new ListItem(name, value);
                        AdviceTypeDropDownList.Items.Add(item);
                    }
                }
            }
            AdviceTypeDropDownList.Visible = true;
        }
        /// <summary>
        /// 反馈信息按反馈模型统计(AdviceType表)
        /// 统计标准为Advice表State = (int)AdviceState.Finished
        /// </summary>
        protected void AdviceModuleStatistics()
        {
            //1.获取所有的反馈模型 adTypeList
            List <AdviceType> adTypeList = new List <AdviceType>();

            adTypeList = AdviceTypeHelper.GetAdviceTypes();

            if (adTypeList != null)
            {
                //翻页控件属性赋值
                if (AdviceReplyStatisticsPager.Count < 0)
                {
                    AdviceReplyStatisticsPager.PageIndex = 0;
                }
                AdviceReplyStatisticsPager.FreshMyself();
                AdviceReplyStatisticsPager.RecorderCount = adTypeList.Count;
                if (AdviceReplyStatisticsPager.RecorderCount < 1)
                {
                    StatisticsDataGridView.DataSource = null;
                }
                else
                {
                    //反馈统计对象
                    List <AdviceRate> adRateList = new List <AdviceRate>();
                    foreach (AdviceType adType in adTypeList)
                    {
                        AdviceRate adRate = new AdviceRate();
                        if (adType != null && adType.ID != "")
                        {
                            adRate.AdviceTypeID    = CurrentQuery.AdviceTypeID = adType.ID;
                            adRate.AdviceTypeTitle = adType.Title;
                            //2.根据条件循环获取每个模型的反馈信息数据 adList
                            List <Advice> adList = AdviceHelper.GetAdviceByQuery(CurrentQuery, 0, 0);
                            adRate.AdviceCount = adList.Count;
                            for (int i = 0; i < adList.Count; i++)
                            {
                                if (adList != null && adList.Count != 0)
                                {
                                    //根据获取到的反馈信息数据给反馈统计对象赋值
                                    if (adList[i].MustHandle == 1)
                                    {
                                        adRate.HandleNumber += 1;
                                    }
                                    if (adList[i].State == (int)AdviceState.Finished)
                                    {
                                        adRate.HandleCount += 1;
                                        if (adList[i].EnumState != EnumLibrary.AdviceEnum.AdminHandle.ToString())//管理员办理的除去
                                        {
                                            adRate.NoAdminHandleCount += 1;
                                            if (adList[i].MustHandle == 1)
                                            {
                                                adRate.NotAdminMustHandleCount += 1;
                                            }
                                        }
                                    }
                                    if (adList[i].State != (int)AdviceState.Finished && adList[i].MustHandle == 1)
                                    {
                                        adRate.NoHandleCount += 1;
                                    }
                                }
                            }
                        }
                        adRate.NoHandleNumber = adRate.AdviceCount - adRate.HandleNumber;
                        int count = 0;
                        if (adRate.NoAdminHandleCount > 0 && adRate.HandleNumber > 0)
                        {
                            count = (int)(((double)adRate.NotAdminMustHandleCount / (double)adRate.HandleNumber) * 100);
                        }
                        if (count > 100)
                        {
                            count = 100;
                        }
                        adRate.HandleRate = count + "%";
                        adRateList.Add(adRate);
                    }
                    StatisticsDataGridView.DataSource = adRateList;
                }
            }
            StatisticsDataGridView.DataBind();
        }