Exemplo n.º 1
0
        public string GetAdviceIDBySN(long sn)
        {
            int           from     = 0;
            int           count    = 1;
            string        adviceID = "";
            List <Advice> advice   = AdviceHelper.GetAdviceByQuery(CurrentQuery, from, count);

            for (int i = 0; i < advice.Count; i++)
            {
                if (advice[i] != null)
                {
                    adviceID = advice[i].TypeID;
                }
            }
            return(adviceID);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 初始化页面信息
        /// </summary>
        void LoadAdvices()
        {
            AdviceUPager.PageIndex  = PageNumber;
            AdviceUPager.ItemCount  = AdviceHelper.QueryAdviceCountByAll(CurrentQuery);
            AdviceUPager.UrlFormat  = We7Helper.AddParamToUrl(Request.RawUrl.Replace("{", "{{").Replace("}", "}}"), Keys.QRYSTR_PAGEINDEX, "{0}");
            AdviceUPager.PrefixText = "共 " + AdviceUPager.MaxPages + "  页 ·   第 " + AdviceUPager.PageIndex + "  页 · ";

            List <Advice> list = new List <Advice>();

            list = AdviceHelper.GetAdviceByQuery(CurrentQuery, AdviceUPager.Begin - 1, AdviceUPager.Count);
            AdviceType adviceType = new AdviceType();

            foreach (Advice a in list)
            {
                if (a.MustHandle > 1)
                {
                    HasMustHandle = true;
                }
                if (a.TypeID != null && a.TypeID != "")
                {
                    adviceType = AdviceTypeHelper.GetAdviceType(a.TypeID);
                    if (adviceType != null)
                    {
                        a.TypeTitle = adviceType.Title;
                    }
                }
                if (a.UserID != null && a.UserID.Length > 0)
                {
                    a.Name = AccountHelper.GetAccount(a.UserID, new string[] { "LastName" }).LastName;
                }
                if (a.Name == null || a.Name == "")
                {
                    a.Name = "匿名用户";
                }
                a.TimeNote  = GetTimeNote(a.CreateDate);
                a.AlertNote = GetAlertNote(a.ToHandleTime, adviceType.RemindDays, a.MustHandle);
            }

            AdviceGridView.DataSource = list;
            AdviceGridView.DataBind();

            BuildStateLinks();//刷新状态统计栏
        }
Exemplo n.º 3
0
        /// <summary>
        /// 初始化页面信息
        /// </summary>
        void LoadAdvices()
        {
            query = null;
            //CurrentQuery.State = (int)CurrentState;

            AdviceUPager.PageIndex  = PageNumber;
            AdviceUPager.ItemCount  = AdviceHelper.QueryAdviceCountByAll(CurrentQuery);
            AdviceUPager.UrlFormat  = We7Helper.AddParamToUrl(Request.RawUrl.Replace("{", "{{").Replace("}", "}}"), Keys.QRYSTR_PAGEINDEX, "{0}");
            AdviceUPager.PrefixText = "共 " + AdviceUPager.MaxPages + "  页 ·   第 " + AdviceUPager.PageIndex + "  页 · ";

            List <Advice> list = new List <Advice>();

            list = AdviceHelper.GetAdviceByQuery(CurrentQuery, AdviceUPager.Begin - 1, AdviceUPager.Count);
            AdviceType adviceType = new AdviceType();

            foreach (Advice a in list)
            {
                if (a.TypeID != null && a.TypeID != "")
                {
                    adviceType = AdviceTypeHelper.GetAdviceType(a.TypeID);
                    if (adviceType != null)
                    {
                        a.TypeTitle = adviceType.Title;
                    }
                }
                if (a.UserID != null && a.UserID.Length > 0)
                {
                    a.Name = AccountHelper.GetAccount(a.UserID, new string[] { "LoginName" }).LoginName;
                }
                if (a.Name == null || a.Name == "")
                {
                    a.Name = "匿名用户";
                }
            }
            AdviceGridView.DataSource = list;
            AdviceGridView.DataBind();
        }
        /// <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();
        }