<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ControlEdit.ascx.cs" Inherits="AVA.ResourcesPlatform.AdminUI.Pub.RecommendVideo.ControlEdit" %> <% var domainGuid = Request.GetFormValue("DomainGuid"); var domain = CreateInstance.DomainDao.Get(domainGuid); if (domain == null) { throw new Z.Core.Tools.ExceptionMessage("请选择要设置的平台"); } var recordEquipmentGuid = Request.GetFormValue("RecordEquipmentGuid"); var recordEquipment = CreateInstance.RecordEquipmentDao.Get(recordEquipmentGuid); if (recordEquipment != null && recordEquipment.ParentDomain != domain) { throw new Z.Core.Tools.ExceptionMessage("录播设备必须与当前平台相同"); } //循环星期 for (int dayOfWeek = 0; dayOfWeek <= 6; dayOfWeek++) { List listApplicationTimeSetting = null; if (dayOfWeek == 0 || dayOfWeek == 6) { //星期 listApplicationTimeSetting = CreateInstance.ApplicationTimeSettingDao.Where(l => l.ParentDomain.Guid == domainGuid && l.IsWeek == (int)AVA.ResourcesPlatform.Model.Pub.ApplicationTimeSettingIsWeekEnum.是) .OrderBy(l => l.SortNumber).ToList(); } else { //工作日 listApplicationTimeSetting = CreateInstance.ApplicationTimeSettingDao.Where(l => l.ParentDomain.Guid == domainGuid && l.IsWeek == (int)AVA.ResourcesPlatform.Model.Pub.ApplicationTimeSettingIsWeekEnum.否) .OrderBy(l => l.SortNumber).ToList(); } foreach (var item in listApplicationTimeSetting) { //找出当前课室当前平台当前课节的推荐视频 var recommendVideo = CreateInstance.RecommendVideoDao.Where(l => l.ParentDomain == domain && l.ParentRecordEquipment == recordEquipment && l.ParentApplicationTimeSetting == item && l.DayOfWeek == dayOfWeek) .ToList() .FirstResult(); if (recommendVideo == null) { //当没有的时候创建一条 recommendVideo = CreateInstance.RecommendVideo; recommendVideo.ParentDomain = domain; recommendVideo.ParentRecordEquipment = recordEquipment; recommendVideo.ParentApplicationTimeSetting = item; recommendVideo.DayOfWeek = dayOfWeek; CreateInstance.RecommendVideoDao.Insert(recommendVideo); } %> <% } } %>
<%= ((AVA.ResourcesPlatform.Model.DayOfWeek)dayOfWeek).Define() %> <%= item.ChatperInfo() %>: <%= new HtmlHidden("Guid", recommendVideo.Guid)%> <%= new HtmlText("ParentVideo_Name", ViewData.Val("ParentVideo.Name",recommendVideo)) { ID="ParentVideo_Name"+recommendVideo.Guid, ReadOnly = true, Class = "ipt-t ipt-t-dft" }%> <%= new HtmlHidden("ParentVideo", ViewData.Val("ParentVideo.Guid", recommendVideo)) { ID="ParentVideo"+recommendVideo.Guid }%> [<%= DefineEnum.选择.Define() %>] <%= Define.Get("RecommendVideo_自定义名称") %>: <%= new HtmlText("DefineName", ViewData.Val("DefineName",recommendVideo)) {Class = "ipt-t ipt-t-dft" }%> <%= Define.Get("RecommendVideo_自定义地址") %>: <%= new HtmlText("DefineUrl", ViewData.Val("DefineUrl",recommendVideo)) { Class = "ipt-t ipt-t-dft width400" }%>