示例#1
0
        /// <summary>
        /// 生成所有的TABLE
        /// </summary>
        protected void GetAllTableHtml()
        {
            StringBuilder sb = new StringBuilder();
            //传入的tab 序列值
            int tabindex = 0;

            if (QuDao)
            {
                var channels = HeadControl1.Channel1.ChannelValues;
                //形成tablehtml
                for (int j = 0; j < ListAll.Count; j++)
                {
                    string plat = ((MobileOption)ListAll[j][0].Platform).GetDescription();
                    if (plat == "None")
                    {
                        plat = "不区分平台";
                    }

                    TabStr.Add(SelectedSofts.FirstOrDefault(a => a.ID == ListAll[j][0].SoftId).Name + "_" + plat + "_" + channels[QuDaoList[j]].ChannelText);
                    sb.Append(GetOneTableHtml(ListAll[j], tabindex));
                    tabindex++;
                }
            }
            else
            {
                //形成tablehtml
                for (int j = 0; j < RealSoftLine.Count; j++)
                {
                    if (ListAll[j].Count != 0)
                    {
                        string plat = ((MobileOption)ListAll[j][0].Platform).GetDescription();
                        if (plat == "None")
                        {
                            plat = "不区分平台";
                        }
                        TabStr.Add(SelectedSofts.FirstOrDefault(a => a.ID == ListAll[j][0].SoftId).Name + "_" + plat);
                        sb.Append(GetOneTableHtml(ListAll[j], tabindex));
                        tabindex++;
                    }
                }
            }
            TableStr = sb.ToString();
        }
示例#2
0
        /// <summary>
        /// 形成每一个tab
        /// </summary>
        /// <param name="orderUsers"></param>
        /// <param name="tableindex"></param>
        /// <returns></returns>
        protected string GetOneTableHtml(List <SoftUser> users, int tableindex)
        {
            List <SoftUser> orderUsers = users.OrderByDescending(p => p.StatDate).ToList();
            var             channels   = HeadControl1.Channel1.ChannelValues;
            string          tableName  = string.Empty;

            if (QuDao)
            {
                tableName = orderUsers[0].SoftId + "_" + orderUsers[0].Platform + "_" + (int)Period + "_" + BeginTime.ToShortDateString() + "_" + EndTime.ToShortDateString() + "_"
                            + channels[QuDaoList[tableindex]].ChannelValue + "_" + (int)channels[QuDaoList[tableindex]].ChannelType;
            }
            else
            {
                tableName = orderUsers[0].SoftId + "_" + orderUsers[0].Platform + "_" + (int)Period + "_" + BeginTime.ToShortDateString() + "_" + EndTime.ToShortDateString() + "_" + "-1" + "_" + "-1";
            }
            //是否是内部软件
            bool isInternalSoft = SelectedSofts.FirstOrDefault(a => a.SoftType == SoftTypeOptions.InternalSoft && a.ID == orderUsers[0].SoftId) != null;

            return(TableTemplateHelper.BuildStatUsersTable(orderUsers[0].SoftId, (MobileOption)orderUsers[0].Platform, isInternalSoft, QuDao, Period, "new", false, orderUsers, false, tableindex, tableName));
        }