private List <Dictionary <string, object> > GetRecordList() { int PageIndex = RequestHelper.GetForm <int>("pageIndex"); int PageSize = RequestHelper.GetForm <int>("pageSize"); int Count = 0; List <Dictionary <string, object> > ReturnResult = new List <Dictionary <string, object> >(); TestPaperInfo TestPaperModel = new TestPaperInfo(); TestPaperModel.UserId = base.UserID; List <TestPaperInfo> TestPaperList = TestPaperBLL.ReadList(TestPaperModel, PageIndex, PageSize, ref Count); if (TestPaperList.Count > 0) { foreach (TestPaperInfo Info in TestPaperList) { Dictionary <string, object> TempDic = new Dictionary <string, object>(); TempDic.Add("TestCateName", Info.PaperName); TempDic.Add("Scorse", Info.Scorse); TempDic.Add("PageCount", Count); ReturnResult.Add(TempDic); } } return(ReturnResult); }
protected override void PageLoad() { base.PageLoad(); TestPaperInfo testPaper = new TestPaperInfo(); if (action != "All") { testPaper.TestMinDate = DateTime.Parse(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-1"); } testPaper.UserId = base.UserID; base.PageSize = 15; testPaperList = TestPaperBLL.ReadList(testPaper, base.CurrentPage, base.PageSize, ref base.Count); base.BindPageControl(ref base.CommonPager); }
protected override void PageLoad() { base.PageLoad(); base.Title = "最小学习量达成分析表"; base.CheckUserPower("ReadEMSReport", PowerCheckType.Single); TestPaperInfo testPaperSearch = new TestPaperInfo(); testPaperSearch.TestMinDate = startDate; testPaperSearch.TestMaxDate = ShopCommon.SearchEndDate(endDate); testPaperSearch.Scorse = score; testPaperSearch.IsPass = isPass; testPaperSearch.PaperName = courseName; if (companyID < 0) { testPaperSearch.CompanyIdCondition = base.ExistsSonCompany ? base.SonCompanyID : base.UserCompanyID.ToString(); } else { testPaperSearch.CompanyIdCondition = companyID.ToString(); } if (!string.IsNullOrEmpty(realName) || !string.IsNullOrEmpty(userName)) { UserSearchInfo user = new UserSearchInfo(); user.RealName = realName; user.UserName = userName; user.InCompanyID = testPaperSearch.CompanyIdCondition; testPaperSearch.UserIdCondition = UserBLL.ReadUserIdStr(UserBLL.SearchUserList(user)); if (string.IsNullOrEmpty(testPaperSearch.UserIdCondition)) { testPaperSearch.UserIdCondition = "0"; } } //if (!string.IsNullOrEmpty(courseName)) //{ // testPaperSearch.Condition = "[CateID] in (select ID from [_Product] where [Name] like '%" + courseName + "%')"; //} testPaperList = TestPaperBLL.ReadList(testPaperSearch, base.CurrentPage, base.PageSize, ref this.Count); base.BindPageControl(ref base.CommonPager); }
protected string HtmlOut(CompanyInfo company, string Type) { int WeekNum = 0, ColNum = 10, PeoperNum = 0; string logPath = ServerHelper.MapPath(@"\Log\"); TxtLog log = new TxtLog(logPath); Stopwatch time1 = new Stopwatch(); time1.Start(); StringBuilder TextOut = new StringBuilder(); string CompanyBrandId = company.BrandId; DateTime PostPlanStartDate = DateTime.MinValue; if (string.IsNullOrEmpty(company.PostStartDate.ToString())) { PostPlanStartDate = Convert.ToDateTime("2013-7-1"); } else { PostPlanStartDate = Convert.ToDateTime(company.PostStartDate.ToString()); } string rowspan = string.Empty; TextOut.Append("<table class=\"evaluation_sheet\">"); TextOut.Append("<tr>"); if (StartDate != DateTime.MinValue) { WeekNum = (EndDate - StartDate).Days / 7; if ((EndDate - StartDate).Days % 7 > 0) { WeekNum = WeekNum + 1; } TextOut.Append("<th colspan=\"" + (ColNum + WeekNum * 3) + "\">" + company.CompanySimpleName + " [" + StartDate.ToString("d") + "—" + EndDate.AddDays(-1).ToString("d") + "]"); rowspan = " rowspan=\"3\""; } else { TextOut.Append("<th colspan=\"" + ColNum + "\">" + company.CompanySimpleName + " [ 截止到:" + EndDate.AddDays(-1).ToString("d") + " ]"); rowspan = " rowspan=\"3\""; } TextOut.Append("</th></tr>\r\n"); TextOut.Append("<tr>\r\n"); TextOut.Append("<th" + rowspan + " class=\"id\">序号</th>"); //if (base.IsGroupCompany(company.GroupId)) TextOut.Append("<th" + rowspan + ">公司名</th>"); TextOut.Append("<th" + rowspan + " class=\"name\">姓名</th>"); TextOut.Append("<th" + rowspan + " class=\"post\">工作岗位</th>"); TextOut.Append("<th" + rowspan + " class=\"post\">学习岗位</th>"); TextOut.Append("<th colspan=\"" + (WeekNum * 3).ToString() + "\">学习已通过</th>"); TextOut.Append("<th colspan=\"3\">合计<br />("); if (StartDate != DateTime.MinValue) { TextOut.Append(StartDate.ToString("d") + "—" + EndDate.AddDays(-1).ToString("d")); } else { TextOut.Append("截止到:" + EndDate.AddDays(-1).ToString("d")); StartDate = PostPlanStartDate; } TextOut.Append(")</th>"); TextOut.Append("<th colspan=\"3\">从项目启动开始</th>"); TextOut.Append("</tr>\r\n"); TextOut.Append("<tr>\r\n"); for (int j = 1; j <= WeekNum; j++) { TextOut.Append("<th colspan=\"3\">第" + j.ToString() + "周<br>" + StartDate.AddDays(7 * (j - 1)).ToString("M-d") + "—"); if (j == WeekNum) { TextOut.Append(EndDate.AddDays(-1).ToString("M-d") + "</th>"); } else { TextOut.Append(StartDate.AddDays((7 * j) - 1).ToString("M-d") + "</th>"); } } TextOut.Append("<th rowspan=\"2\" class=\"total\">累计学习<br />考试次数</th>"); TextOut.Append("<th rowspan=\"2\" class=\"total\">考试通过<br />课程数量</th>"); TextOut.Append("<th rowspan=\"2\" class=\"total\">课程考试<br />通过率</th>"); TextOut.Append("<th rowspan=\"2\" class=\"total\">累计<br>完成总数</th>"); TextOut.Append("<th rowspan=\"2\" class=\"total\">目标<br>完成总数<br>(实际数)</th>"); TextOut.Append("<th rowspan=\"2\" class=\"total\">学习进度<br>达成分析<br>(超前/落后)</th>"); TextOut.Append("</tr>\r\n"); TextOut.Append("<tr class=\"listTableHead\">\r\n"); for (int j = 1; j <= WeekNum; j++) { TextOut.Append("<th class=\"total\">累计学习<br />考试次数</th>"); TextOut.Append("<th class=\"total\">考试通过<br />课程数量</th>"); TextOut.Append("<th class=\"total\">课程考试<br />通过率</th>"); } TextOut.Append("</tr>\r\n"); //统计目标课程数 int TargetNum = 0, CompanyDelayNum = 0; //统计通过课程数量第一的数据信息 string PassCourseFirstUser = string.Empty, GoodStudent = string.Empty; int FirstPassCourseNum = 0; //单个岗位的岗位计划开始时间 DateTime PostStartDate = DateTime.MinValue; int PostSign = 0; //是否重新计算岗位总数的标记 int PostCourseNum = 0; //岗位课程数 string AllPostPlan = "0"; //岗位下所有级别的岗位课程 int RedNum = 0, YellowNum = 0, GreenNum = 0; //增加通过率所用补丁部分 TestPaperInfo TestPaperModel = new TestPaperInfo(); TestPaperModel.TestMinDate = StartDate; TestPaperModel.TestMaxDate = EndDate; TestPaperModel.CompanyIdCondition = company.CompanyId.ToString(); List <TestPaperInfo> TestPaperList = TestPaperBLL.NewReadList(TestPaperModel); UserSearchInfo userSearch = new UserSearchInfo(); userSearch.Status = (int)UserState.Normal; userSearch.InWorkingPostID = PostIdCondition; //if (base.IsGroupCompany(company.GroupId)) //{ // userSearch.InCompanyID = CompanyBLL.ReadCompanyIdList(company.CompanyId.ToString()); // ColNum = 11; // userSearch.InStudyPostID = "45";//集团打开默认显示学习岗位 //} //else { userSearch.InCompanyID = company.CompanyId.ToString(); userSearch.InStudyPostID = StudyPostIdCondition; //只显示该学习岗位下的人员 } List <UserInfo> userList = UserBLL.SearchReportUserList(userSearch); //记录岗位课程ID串 Dictionary <int, string[]> postCourseDic = new Dictionary <int, string[]>(); time1.Stop(); log.Write("执行到会员开始循环的时间为:" + time1.Elapsed.TotalSeconds); time1.Reset(); foreach (UserInfo Info in userList) { time1.Reset(); time1.Start(); int PostId = int.MinValue, PerPassCourseNum = 0, PerCourseNum = 0; PostId = Info.StudyPostID; PostInfo PostModel = PostBLL.ReadPost(PostId); if (PostModel != null) //排除掉没有设置岗位的人 { int ResidueCourseNum = 0; //岗位内剩余岗位课程数 if (!postCourseDic.ContainsKey(PostId)) { //岗位数据信息 1:岗位课程ID串;2:岗位课程数量;3:岗位开始时间;4:目标课程数量 string[] postData = { "0", "0", DateTime.MinValue.ToString(), "0" }; AllPostPlan = PostBLL.ReadPostCourseID(company.CompanyId, PostId); postData[0] = AllPostPlan; if (!string.IsNullOrEmpty(AllPostPlan)) { PostCourseNum = AllPostPlan.Split(',').Length; postData[1] = PostCourseNum.ToString(); } //公司有事耽误的数量 由于岗位不一样,岗位计划开始的时间也不一样,所以有事耽误的数量也是不一致的,按岗位计算 PostStartDate = CompanyPostPlanBLL.ReadCompanyPostPlan(company.CompanyId, PostId); //如果没有设置岗位开始时间或者岗位开始时间比公司开始时间早,统一使用公司开始时间 if (PostStartDate == DateTime.MinValue || PostStartDate < PostPlanStartDate) { PostStartDate = PostPlanStartDate; } //根据统一的岗位开始时间调取数据 CompanyDelayNum = ChangeNumBLL.CompanyChangeNum(company.CompanyId, PostId, PostStartDate, EndDate); TargetNum = CompanyRuleBLL.GetCourseNum(company.CompanyId, PostId, PostStartDate, EndDate); //理论值是每周两门 TargetNum = TargetNum - CompanyDelayNum; postData[2] = PostStartDate.ToString(); postData[3] = TargetNum.ToString(); postCourseDic.Add(PostId, postData); } else { AllPostPlan = postCourseDic[PostId][0]; PostCourseNum = int.Parse(postCourseDic[PostId][1]); PostStartDate = Convert.ToDateTime(postCourseDic[PostId][2]); TargetNum = int.Parse(postCourseDic[PostId][3]); } //如果员工是后来的,要以员工进来的时间为起始点 if (PostStartDate < Info.PostStartDate)//Info.RegisterDate { PostStartDate = Info.PostStartDate; CompanyDelayNum = ChangeNumBLL.CompanyChangeNum(company.CompanyId, PostId, PostStartDate, EndDate); TargetNum = CompanyRuleBLL.GetCourseNum(company.CompanyId, PostId, PostStartDate, EndDate); //理论值是每周两门 TargetNum = TargetNum - CompanyDelayNum; } TargetNum = TargetNum - ChangeNumBLL.UserChangeNum(Info.ID, PostStartDate, EndDate); //PassCateId 跨岗位通过的课程 PostResidueCourse 岗位内剩余课程 string PassCateId = string.Empty, NoPassCateId = string.Empty, PostResidueCourse = string.Empty; if (!string.IsNullOrEmpty(company.PostStartDate.ToString())) { PassCateId = TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(Info.ID, PostStartDate, EndDate, 1)); PostResidueCourse = StringHelper.SubString(AllPostPlan, TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(Info.ID, EndDate, 1))); } else { PassCateId = TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(Info.ID, EndDate, 1)); PostResidueCourse = StringHelper.SubString(AllPostPlan, PassCateId); } //跨岗位通过的课程数(全岗位计划开始后,累计完成的课程数) int AllPassCourseNum = 0; if (!string.IsNullOrEmpty(PassCateId)) { AllPassCourseNum = PassCateId.Split(',').Length; } //获取岗位内剩余课程数 if (!string.IsNullOrEmpty(PostResidueCourse)) { ResidueCourseNum = PostResidueCourse.Split(',').Length; } string PastPassCourse = string.Empty; PeoperNum = PeoperNum + 1; TextOut.Append("<tr>\r\n"); TextOut.Append("<td>" + PeoperNum + "</td>"); //if (base.IsGroupCompany(company.GroupId)) TextOut.Append("<td>" + CompanyBLL.ReadCompany(Info.CompanyID).CompanySimpleName + "</td>"); TextOut.Append("<td>" + Info.RealName + "</td>"); if (!string.IsNullOrEmpty(Info.PostName)) { TextOut.Append("<td>" + Info.PostName + "</td>"); } else { TextOut.Append("<td>" + PostBLL.ReadPost(Info.WorkingPostID).PostName + "</td>"); } TextOut.Append("<td>" + PostModel.PostName + "</td>"); for (int j = 1; j <= WeekNum; j++) { int WeekCourseNum = 0; DateTime _StartDate = StartDate.AddDays(7 * (j - 1)); DateTime _EndDate = StartDate.AddDays(7 * j); if (j == WeekNum) { _EndDate = EndDate; } if (_StartDate < PostStartDate) { _StartDate = PostStartDate; } if (_EndDate > PostStartDate) { PastPassCourse = TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(Info.ID, _StartDate, _EndDate, 1)); WeekCourseNum = TestPaperList.FindAll(delegate(TestPaperInfo TempModel) { return(TempModel.UserId == Info.ID && TempModel.TestDate >= _StartDate && TempModel.TestDate <= _EndDate); }).Count; } int PastPassCourseNum = 0; if (!string.IsNullOrEmpty(PastPassCourse)) { PastPassCourseNum = PastPassCourse.Split(',').Length; } PerPassCourseNum += PastPassCourseNum; PerCourseNum += WeekCourseNum; TextOut.Append("<td>" + WeekCourseNum + "</td>"); TextOut.Append("<td>" + (PastPassCourseNum) + "</td>"); if (PastPassCourseNum == 0) { TextOut.Append("<td>0</td>"); } else { TextOut.Append("<td>" + ((double)PastPassCourseNum / (double)WeekCourseNum).ToString("P") + "</td>"); } } //统计好学生 学习课程超过30门的人 if (PerCourseNum >= 30) { GoodStudent += " " + Info.RealName; } //统计通过课程数量第一的数据 if (PerPassCourseNum > 0 && PerPassCourseNum >= FirstPassCourseNum) { if (PerPassCourseNum > FirstPassCourseNum) { PassCourseFirstUser = Info.RealName; FirstPassCourseNum = PerPassCourseNum; } else { PassCourseFirstUser = PassCourseFirstUser + " " + Info.RealName; } } TextOut.Append("<td>" + PerCourseNum + "</td>"); TextOut.Append("<td>" + PerPassCourseNum + "</td>"); if (PerCourseNum <= 0) { TextOut.Append("<td>0</td>"); } else { TextOut.Append("<td>" + ((double)PerPassCourseNum / (double)PerCourseNum).ToString("P") + "</td>"); } TextOut.Append("<td>" + (AllPassCourseNum) + "</td>"); TextOut.Append("<td>" + (TargetNum) + "</td>"); TargetNum = AllPassCourseNum - TargetNum; TextOut.Append("<td style=\""); if (TargetNum > 0) { TextOut.Append("background: #00b050;"); GreenNum += 1; } else if (TargetNum < 0) { TextOut.Append("background: #ff0000;"); RedNum += 1; } else { TextOut.Append("background: #ffff00;"); YellowNum += 1; } TextOut.Append(" color:#000;\">" + (TargetNum) + "</td>"); TextOut.Append("</tr>\r\n"); } PostModel = null; time1.Stop(); log.Write(Info.RealName + "执行时间为:" + time1.Elapsed.Milliseconds); } if (FirstPassCourseNum > 0) { TextOut.Append("<tr><th colspan=\"" + (ColNum + WeekNum * 3) + "\">课程考试通过数量最多的学霸为: <font color=red>" + PassCourseFirstUser + "</font> ,数量为: <font color=red>" + FirstPassCourseNum.ToString() + "</font> 。</th></tr>"); } if (!string.IsNullOrEmpty(GoodStudent)) { TextOut.Append("<tr><th colspan=\"" + (ColNum + WeekNum * 3) + "\">月度考试数量超过30门的为好学生,此次好学生为: <font color=red>" + GoodStudent + "</font> 。</th></tr>"); } TextOut.Append("<tr><th colspan=\"" + (ColNum + WeekNum * 3) + "\">未达标人数:" + RedNum.ToString() + " 刚好达标人数:" + YellowNum.ToString() + " 超越目标人数:" + GreenNum.ToString() + "</th></tr>"); TextOut.Append("<tr><th colspan=\"" + (ColNum + WeekNum * 3) + "\">未达标人数:" + RedNum.ToString() + " 达标人数:" + (YellowNum + GreenNum).ToString() + " 达成率:" + ((double)(YellowNum + GreenNum) / (double)PeoperNum).ToString("P") + "</th></tr>"); TextOut.Append("</table>"); if (string.IsNullOrEmpty(Type)) { return(TextOut.ToString()); } else { GroupResult[1] = (int)GroupResult[1] + PeoperNum; GroupResult[2] = (int)GroupResult[2] + (YellowNum + GreenNum); GroupResult[3] = (int)GroupResult[3] + RedNum; if (((double)(YellowNum + GreenNum) / (double)PeoperNum) == 1.0) { GroupResult[4] = GroupResult[4] + "<span style=\"margin:0px 10px;\">" + company.CompanySimpleName + "</span>"; } else if (((double)(YellowNum + GreenNum) / (double)PeoperNum) < 0.7) { GroupResult[5] = GroupResult[5] + "<span style=\"margin:0px 10px;\">" + company.CompanySimpleName + "</span>"; } //GroupResult[4] += ((double)(YellowNum + GreenNum) / (double)PeoperNum); return("<tr><td>" + company.CompanySimpleName + "</td><td>" + PeoperNum + "</td><td>" + (YellowNum + GreenNum).ToString() + "</td><td>" + RedNum.ToString() + "</td><td>" + ((double)(YellowNum + GreenNum) / (double)PeoperNum).ToString("P") + "</td></tr>"); } }
//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); }
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); //} }
private List <MCourseInfo> GetCoursesByKeyWord() { string Keyword = StringHelper.SearchSafe(RequestHelper.GetForm <string>("keyWord")); int PageIndex = RequestHelper.GetForm <int>("pageIndex"); int PageSize = RequestHelper.GetForm <int>("pageSize"); List <MCourseInfo> CourseList = new List <MCourseInfo>(); int i = 1; ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.Key = Keyword; productSearch.IsSale = 1; productSearch.InCompanyID = CompanyBLL.SystemCompanyId.ToString(); productSearch.InBrandID = CookiesHelper.ReadCookieValue("UserCompanyBrandID"); List <ProductInfo> productList = ProductBLL.SearchProductList(productSearch); if (productList.Count > 0) { //通过的课程ID string PassCourseId = TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, 1)); string PostCourseId = PostBLL.ReadPostCourseID(base.UserCompanyID, int.Parse(CookiesHelper.ReadCookieValue("UserStudyPostId"))); string perpaidCourseId = BLLMTestCate.ReadPrepaidTestCate(base.UserID); foreach (ProductInfo Info in productList) { if (i >= PageSize * (PageIndex - 1) && i < PageSize * PageIndex) { MCourseInfo CourseModel = new MCourseInfo(); CourseModel.ClassID = Info.ID.ToString(); CourseModel.Title = Info.Name; TestPaperInfo Model = new TestPaperInfo(); Model.UserId = base.UserID; Model.CateIdCondition = Info.ID.ToString(); Model.GroupCondition = "CateId"; TestPaperInfo TestPaperModel = TestPaperBLL.ReadList(Model).Find(delegate(TestPaperInfo TempModel) { return(TempModel.CateId == Info.ID); }); if (TestPaperModel != null) { CourseModel.TestCount = TestPaperModel.TestNum; } else { CourseModel.TestCount = 0; } CourseModel.IsPass = StringHelper.CompareSingleString(PassCourseId, Info.ID.ToString()); CourseModel.PageCount = (int)Math.Ceiling((double)productList.Count / (double)PageSize); if (!string.IsNullOrEmpty(Info.ProductNumber)) { CourseModel.IsVideo = true; } if (!string.IsNullOrEmpty(Info.Accessory)) { CourseModel.IsTest = true; } CourseModel.IsPostCourse = StringHelper.CompareSingleString(PostCourseId, Info.ID.ToString()); if (!CourseModel.IsPostCourse && CourseModel.Title.ToLower().IndexOf("vs") < 0) { continue; } CourseModel.OriginalPrice = Info.MarketPrice.ToString(); List <AttributeRecordInfo> attributeRecordList = AttributeRecordBLL.ReadList("5", Info.ID.ToString()); if (attributeRecordList.Count > 0) { CourseModel.IsRC = true; CourseModel.RCUrl = attributeRecordList[0].Value; } //选修也列为可以查看对象 if (!CourseModel.IsPostCourse && Info.Name.ToUpper().Contains("VS")) { CourseModel.IsPostCourse = true; } CourseModel.IsPrepaidCourse = StringHelper.CompareSingleString(perpaidCourseId, Info.ID.ToString()); CourseList.Add(CourseModel); } if (i >= PageSize * PageIndex) { break; } i++; } } return(CourseList); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int id = RequestHelper.GetQueryString <int>("ID"); string Action = RequestHelper.GetQueryString <string>("Action"); if (Action == "Delete") { if (id != int.MinValue) { base.CheckAdminPower("DeleteTestPaper", PowerCheckType.Single); TestPaperInfo TestPaperModel = TestPaperBLL.ReadPaper(id); string FilePath = ServerHelper.MapPath("~/xml/" + TestPaperModel.UserId.ToString() + "_" + TestPaperModel.CateId.ToString() + ".xml"); if (File.Exists(FilePath)) { File.Delete(FilePath); } FilePath = ServerHelper.MapPath("~/m/xml/" + TestPaperModel.UserId.ToString() + "_" + TestPaperModel.CateId.ToString() + ".xml"); if (File.Exists(FilePath)) { File.Delete(FilePath); } TestPaperBLL.DeletePaper(id); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("TestPaper"), id); ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), Request.UrlReferrer.ToString()); } } if (Action == "Search") { string searchUserName = RequestHelper.GetQueryString <string>("username"); string searchRealName = RequestHelper.GetQueryString <string>("realname"); string searchCompanyName = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("companyname").Trim()); string searchCourseName = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("coursename").Trim()); DateTime startDate = RequestHelper.GetQueryString <DateTime>("StartDate"); DateTime endDate = RequestHelper.GetQueryString <DateTime>("EndDate"); int isPass = RequestHelper.GetQueryString <int>("IsPass"); CompanyName.Text = searchCompanyName; RealName.Text = searchRealName; UserName.Text = searchUserName; CourseName.Text = searchCourseName; if (startDate != DateTime.MinValue) { SearchStartDate.Text = startDate.ToString("d"); } if (endDate != DateTime.MinValue) { SearchEndDate.Text = endDate.ToString("d"); } if (isPass >= 0) { IsPass.Text = isPass.ToString(); } base.CheckAdminPower("ReadTestPaper", PowerCheckType.Single); deleteTestPaperPower = base.CompareAdminPower("DeleteTestPaper", PowerCheckType.Single); TestPaperInfo testPaperSearch = new TestPaperInfo(); testPaperSearch.TestMinDate = startDate; testPaperSearch.TestMaxDate = ShopCommon.SearchEndDate(endDate); testPaperSearch.IsPass = isPass; testPaperSearch.PaperName = searchCourseName; if (!string.IsNullOrEmpty(searchCompanyName)) { testPaperSearch.CompanyIdCondition = CompanyBLL.ReadCompanyIdStr(searchCompanyName, 1); } if (!string.IsNullOrEmpty(searchRealName) || !string.IsNullOrEmpty(searchUserName)) { UserSearchInfo user = new UserSearchInfo(); user.UserName = searchUserName; user.RealName = searchRealName; testPaperSearch.UserIdCondition = UserBLL.ReadUserIdStr(UserBLL.SearchUserList(user)); if (string.IsNullOrEmpty(testPaperSearch.UserIdCondition)) { testPaperSearch.UserIdCondition = "0"; } } base.BindControl(TestPaperBLL.ReadList(testPaperSearch, base.CurrentPage, base.PageSize, ref this.Count), this.RecordList, this.MyPager); } } }
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); } } } }
protected override void PageLoad() { if (StringHelper.CompareSingleString(base.ParentCompanyID, "667")) { Response.Redirect("/"); } base.PageLoad(); base.CheckUserPower("PostStudy", PowerCheckType.Single); //最新一条信息 int[] classIDArray = new int[] { 33, 37, 38 }; foreach (int item in classIDArray) { ArticleInfo article = ArticleBLL.ReadFirstAtricle(item); if (article.Date >= DateTime.Now.AddDays(-7)) { articleDc.Add(item, article); } } ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.IsNew = 1; //productSearch.IsTop = 1; productSearch.IsSale = 1; int count = -2147483648; this.newProductList = ProductBLL.SearchProductList(1, 10, productSearch, ref count); //每日快报 ArticleSearchInfo articleSearch = new ArticleSearchInfo(); articleSearch.ClassID = "|29|"; this.newsList = ArticleBLL.SearchArticleList(1, 12, articleSearch, ref base.Count); //证书 certList = PostPassBLL.GetTheLatestPostCert(10); attributeRecordList = AttributeRecordBLL.ReadList("1,2,3", ProductBLL.ReadProductIdStr(this.newProductList)); int studyPostID = int.Parse(CookiesHelper.ReadCookieValue("UserStudyPostId")); //this.studyPost = PostBLL.ReadPost(studyPostID); string postCourseID = PostBLL.ReadPostCourseID(base.UserCompanyID, studyPostID); companyBrandID = CookiesHelper.ReadCookieValue("UserCompanyBrandID"); passPostCourseID = string.IsNullOrEmpty(postCourseID) ? "" : TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, postCourseID, 1)); }