Ejemplo n.º 1
0
        protected void HtmlOut()
        {
            //Table表头在后面插入
            ReportContentHtml.Append(Company.CompanySimpleName);
            ReportContentHtml.Append(" [ 截止到:" + EndDate.ToString("d") + " ]");
            ReportContentHtml.AppendLine("</th></tr>");
            ReportContentHtml.AppendLine("</tr>");
            ReportContentHtml.AppendLine("<tr>");
            ReportContentHtml.AppendLine("<th colspan=\"3\">部门/岗位</th>");

            //岗位数组
            ArrayList postArray = new ArrayList();
            //需要再次展开的岗位
            ArrayList postExpandArray = new ArrayList();

            foreach (PostInfo Info in PostBLL.ReadParentPostListByPostId(Company.Post))
            {
                List <PostInfo> sonPostList  = PostBLL.FilterPostListByParentID(PostList, Info.PostId);
                int             sonPostCount = sonPostList.Count;
                if (sonPostCount > 1)
                {
                    postArray.Add(Info.PostId);
                    postExpandArray.Add(Info.PostId);
                    ReportContentHtml.AppendLine("<th colspan=\"" + sonPostCount.ToString() + "\">" + Info.PostName + "</th>");
                }
                else
                {
                    ReportContentHtml.AppendLine("<th rowspan=\"2\" class=\"outside\"><div class=\"inside\">" + Info.PostName + "</div></th>");
                    if (sonPostCount == 1)
                    {
                        foreach (PostInfo Item in sonPostList)
                        {
                            postArray.Add(Item.PostId);
                        }
                    }
                    else
                    {
                        postArray.Add(Info.PostId);
                    }
                }
            }

            ReportContentHtml.AppendLine("</tr>");
            ReportContentHtml.AppendLine("<tr class=\"hoverwhite\">");
            ReportContentHtml.AppendLine("<td class=\"id\">序号</td>");
            ReportContentHtml.AppendLine("<td class=\"name\">员工名称</td>");
            ReportContentHtml.AppendLine("<td class=\"post\">在职岗位</td>");
            foreach (int item in postExpandArray)
            {
                ArrayList tempArray = new ArrayList();
                foreach (PostInfo info in PostBLL.FilterPostListByParentID(PostList, item))
                {
                    ReportContentHtml.AppendLine("<td class=\"outside\"><div class=\"inside\">" + info.PostName + "</div></td>");
                    tempArray.Add(info.PostId);
                }
                int insertPos = postArray.IndexOf(item);
                postArray.RemoveAt(insertPos);
                postArray.InsertRange(insertPos, tempArray);
            }
            ReportContentHtml.AppendLine("</tr>");

            //取得列数,插入表头
            ReportContentHtml.Insert(0, "<table class=\"evaluation_sheet\"><tr><th colspan=\"" + (3 + postArray.Count) + "\">");

            int PNum = 0;
            //定义一个数组,用来存放每个人通过的岗位数
            string PassPostTotal = "|";

            UserSearchInfo userSearch = new UserSearchInfo();

            userSearch.InCompanyID   = CompanyID.ToString();
            userSearch.InStatus      = (int)UserState.Normal + "," + (int)UserState.Free;
            userSearch.InStudyPostID = PostIdCondition;
            List <UserInfo> userList = UserBLL.SearchReportUserList(userSearch);

            foreach (UserInfo user in userList)
            {
                PNum += 1;

                PostPassInfo postPassSearch = new PostPassInfo();
                postPassSearch.UserId     = user.ID;
                postPassSearch.IsRZ       = 1;
                postPassSearch.CreateDate = ShopCommon.SearchEndDate(EndDate);
                //读取通过的岗位
                string PassPost = PostPassBLL.PassPostString(postPassSearch);
                //读取岗位学完但认证没过的名单
                postPassSearch.IsRZ = 0;
                string NoPassPost = PostPassBLL.PassPostString(postPassSearch);

                string WorkPostName = string.Empty;

                //取得工作岗位
                if (string.IsNullOrEmpty(user.PostName))
                {
                    WorkPostName = PostBLL.ReadPost(user.WorkingPostID).PostName;
                }
                else
                {
                    WorkPostName = user.PostName;
                }

                ReportContentHtml.AppendLine("<tr data-style=\"data\">");
                ReportContentHtml.AppendLine("<td>" + PNum.ToString() + "</td>");
                ReportContentHtml.AppendLine("<td>" + user.RealName + "</td>");
                ReportContentHtml.AppendLine("<td>" + WorkPostName + "</td>");
                int PassPostNum = 0;
                foreach (int Item in postArray)
                {
                    if (StringHelper.CompareSingleString(PassPost, Item.ToString()))
                    {
                        PassPostNum += 1;
                        ReportContentHtml.AppendLine("<td class=\"style1\">●</td>");
                    }
                    else if (StringHelper.CompareSingleString(NoPassPost, Item.ToString()))
                    {
                        ReportContentHtml.AppendLine("<td class=\"style2\">○</td>");
                    }
                    else if (Item.ToString() == user.StudyPostID.ToString())
                    {
                        ReportContentHtml.AppendLine("<td class=\"style3\">○</td>");
                    }
                    else
                    {
                        ReportContentHtml.AppendLine("<td>&nbsp;</td>");
                    }
                }
                if (PassPostNum > 0)
                {
                    PassPostTotal += PassPostNum.ToString() + "|";
                }
                ReportContentHtml.AppendLine("</tr>");
            }
            ReportContentHtml.AppendLine("</table>");

            //统计通过几个岗位的人数
            if (PassPostTotal.Length > 1)
            {
                ReportContentHtml.AppendLine("<table class=\"evaluation_sheet count\">");
                for (int i = 1; i < postArray.Count + 1; i++)
                {
                    if (PassPostTotal.Contains("|" + i + "|"))
                    {
                        ReportContentHtml.AppendLine("<tr>");
                        ReportContentHtml.AppendLine("<td>通过" + i.ToString() + "个岗位的人数为:");
                        int PerNum = 0;
                        foreach (string Item in PassPostTotal.Split('|'))
                        {
                            if (Item == i.ToString())
                            {
                                PerNum += 1;
                            }
                        }
                        ReportContentHtml.AppendLine(PerNum.ToString() + "</td>");
                        ReportContentHtml.AppendLine("</tr>");
                    }
                }
                ReportContentHtml.AppendLine("</table>");
            }
        }
Ejemplo n.º 2
0
        //private List<PostCateInfo> ConvertToPostCate(List<PostInfo> PostList, bool ChildList)
        //{
        //    List<PostCateInfo> PostCateList = new List<PostCateInfo>();
        //    if (PostList != null)
        //    {
        //        foreach (PostInfo Info in PostList)
        //        {
        //            PostCateInfo PostCateModel = new PostCateInfo();
        //            PostCateModel.EncryptFcateID = Info.PostId.ToString();
        //            PostCateModel.Title = Info.PostName;
        //            if (ChildList) PostCateModel.ChildCourseFCateView = ConvertToPostCate(PostBLL.ReadPostList(Info.PostId), false);
        //            PostCateList.Add(PostCateModel);
        //        }
        //    }
        //    return PostCateList;
        //}

        private List <MCourseInfo> GetCourseList()
        {
            int postID   = RequestHelper.GetForm <int>("postID");
            int page     = RequestHelper.GetForm <int>("pageIndex");
            int pageSize = RequestHelper.GetForm <int>("pageSize");
            int classID  = RequestHelper.GetForm <int>("classID");

            if (pageSize <= 0)
            {
                pageSize = base.PageSize;
            }
            List <MCourseInfo> CourseList = new List <MCourseInfo>();
            int    userID          = base.UserID;
            string prepaidCourseId = BLLMTestCate.ReadPrepaidTestCate(userID);

            if (postID < 0)
            {
                postID = int.Parse(CookiesHelper.ReadCookieValue("UserStudyPostId"));
            }

            List <ProductInfo> productList      = new List <ProductInfo>();
            string             inProductID      = PostBLL.ReadPostCourseID(base.UserCompanyID, postID);
            string             passPostCourseID = string.IsNullOrEmpty(inProductID) ? "" : TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, inProductID, 1));

            inProductID = StringHelper.SubString(inProductID, passPostCourseID);
            ProductSearchInfo productSearch = new ProductSearchInfo();

            if (!string.IsNullOrEmpty(inProductID))
            {
                productSearch.InProductID = inProductID;
                productSearch.IsSale      = 1;
                if (classID > 0)
                {
                    productSearch.ClassID = "|" + classID + "|";
                }
                productSearch.OrderField = "[IsTop],[ClassID],[Sort],[ID]";
                productList = ProductBLL.SearchProductList(page, pageSize, productSearch, ref base.Count);
            }

            int pageCount = (int)Math.Ceiling((double)base.Count / pageSize);

            //加载选修课程(岗位课程罗列完成后,再加载选修)
            if ((classID < 0 || classID == 6) && (page == pageCount) && StringHelper.CompareSingleString("4,5,64", UserBLL.ReadUser(base.UserID).StudyPostID.ToString()))
            {
                productSearch.InProductID = string.Empty;
                productSearch.ClassID     = "|6|";
                productSearch.InBrandID   = base.CompanyBrandID;
                productSearch.NotLikeName = "必修";
                productSearch.IsSale      = 1;
                productList.AddRange(ProductBLL.SearchProductList(productSearch));
            }

            //加载认证考试
            if ((classID < 0 && page == 1) || classID == 4387)
            {
                PostPassInfo passpost = new PostPassInfo();
                passpost.UserId = base.UserID;
                passpost.IsRZ   = 0;

                RenZhengCateInfo rzCate = new RenZhengCateInfo();
                rzCate.InPostID = PostPassBLL.PassPostString(passpost);
                string rzProductID = RenZhengCateBLL.ReadTestCateID(rzCate);
                if (!string.IsNullOrEmpty(rzProductID))
                {
                    productSearch.InProductID = rzProductID;
                    productSearch.ClassID     = string.Empty;
                    productSearch.InBrandID   = base.CompanyBrandID;
                    productSearch.NotLikeName = string.Empty;
                    productSearch.IsSale      = 1;
                    productList.InsertRange(0, ProductBLL.SearchProductList(productSearch));
                }
            }

            //加载大课件
            if ((classID < 0 && page == 1) || classID == 5298)
            {
                productSearch.InProductID = string.Empty;
                productSearch.InBrandID   = string.Empty;
                productSearch.NotLikeName = string.Empty;
                productSearch.IsSale      = 1;
                productSearch.ClassID     = "|5298|";
                productList.InsertRange(0, ProductBLL.SearchProductList(productSearch));
            }

            //加载指定时间考试
            if (classID < 0 && page == 1)
            {
                string parentCompanyID = base.ParentCompanyID;
                if (string.IsNullOrEmpty(parentCompanyID))
                {
                    parentCompanyID = base.UserCompanyID.ToString();
                }
                else
                {
                    parentCompanyID += "," + base.UserCompanyID.ToString();
                }
                List <TestSettingInfo> specialTestList = TestSettingBLL.ReadSpecialTestList(parentCompanyID);
                if (specialTestList.Count > 0)
                {
                    string specialCourseID = TestSettingBLL.ReadSpecialTestCourseID(specialTestList);
                    if (!string.IsNullOrEmpty(specialCourseID))
                    {
                        productSearch.InProductID = specialCourseID;
                        productSearch.ClassID     = string.Empty;
                        productSearch.InBrandID   = base.CompanyBrandID;
                        productSearch.NotLikeName = string.Empty;
                        productSearch.IsSale      = 1;
                        List <ProductInfo> specialProductList = ProductBLL.SearchProductList(productSearch);
                        productList.InsertRange(0, specialProductList);
                    }
                }
            }

            //重新获取产品ID串
            inProductID      = ProductBLL.ReadProductIdStr(productList);
            passPostCourseID = string.IsNullOrEmpty(inProductID) ? "" : TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, inProductID, 1));

            //获取未通过的最新记录
            string noPassCourseID = StringHelper.SubString(inProductID, passPostCourseID);
            List <TestPaperReportInfo> noPassTestPaperList = string.IsNullOrEmpty(noPassCourseID) ? new List <TestPaperReportInfo>() : TestPaperBLL.ReadThelatestList(base.UserID, noPassCourseID);

            List <AttributeRecordInfo> attributeRecordList = AttributeRecordBLL.ReadList("5", noPassCourseID);

            foreach (ProductInfo Info in productList)
            {
                //通过的课程不用显示
                //if (!StringHelper.CompareSingleString(passPostCourseID, Info.ID.ToString()))
                {
                    TestSettingInfo testSetting = TestSettingBLL.ReadTestSetting(base.UserCompanyID, Info.ID);

                    MCourseInfo CourseModel = new MCourseInfo();
                    CourseModel.ClassID   = Info.ID.ToString();
                    CourseModel.Title     = Info.Name;
                    CourseModel.IsPass    = false;
                    CourseModel.PageCount = pageCount;
                    TestPaperReportInfo currentPaper = noPassTestPaperList.Find(delegate(TestPaperReportInfo tempPaper) { return(tempPaper.CourseID == Info.ID); });
                    if (currentPaper != null)
                    {
                        //剩余时间
                        int remainingTime = (testSetting.TestInterval - (int)(DateTime.Now - currentPaper.TestDate).TotalHours);
                        CourseModel.ValidDateShow = remainingTime > 0 ? remainingTime.ToString() : "";
                    }
                    CourseModel.OriginalPrice = Info.MarketPrice.ToString();
                    if (!string.IsNullOrEmpty(Info.ProductNumber))
                    {
                        CourseModel.IsVideo = true;
                    }

                    if (!string.IsNullOrEmpty(Info.Accessory))
                    {
                        CourseModel.IsTest = true;

                        //通过的课程不用再考
                        if (StringHelper.CompareSingleString(passPostCourseID, Info.ID.ToString()))
                        {
                            CourseModel.IsTest = false;
                        }

                        if (testSetting != null && (testSetting.TestStartTime != null || testSetting.TestEndTime != null))
                        {
                            //指定时间考试考过了就不要再考了
                            if (!string.IsNullOrEmpty(CourseModel.ValidDateShow))
                            {
                                CourseModel.IsTest = false;
                            }
                            if (DateTime.Now < testSetting.TestStartTime || DateTime.Now > testSetting.TestEndTime)
                            {
                                CourseModel.IsTest = false;
                            }
                        }
                    }
                    CourseModel.IsPostCourse    = true;
                    CourseModel.IsPrepaidCourse = StringHelper.CompareSingleString(prepaidCourseId, Info.ID.ToString());

                    //产品知识 练车剧本地址
                    {
                        CourseModel.RCUrl = AttributeRecordBLL.ReadAttributeRecord(attributeRecordList, 5, Info.ID).Value;
                        if (!string.IsNullOrEmpty(CourseModel.RCUrl))
                        {
                            CourseModel.IsRC = true;
                        }
                    }
                    CourseList.Add(CourseModel);
                }
            }
            return(CourseList);
        }
Ejemplo n.º 3
0
        protected void HtmlOut()
        {
            StringBuilder TextOut = new StringBuilder();

            //Table表头在后面插入
            TextOut.Append(CompanyModel.CompanySimpleName);
            TextOut.Append(" [ 截止到:" + endDate.ToString("d") + " ]");
            TextOut.Append("</td></tr>\r\n");
            TextOut.Append("<tr class=\"listTableHead\">\r\n");
            TextOut.Append("<td colspan=\"3\">部门/岗位</td>");
            List <PostInfo> DepartmentList = PostBLL.ReadParentPostListByPostId(CompanyModel.Post);
            //岗位数组
            ArrayList PostArray = new ArrayList();
            //需要再次展开的岗位
            ArrayList PostExpandArray = new ArrayList();

            foreach (PostInfo Info in DepartmentList)
            {
                List <PostInfo> PostList     = PostBLL.ReadPostList(Info.PostId);
                int             SonPostCount = PostList.Count;
                if (SonPostCount > 1)
                {
                    PostArray.Add(Info.PostId);
                    PostExpandArray.Add(Info.PostId);
                    TextOut.Append("<td colspan=\"" + SonPostCount.ToString() + "\">" + Info.PostName + "</td>");
                }
                else
                {
                    TextOut.Append("<td rowspan=\"2\"  style=\"width:23px;text-align:center; \"><div style=\"width:15px; margin:0px auto;\">" + Info.PostName + "</div></td>");
                    if (SonPostCount == 1)
                    {
                        foreach (PostInfo Item in PostList)
                        {
                            PostArray.Add(Item.PostId);
                        }
                    }
                    else
                    {
                        PostArray.Add(Info.PostId);
                    }
                }
            }
            DepartmentList = null;

            TextOut.Append("</tr>");
            TextOut.Append("<tr class=\"listTableMain\">");
            TextOut.Append("<td style=\"min-width:80px;\">序号</td>");
            TextOut.Append("<td style=\"min-width:60px;\">员工<br />名称</td>");
            TextOut.Append("<td style=\"min-width:200px;\">在职<br />岗位</td>");
            foreach (int Item in PostExpandArray)
            {
                ArrayList TempArray = new ArrayList();
                foreach (PostInfo Info in PostBLL.ReadPostList(Item))
                {
                    TextOut.Append("<td style=\"width:23px;text-align:center; \"><div style=\"width:15px; margin:0px auto;\">" + Info.PostName + "</div></td>");
                    TempArray.Add(Info.PostId);
                }
                int InsertPos = PostArray.IndexOf(Item);
                PostArray.RemoveAt(InsertPos);
                PostArray.InsertRange(InsertPos, TempArray);
                TempArray = null;
            }
            PostExpandArray = null;
            TextOut.Append("</tr>\r\n");

            //取得列数,插入表头
            TextOut.Insert(0, "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=left colspan=\"" + (3 + PostArray.Count) + "\"><ul style=\"margin:10px; line-height:180%;\">说明:<li>绿色代表已通过</li><li>黄色代表正在学习的岗位</li><li>紫色代表岗位课程已通过但综合认证考试未通过</li></ul></td></tr><tr class=\"listTableHead\"><td colspan=\"" + (3 + PostArray.Count) + "\">");

            int PNum = 0;
            //定义一个数组,用来存放每个人通过的岗位数
            string PassPostTotal = "|";

            endDate = endDate.AddDays(1);
            UserSearchInfo user = new UserSearchInfo();

            user.InCompanyID     = companyID.ToString();
            user.InStatus        = state;
            user.InGroupID       = groupID;
            user.InWorkingPostID = postIdCondition;
            foreach (UserInfo Info in UserBLL.SearchReportUserList(user))
            {
                PNum += 1;

                PostPassInfo PostPassModel = new PostPassInfo();
                PostPassModel.UserId     = Info.ID;
                PostPassModel.CreateDate = endDate;
                //读取通过的岗位
                string PassPost = PostPassBLL.PassPostString(PostPassModel);
                //读取岗位学完但认证没过的名单
                PostPassModel.IsRZ = 0;
                string NoPassPost = PostPassBLL.PassPostString(PostPassModel);

                string WorkingPostName = string.Empty;

                //取得工作岗位
                if (string.IsNullOrEmpty(Info.PostName))
                {
                    WorkingPostName = PostBLL.ReadPost(Info.WorkingPostID).PostName;
                }
                else
                {
                    WorkingPostName = Info.PostName;
                }

                TextOut.Append("<tr class=\"listTableMain\" data-style=\"data\">\r\n");
                TextOut.Append("<td>" + PNum.ToString() + "</td>");
                TextOut.Append("<td>" + Info.RealName + "</td>");
                TextOut.Append("<td>" + WorkingPostName + "</td>");
                int PassPostNum = 0;
                foreach (int Item in PostArray)
                {
                    if (StringHelper.CompareSingleString(PassPost, Item.ToString()))
                    {
                        PassPostNum += 1;
                        TextOut.Append("<td class=\"style1\">●</td>");
                    }
                    else if (StringHelper.CompareSingleString(NoPassPost, Item.ToString()))
                    {
                        TextOut.Append("<td class=\"style2\">○</td>");
                    }
                    else if (Item.ToString() == Info.StudyPostID.ToString())
                    {
                        TextOut.Append("<td class=\"style3\">○</td>");
                    }
                    else
                    {
                        TextOut.Append("<td>&nbsp;</td>");
                    }
                }
                if (PassPostNum > 0)
                {
                    PassPostTotal += PassPostNum.ToString() + "|";
                }
                TextOut.Append("</tr>\r\n");
            }
            TextOut.Append("</table>");

            //统计通过几个岗位的人数
            if (PassPostTotal.Length > 1)
            {
                TextOut.Append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
                for (int i = 1; i < PostArray.Count + 1; i++)
                {
                    if (PassPostTotal.Contains("|" + i + "|"))
                    {
                        TextOut.Append("<tr class=\"listTableMain\"><td>通过" + i.ToString() + "个岗位的人数为:");
                        int PerNum = 0;
                        foreach (string Item in PassPostTotal.Split('|'))
                        {
                            if (Item == i.ToString())
                            {
                                PerNum += 1;
                            }
                        }
                        TextOut.Append(PerNum.ToString() + "</td></tr>");
                    }
                }
                TextOut.Append("</table>");
            }
            this.ReportList.InnerHtml = TextOut.ToString();
        }
Ejemplo n.º 4
0
        private PostCateInfo GetPostClassList()
        {
            string QuestType   = RequestHelper.GetForm <string>("questType");
            int    classID     = RequestHelper.GetForm <int>("ClassID");
            int    studyPostID = int.Parse(CookiesHelper.ReadCookieValue("UserStudyPostId"));
            Dictionary <string, Dictionary <string, string> > postProductClassList = new Dictionary <string, Dictionary <string, string> >();

            string postCourseID     = PostBLL.ReadPostCourseID(base.UserCompanyID, studyPostID);
            string passPostCourseID = string.IsNullOrEmpty(postCourseID) ? "" : TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, postCourseID, 1));

            postCourseID = StringHelper.SubString(postCourseID, passPostCourseID);

            //加载认证考试
            PostPassInfo passpost = new PostPassInfo();

            passpost.UserId = base.UserID;
            passpost.IsRZ   = 0;

            RenZhengCateInfo rzCate = new RenZhengCateInfo();

            rzCate.InPostID = PostPassBLL.PassPostString(passpost);
            string rzProductID = RenZhengCateBLL.ReadTestCateID(rzCate);

            postCourseID = string.IsNullOrEmpty(rzProductID) ? postCourseID : string.IsNullOrEmpty(postCourseID) ? rzProductID : postCourseID + "," + rzProductID;

            //加载大课件
            ProductSearchInfo productSearch = new ProductSearchInfo();

            productSearch.IsSale  = 1;
            productSearch.ClassID = "|5298|";
            List <ProductInfo> dkjProductList = ProductBLL.SearchProductList(productSearch);

            if (dkjProductList.Count > 0)
            {
                string dkjCourseID = ProductBLL.ReadProductIdStr(dkjProductList);
                postCourseID = string.IsNullOrEmpty(postCourseID) ? dkjCourseID : postCourseID + "," + dkjCourseID;
            }

            if (!string.IsNullOrEmpty(postCourseID))
            {
                postProductClassList = ProductClassBLL.ReadProductClassListByProductID(postCourseID, 1);
            }
            if (postProductClassList.Count > 1)
            {
                postProductClassList = ProductClassBLL.productClassSort(postProductClassList);
            }

            List <Dictionary <string, string> > productClassList = new List <Dictionary <string, string> >();

            foreach (string key in postProductClassList.Keys)
            {
                Dictionary <string, string> productClassDic = new Dictionary <string, string>();
                productClassDic.Add("ID", key);
                productClassDic.Add("Name", ProductClassBLL.ReadProductClassCache(int.Parse(key)).ClassName);
                productClassList.Add(productClassDic);
            }

            PostCateInfo studyPost = new PostCateInfo();

            studyPost.EncryptFcateID       = studyPostID.ToString();
            studyPost.Title                = PostBLL.ReadPost(studyPostID).PostName;
            studyPost.ChildCourseFCateView = productClassList;

            return(studyPost);

            //三个岗位加载 竞品选修
            //if (StringHelper.CompareSingleString("4,5,64", studyPostID.ToString()))
            //{
            //    ProductSearchInfo productSearch = new ProductSearchInfo();
            //    productSearch.ClassID = "|6|";
            //    productSearch.InBrandID = base.CompanyBrandID;
            //    productSearch.IsSale = 1;
            //    productSearch.NotLikeName = "必修";
            //    string xxCourseID = ProductBLL.ReadProductIdStr(ProductBLL.SearchProductList(productSearch));
            //    string passXXCourseID = TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, xxCourseID, 1));
            //    //if (passType == 1)
            //    //    xxCourseID = passXXCourseID;
            //    //else if (passType == 0)
            //    xxCourseID = StringHelper.SubString(xxCourseID, passXXCourseID);
            //    if (!string.IsNullOrEmpty(xxCourseID))
            //        this.xxProductClassList = ProductClassBLL.ReadProductClassListByProductID(xxCourseID, 1);
            //}

            //if (!string.IsNullOrEmpty(QuestType))
            //{
            //    List<PostInfo> PostCateList = new List<PostInfo>();
            //    PostCateList.Add(PostBLL.ReadPost(PostId));
            //    return ConvertToPostCate(PostCateList, true);
            //}
            //else
            //{
            //    return ConvertToPostCate(PostBLL.ReadPostCateRootList(), true);
            //}
        }
Ejemplo n.º 5
0
        protected override void PageLoad()
        {
            if (StringHelper.CompareSingleString(base.ParentCompanyID, "667"))
            {
                Response.Redirect("/");
            }
            base.PageLoad();
            base.CheckUserPower("PostStudy", PowerCheckType.Single);

            ProductSearchInfo product = new ProductSearchInfo();

            product.IsNew = 1;
            //product.IsTop = 1;
            product.IsSale = 1;
            int count = 0;

            this.newProductList = ProductBLL.SearchProductList(1, 10, product, ref count);
            this.newProductAttributeRecordList = AttributeRecordBLL.ReadList("3", ProductBLL.ReadProductIdStr(this.newProductList));

            //默认加载视图模式
            if (string.IsNullOrEmpty(view))
            {
                view = "Grid";
            }

            int studyPostID = int.Parse(CookiesHelper.ReadCookieValue("UserStudyPostId"));

            this.studyPost        = PostBLL.ReadPost(studyPostID);
            this.productClassList = ProductClassBLL.ReadProductClassRootList();
            string postCourseID = PostBLL.ReadPostCourseID(base.UserCompanyID, studyPostID);

            postCourseNum = string.IsNullOrEmpty(postCourseID) ? 0 : postCourseID.Split(',').Length;
            string passPostCourseID = string.IsNullOrEmpty(postCourseID) ? "" : TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, postCourseID, 1));

            passCourseNum = string.IsNullOrEmpty(passPostCourseID) ? 0 : passPostCourseID.Split(',').Length;
            //isTestAgain = TestSettingBLL.IsTestAgain(base.UserID, int.Parse(CookiesHelper.ReadCookieValue("UserStudyPostId")));

            switch (studyPostID)
            {
            case 5:
            case 37:
            case 64:
            case 87:
            case 693:
                postImageName = "post1.jpg";
                break;

            case 8:
            case 86:
            case 4:
            case 85:
            case 276:
            case 286:
                postImageName = "post2.jpg";
                break;

            case 82:
            case 220:
            case 166:
            case 168:
            case 88:
            case 251:
            case 258:
            case 302:
            case 308:
            case 341:
                postImageName = "post3.jpg";
                break;

            case 83:
            case 89:
            case 158:
            case 265:
            case 312:
            case 318:
                postImageName = "post4.jpg";
                break;

            case 11:
            case 327:
                postImageName = "post5.jpg";
                break;

            default:
                postImageName = "post1.jpg";
                break;
            }

            //视图模式时加载分类目录
            if (view == "Grid")
            {
                //公共课程
                if (pc == 1)
                {
                    ProductSearchInfo productSearch = new ProductSearchInfo();
                    productSearch.ClassID = "|5298|";
                    productSearch.IsSale  = 1;
                    postCourseID          = ProductBLL.ReadProductIdStr(ProductBLL.SearchProductList(productSearch));
                }
                //获取认证课程ID
                else if (rz == 1)
                {
                    PostPassInfo passpost = new PostPassInfo();
                    passpost.UserId = base.UserID;
                    passpost.IsRZ   = int.MinValue;

                    RenZhengCateInfo rzCate = new RenZhengCateInfo();
                    rzCate.InPostID = PostPassBLL.PassPostString(passpost);
                    postCourseID    = RenZhengCateBLL.ReadTestCateID(rzCate);
                }
                else
                {
                    //默认加载未通过的课程
                    if (passType <= 0)
                    {
                        passType = 0;
                    }

                    if (passType == 1 || passType == 0)
                    {
                        if (passType == 1)
                        {
                            postCourseID = passPostCourseID;//StringHelper.EqualString(postCourseID, filterCourseID);
                        }
                        else if (passType == 0)
                        {
                            postCourseID = StringHelper.SubString(postCourseID, passPostCourseID);
                        }
                    }
                }

                if (!string.IsNullOrEmpty(postCourseID))
                {
                    this.postProductClassList = ProductClassBLL.ReadProductClassListByProductID(postCourseID, 1);
                }
                if (postProductClassList.Count > 1)
                {
                    this.postProductClassList = productClassSort(this.postProductClassList);
                }

                //特定时间考试
                if (pc != 1 && rz != 1)
                {
                    string parentCompanyID = CookiesHelper.ReadCookieValue("UserCompanyParentCompanyID");
                    //if (string.IsNullOrEmpty(parentCompanyID)) parentCompanyID = base.UserCompanyID.ToString();
                    //else parentCompanyID += "," + base.UserCompanyID.ToString();
                    List <TestSettingInfo> specialTestList = TestSettingBLL.ReadSpecialTestList(parentCompanyID);
                    if (specialTestList.Count > 0)
                    {
                        string specialCourseID = TestSettingBLL.ReadSpecialTestCourseID(specialTestList);
                        if (!string.IsNullOrEmpty(specialCourseID))
                        {
                            ProductSearchInfo productSearch = new ProductSearchInfo();
                            productSearch.InProductID = specialCourseID;
                            productSearch.InBrandID   = CookiesHelper.ReadCookieValue("UserCompanyBrandID");
                            productSearch.IsSale      = 1;
                            specialCourseID           = ProductBLL.ReadProductIdStr(ProductBLL.SearchProductList(productSearch));
                            string passSpecialCourseID = TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, specialCourseID, 1));
                            if (passType == 1)
                            {
                                specialCourseID = passSpecialCourseID;
                            }
                            else if (passType == 0)
                            {
                                specialCourseID = StringHelper.SubString(specialCourseID, passSpecialCourseID);
                            }

                            if (!string.IsNullOrEmpty(specialCourseID))
                            {
                                hasSpecialTest = true;
                            }
                        }
                    }
                }

                //三个岗位加载 竞品选修
                if (passType >= 0 && StringHelper.CompareSingleString("4,5,64", studyPostID.ToString()))
                {
                    ProductSearchInfo productSearch = new ProductSearchInfo();
                    productSearch.ClassID     = "|6|";
                    productSearch.InBrandID   = CookiesHelper.ReadCookieValue("UserCompanyBrandID");
                    productSearch.IsSale      = 1;
                    productSearch.NotLikeName = "必修";
                    string xxCourseID     = ProductBLL.ReadProductIdStr(ProductBLL.SearchProductList(productSearch));
                    string passXXCourseID = TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, xxCourseID, 1));
                    if (passType == 1)
                    {
                        xxCourseID = passXXCourseID;
                    }
                    else if (passType == 0)
                    {
                        xxCourseID = StringHelper.SubString(xxCourseID, passXXCourseID);
                    }
                    if (!string.IsNullOrEmpty(xxCourseID))
                    {
                        this.xxProductClassList = ProductClassBLL.ReadProductClassListByProductID(xxCourseID, 1);
                    }
                }
            }
        }