<%@ Control Language="C#" AutoEventWireup="true" Inherits="AVA.ResourcesPlatform.WebUI.Control.My.MyComparison" %> <%= new MyGrowthPathNavTopInstance(this) { Local= MyGrowthPathNavTopItem.比一比 }.ToHtml()%>
<% var userGuid = Request.QueryString["UserGuid"]; var listTeacher = CreateInstance.UserDao.Where(l => l.ParentUserType.TeacherEbable == true && l.Status == (int)AVA.ResourcesPlatform.Model.Pub.UserStatusEnum.有效 && l.Verify == (int)AVA.ResourcesPlatform.Model.Pub.UserVerifyEnum.已验证 && l.ParentDomain == this.User.ParentDomain && l.Guid != CookieGroup.UserCode) .ToList(); %>
<%= new HtmlSelect("", "TrueName", "Guid", "Guid") { ID="ddlComparison", Option = listTeacher,OnChange="GoToComparison();" }.InsertOption("::请选择::","",0)%>
<% if (!string.IsNullOrEmpty(userGuid)) { var otherUser = CreateInstance.UserDao.Get(userGuid); //var transformer = new Z.Core.NHibernateCore.TupleToPropertyResultTransformer // ("TeacherRatio", "StudentRatio", "TransferRatio"); var critThis = CreateInstance.VideoDao.NHibernateSession.CreateCriteria("_Alias"); critThis.Add(NHibernate.Criterion.Expression.Eq("Examine", (int)AVA.ResourcesPlatform.Model.Pub.VideoExamineEnum.审核通过)); critThis.Add(NHibernate.Criterion.Expression.Eq("Status", (int)AVA.ResourcesPlatform.Model.Pub.VideoStatusEnum.有效)); critThis.CreateAlias("ParentUser", "_User"); critThis.Add(NHibernate.Criterion.Expression.Eq("_User.Guid", this.User.Guid)); critThis.Add(NHibernate.Criterion.Expression.Ge("TeacherRatio", 0)); critThis.Add(NHibernate.Criterion.Expression.Ge("StudentRatio", 0)); critThis.Add(NHibernate.Criterion.Expression.Ge("TransferRatio", 0)); critThis.SetProjection(NHibernate.Criterion.Projections.ProjectionList() .Add(NHibernate.Criterion.Projections.AvgDefaultDataType("TeacherRatio")) .Add(NHibernate.Criterion.Projections.AvgDefaultDataType("StudentRatio")) .Add(NHibernate.Criterion.Projections.AvgDefaultDataType("TransferRatio")) ); var thisVideo = critThis.List() .FirstResult(); var thisTeacherRatio = 0; var thisStudentRatio = 0; var thisTransferRatio = 0; if (thisVideo != null) { thisTeacherRatio = thisVideo[0].ToInt(); thisStudentRatio = thisVideo[1].ToInt(); thisTransferRatio = thisVideo[2].ToInt(); } var critOther = CreateInstance.VideoDao.NHibernateSession.CreateCriteria("_Alias"); critOther.Add(NHibernate.Criterion.Expression.Eq("Examine", (int)AVA.ResourcesPlatform.Model.Pub.VideoExamineEnum.审核通过)); critOther.Add(NHibernate.Criterion.Expression.Eq("Status", (int)AVA.ResourcesPlatform.Model.Pub.VideoStatusEnum.有效)); critOther.CreateAlias("ParentUser", "_User"); critOther.Add(NHibernate.Criterion.Expression.Eq("_User.Guid", userGuid)); critOther.Add(NHibernate.Criterion.Expression.Ge("TeacherRatio", 0)); critOther.Add(NHibernate.Criterion.Expression.Ge("StudentRatio", 0)); critOther.Add(NHibernate.Criterion.Expression.Ge("TransferRatio", 0)); critOther.SetProjection(NHibernate.Criterion.Projections.ProjectionList() .Add(NHibernate.Criterion.Projections.AvgDefaultDataType("TeacherRatio")) .Add(NHibernate.Criterion.Projections.AvgDefaultDataType("StudentRatio")) .Add(NHibernate.Criterion.Projections.AvgDefaultDataType("TransferRatio")) ); var otherVideo = critOther.List() .FirstResult(); var otherTeacherRatio = 0; var otherStudentRatio = 0; var otherTransferRatio = 0; if (otherVideo != null) { otherTeacherRatio = otherVideo[0].ToInt(); otherStudentRatio = otherVideo[1].ToInt(); otherTransferRatio = otherVideo[2].ToInt(); } %> <%--
--%>
<%-- --%>
您的数据统计
统计项 数量
视频数量 <%= CreateInstance.VideoDao.Count(l=>l.ParentUser == this.User) %>
视频点击量 <%= CreateInstance.VideoDao.Where(l=>l.ParentUser == this.User).Sum(l=>l.VideoView) %>
视频被收藏量 <%= CreateInstance.VideoDao.Where(l=>l.ParentUser == this.User).Sum(l=>l.CollectCount) %>
视频被评论次数 <%= CreateInstance.VideoDao.Where(l=>l.ParentUser == this.User).Sum(l=>l.CommentCount) %>
参加实训次数 <%= CreateInstance.SubjectUserDao.Count(l=>l.ParentUser == this.User) %>
<%= Define.Get("Client_专辑")%>数量 <%= CreateInstance.AlbumDao.Count(l=>l.ParentUser == this.User) %>
<%----%>
<%= otherUser.TrueName %>的数据统计
统计项 数量
视频数量 <%= CreateInstance.VideoDao.Count(l=>l.ParentUser == otherUser) %>
视频点击量 <%= CreateInstance.VideoDao.Where(l=>l.ParentUser == otherUser).Sum(l=>l.VideoView) %>
视频被收藏量 <%= CreateInstance.VideoDao.Where(l=>l.ParentUser == otherUser).Sum(l=>l.CollectCount) %>
视频被评论次数 <%= CreateInstance.VideoDao.Where(l=>l.ParentUser == otherUser).Sum(l=>l.CommentCount) %>
参加实训次数 <%= CreateInstance.SubjectUserDao.Count(l=>l.ParentUser == otherUser) %>
<%= Define.Get("Client_专辑")%>数量 <%= CreateInstance.AlbumDao.Count(l=>l.ParentUser == otherUser) %>
<% } %>