public static void Create(Hashtable values) { DAL.Content r = new DAL.Content { PortalID = BLL.Content.PortalID, Title = values["Title"].ToString(), URL = values["Title"] + ".aspx", ContentText = values["ContentText"].ToString(), ContentTypeID = int.Parse(values["ContentTypeID"].ToString()), IsPublished = bool.Parse(values["Published"].ToString()), IsMenu = bool.Parse(values["IsMenu"].ToString()), UserID = (int)HttpContext.Current.Session["UserID"], DisplayOrder = GetMaxDisplayOrder() + 1, CreateDate = DateTime.Now, StartMethod = values["StartMethod"].ToString() }; Utils.DbContext.AddToContents(r); Utils.DbContext.SaveChanges(); }
public Boolean RemoveTicker(Content _content) { InitDB(); using (var session = documentStore.OpenSession()) { Content deleteContent = new Content(); deleteContent = session.Load<Content>(_content.Id); session.Delete(deleteContent); session.SaveChanges(); return true; } return false; }
public Boolean InsertOrUpdateTicker(Content ticker) { InitDB(); return true; }
public string InsertMedia(Content media) { InitDB(); string functionResult = "0"; using (var session = documentStore.OpenSession()) { Content newMedia = new Content(); newMedia.Contenttype = media.Contenttype; newMedia.Filesize = media.Filesize; newMedia.Filelocation = media.Filelocation; newMedia.Description = media.Description; newMedia.Importdate = media.Importdate; newMedia.Metadata1 = media.Metadata1; newMedia.Metadata2 = media.Metadata2; newMedia.Metadata3 = media.Metadata3; newMedia.Metadata4 = media.Metadata4; newMedia.Metadata5 = media.Metadata5; newMedia.Metadata6 = media.Metadata6; newMedia.Metadata7 = media.Metadata7; newMedia.Metadata8 = media.Metadata8; newMedia.Metadata9 = media.Metadata9; newMedia.Name = media.Name; newMedia.Snapshot = media.Snapshot; newMedia.Uploadstatus = -1; session.Store(newMedia); session.SaveChanges(); return newMedia.Id; } return "0"; }
public string ChangeMedia(Content mediaName) { InitDB(); Template newTemplate = new Template(); Content newMedia = new Content(); string functionResult = "0"; using (var session = documentStore.OpenSession()) { newMedia = session.Load<Content>(mediaName.Id); newMedia.Contenttype = mediaName.Contenttype; newMedia.Metadata1 = mediaName.Metadata1; newMedia.Metadata2 = mediaName.Metadata2; newMedia.Metadata3 = mediaName.Metadata3; newMedia.Metadata4 = mediaName.Metadata4; newMedia.Metadata5 = mediaName.Metadata5; newMedia.Metadata6 = mediaName.Metadata6; newMedia.Metadata7 = mediaName.Metadata7; newMedia.Metadata8 = mediaName.Metadata8; newMedia.Metadata9 = mediaName.Metadata9; newMedia.Importdate = mediaName.Importdate; newMedia.Filesize = mediaName.Filesize; newMedia.Filelocation = mediaName.Filelocation; newMedia.Description = mediaName.Description; newMedia.Name = mediaName.Name; newMedia.Snapshot = mediaName.Snapshot; newMedia.Uploadstatus = mediaName.Uploadstatus; session.Store(newMedia); functionResult = newMedia.Id; } //newMedia.LoadByPrimaryKey((long)mediaName.Id); //AddUpdateDelta("content"); return functionResult; }
/// <summary> /// Create a new Content object. /// </summary> /// <param name="contentID">Initial value of the ContentID property.</param> /// <param name="displayOrder">Initial value of the DisplayOrder property.</param> /// <param name="createDate">Initial value of the CreateDate property.</param> /// <param name="portalID">Initial value of the PortalID property.</param> /// <param name="userID">Initial value of the UserID property.</param> /// <param name="title">Initial value of the Title property.</param> /// <param name="uRL">Initial value of the URL property.</param> /// <param name="contentTypeID">Initial value of the ContentTypeID property.</param> public static Content CreateContent(global::System.Int32 contentID, global::System.Int32 displayOrder, global::System.DateTime createDate, global::System.Int32 portalID, global::System.Int32 userID, global::System.String title, global::System.String uRL, global::System.Int32 contentTypeID) { Content content = new Content(); content.ContentID = contentID; content.DisplayOrder = displayOrder; content.CreateDate = createDate; content.PortalID = portalID; content.UserID = userID; content.Title = title; content.URL = uRL; content.ContentTypeID = contentTypeID; return content; }
/// <summary> /// Deprecated Method for adding a new object to the Contents EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToContents(Content content) { base.AddObject("Contents", content); }
public void StartMedia(Content contentItemToPlay) { string contentFile = ""; string fileType = ""; if (contentItemToPlay.Filelocation.ToLower().Substring(0,3)=="mms") { Gurock.SmartInspect.SiAuto.Main.LogMessage("This is an action (mms)"); contentFile = @contentItemToPlay.Filelocation; fileType = "video"; } else { contentFile = @"c:\content\_media\" + System.IO.Path.GetFileName(contentItemToPlay.Filelocation); } UserControlState = 1; //Set the State of the Control to Busy Gurock.SmartInspect.SiAuto.Main.LogMessage("StartMedia: "+contentFile); string fileExtension = System.IO.Path.GetExtension(contentFile).ToLower(); if (fileExtension == ".swf") fileType = "flash"; if (fileExtension == ".wmv" || fileExtension == ".mpg" || fileExtension == ".avi") fileType = "video"; if (fileExtension == ".bmp" || fileExtension == ".jpg" || fileExtension == ".png") fileType = "image"; //IMAGETimer if (fileType == "image") { ImageSourceConverter imgConv = new ImageSourceConverter(); ImageSource imageSource = (ImageSource)imgConv.ConvertFromString(@contentFile); imageA.Source = imageSource; imageA.Visibility = Visibility.Visible; mediaElementA.Visibility = Visibility.Collapsed; mediaElementB.Visibility = Visibility.Collapsed; winformsHost1.Visibility = Visibility.Hidden; winformsHost2.Visibility = Visibility.Hidden; imageTimer.Interval = new TimeSpan(0, 0, Convert.ToInt16(contentItemToPlay.Metadata1)); imageTimer.Start(); MainWindow.KeepAliveTicker++; } //VIDEO if (fileType == "video") { if (MediaStateA == 0) { MediaStateA = 1; MediaStateB = 0; Double vol = 0; try { vol = Convert.ToDouble(contentItemToPlay.Metadata9); } catch (Exception ex) { vol = 0; } mediaElementA.Volume = vol; mediaElementA.Source = new Uri(@contentFile); SiAuto.Main.LogMessage("Playing on MediaElement A: " + @contentFile); mediaElementA.Play(); winformsHost1.Visibility = Visibility.Hidden; winformsHost2.Visibility = Visibility.Hidden; imageA.Visibility = Visibility.Hidden; MainWindow.KeepAliveTicker++; } else { MediaStateA = 0; MediaStateB = 1; Double vol = 0; try { vol = Convert.ToDouble(contentItemToPlay.Metadata9); } catch (Exception ex) { vol = 0; } mediaElementB.Volume = vol; mediaElementB.Source = new Uri(@contentFile); SiAuto.Main.LogMessage("Playing on MediaElement B: " + @contentFile); mediaElementB.Play(); winformsHost1.Visibility = Visibility.Hidden; winformsHost2.Visibility = Visibility.Hidden; imageA.Visibility = Visibility.Hidden; MainWindow.KeepAliveTicker++; } } //FLASH if (fileType == "flash") { { if (flashstate == 1) { PlayFlashOn1(@contentFile); MainWindow.KeepAliveTicker++; } else { PlayFlashOn2(@contentFile); MainWindow.KeepAliveTicker++; } mediaElementA.Visibility = Visibility.Hidden; mediaElementB.Visibility = Visibility.Hidden; imageA.Visibility = Visibility.Hidden; } } #region DSTV ////DSTV //if (assetPlaying.Type == "dstv") //{ // if (MediaStateA == 0) // { // MediaStateA = 1; // MediaStateB = 0; // mediaElementA.Source = new Uri(@assetPlaying.Url); // SiAuto.Main.LogMessage("Playing on MediaElementA"); // mediaElementA.Play(); // manualContentEndTimer.Interval = new TimeSpan(0, 0, assetPlaying.Duration); // manualContentEndTimer.Start(); // } // else // { // MediaStateA = 0; // MediaStateB = 1; // mediaElementB.Source = new Uri(@assetPlaying.Url); // SiAuto.Main.LogMessage("Playing on MediaElementB"); // mediaElementB.Play(); // manualContentEndTimer.Interval = new TimeSpan(0, 0, assetPlaying.Duration); // manualContentEndTimer.Start(); // } //} #endregion #region Powerpoint ////POWERPOINT //if (assetPlaying.Type == "powerpoint") //{ // { // //x y width height flash // // KillProcess("FlashNow"); // // string PowerPointString = assetPlaying.MetaD + " " + @"c:\content\powerpoint\" + assetPlaying.Url; // string PowerPointString = ControlDimensions+" "+ @"c:\content\powerpoint\" + assetPlaying.Url; // SiAuto.Main.LogMessage(PowerPointString); // try // { // Process.Start(@"c:\content\bin\PPT.exe", PowerPointString); // } // catch (Exception ex) // { // SiAuto.Main.LogMessage(ex.Message); // } // mediaElementA.Visibility = Visibility.Hidden; // mediaElementB.Visibility = Visibility.Hidden; // // manualPPTEndTimer.Start(); // } //} #endregion #region Image ////IMAGE //if (assetPlaying.Type == "image" || assetPlaying.Type == "background") //{ // ImageSourceConverter imgConv = new ImageSourceConverter(); // ImageSource imageSource = (ImageSource)imgConv.ConvertFromString(@"c:\content\image\"+assetPlaying.Url); // imageA.Source = imageSource; // if (MediaType == "image") // { // manualContentEndTimer.Interval = new TimeSpan(0, 0, assetPlaying.Duration); // manualContentEndTimer.Start(); // }; // mediaElementA.Visibility = Visibility.Hidden; // mediaElementB.Visibility = Visibility.Hidden; //} #endregion }
public void DequeueContent() { try { SiAuto.Main.LogMessage("DQ CONTENT"); DAL.Content currentContent = new DAL.Content(); if (ContentQueue.Count() <= 0) { ResetContentQueue(); } if (ContentQueue.Count > 0) { SiAuto.Main.LogMessage("Running Q - DQ"); currentContent = ContentQueue.Dequeue(); StartMedia(currentContent); }; } catch (Exception ex) { } }