コード例 #1
0
        private void previewTidbit()
        {
            if (_selectedTidbit != null)
            {
                PlayerCommand commandToSend = new PlayerCommand();

                commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
                commandToSend.CommandID = Guid.NewGuid().ToString();
                commandToSend.Parameters = new List<CommandParameter>();
                commandToSend.Parameters.Add(new CommandParameter("TemplateName", "TeamTidbitPreview"));

                XmlDataRow xmlRow = new XmlDataRow();

                xmlRow.Add("TIDBIT_1", _selectedTidbit.TidbitText);
                xmlRow.Add("TRICODE_1", _team.Tricode);
                xmlRow.Add("SWATCH_1", _team.SwatchTga.LocalPath);
                xmlRow.Add("TEAMLOGO_1", _team.LogoTgaNoKey.LocalPath);

                commandToSend.TemplateData = xmlRow.GetXMLString();

                OnSendCommand(commandToSend, null);
            }
        }
コード例 #2
0
        private void nextOnTheClock()
        {
            _takeClock = false;

            Global.GlobalCollections.Instance.LoadOnTheClock();

            PlayerCommand commandToSend;

            //send a command to change the clock on-air
            commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.CommandID = Guid.NewGuid().ToString();
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Clock"));

            XmlDataRow xmlRow = new XmlDataRow();

            if (GlobalCollections.Instance.OnTheClock != null)
            {
                xmlRow.Add("ROUND_1", Global.GlobalCollections.Instance.OnTheClock.Round.ToString());
                xmlRow.Add("PICK_1", Global.GlobalCollections.Instance.OnTheClock.OverallPick.ToString());

                if (Global.GlobalCollections.Instance.OnTheClock.Team.LogoTgaNoKey != null)
                {
                    xmlRow.Add("LOGO_1", Global.GlobalCollections.Instance.OnTheClock.Team.LogoTgaNoKey.LocalPath);
                }

                if (Global.GlobalCollections.Instance.OnTheClock.Team.SwatchTga != null)
                {
                    xmlRow.Add("SWATCH_1", Global.GlobalCollections.Instance.OnTheClock.Team.SwatchTga.LocalPath);
                }

                xmlRow.Add("ABBREV_4_1", Global.GlobalCollections.Instance.OnTheClock.Team.Tricode);
            }

            xmlRow.Add("CLOCK_OVERLAY", "ON THE CLOCK");
            xmlRow.Add("CLOCK", "");

            commandToSend.TemplateData = xmlRow.GetXMLString();
            commandToSend.CommandID = Guid.NewGuid().ToString();

            updateTotem(true);

            sendCommandToPlayout(commandToSend);

            //hide the current selection template
            commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "HidePage");
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "CurrentSelection"));
            //commandToSend.Parameters.Add(new CommandParameter("QueueCommand", "true"));

            sendCommandToPlayout(commandToSend);

            //show the hashtag on the right side
            commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "RightLogo"));

            xmlRow = new XmlDataRow();

            string hashtag = "";

            if (OTCHashtag && SelectedRightLogo != null && SelectedRightLogo.FileName.ToUpper().IndexOf("HASHTAG") > -1)
            {
                hashtag = Global.GlobalCollections.Instance.OnTheClock.Team.Hashtag;
            }

            xmlRow.Add("TIDBIT_1", hashtag);

            commandToSend.TemplateData = xmlRow.GetXMLString();
            commandToSend.CommandID = Guid.NewGuid().ToString();

            sendCommandToPlayout(commandToSend);
        }
コード例 #3
0
        private void showInterruption()
        {
            if (this.SelectedTidbitText != null && this.SelectedTidbitText != "")
            {
                if (OnStopCycle != null) OnStopCycle();

                PlayerCommand commandToSend = new PlayerCommand();

                commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
                commandToSend.CommandID = Guid.NewGuid().ToString();
                commandToSend.Parameters = new List<CommandParameter>();
                commandToSend.Parameters.Add(new CommandParameter("TemplateName", Category.Template));

                XmlDataRow xmlRow = new XmlDataRow();

                if (Category.LogoTga != null)
                {
                    xmlRow.Add("CHIP_1", Category.LogoTga.LocalPath);
                }

                if (Category.SwatchFile != null)
                {
                    xmlRow.Add("SWATCH_1", Category.SwatchFile.LocalPath);
                }

                xmlRow.Add("TIDBIT_1", SelectedTidbitText.Trim());

                commandToSend.TemplateData = xmlRow.GetXMLString();

                OnSendCommand(commandToSend, null);
            }
        }
コード例 #4
0
        private void updateTotem(bool changeTotem = false)
        {
            PlayerCommand commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.CommandID = Guid.NewGuid().ToString();
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Next"));

            XmlDataRow xmlRow = new XmlDataRow();

            Pick nextPick1 = null;
            Pick nextPick2 = null;

            if (Global.GlobalCollections.Instance.OnTheClock != null)
            {
                nextPick1 = (Pick)Global.GlobalCollections.Instance.DraftOrder.SingleOrDefault(p => p.OverallPick == Global.GlobalCollections.Instance.OnTheClock.OverallPick + 1);
                nextPick2 = (Pick)Global.GlobalCollections.Instance.DraftOrder.SingleOrDefault(p => p.OverallPick == Global.GlobalCollections.Instance.OnTheClock.OverallPick + 2);
            }

            if (nextPick1 != null)
            {
                xmlRow.Add("ABBREV_4_1", nextPick1.Team.Tricode);

                if (nextPick2 != null)
                {
                    xmlRow.Add("ABBREV_4_2", nextPick2.Team.Tricode);
                }
                else
                {
                    xmlRow.Add("ABBREV_4_2", "");
                }
            }
            else
            {
                xmlRow.Add("ABBREV_4_1", "");
                xmlRow.Add("ABBREV_4_2", "");
            }

            if (changeTotem)
            {
                xmlRow.Add("CHANGE_TOTEM_FLAG", "1");
            }
            else
            {
                xmlRow.Add("CHANGE_TOTEM_FLAG", "");
            }

            commandToSend.TemplateData = xmlRow.GetXMLString();

            sendCommandToPlayout(commandToSend);
        }
コード例 #5
0
        private void revealCurrentSelection()
        {
            if (_currentPlayer != null)
            {
                PlayerCommand commandToSend = new PlayerCommand();

                commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
                commandToSend.CommandID = Guid.NewGuid().ToString();
                commandToSend.Parameters = new List<CommandParameter>();
                commandToSend.Parameters.Add(new CommandParameter("TemplateName", "CurrentSelection"));

                XmlDataRow xmlRow = new XmlDataRow();

                xmlRow.Add("CURRENT_SELECTION_STATE", "REVEAL");

                string curSelStr = _currentPlayer.FirstName + " " + _currentPlayer.LastName + " <font EventFranklinGothic Book>" + _currentPlayer.Position + " - " + _currentPlayer.School.Name + "<\\font>";

                if (_currentPlayer.TradeTidbit.Trim() != "")
                {
                    curSelStr += " " + _currentPlayer.TradeTidbit;
                }

                xmlRow.Add("PLAYER_1", curSelStr);

                commandToSend.TemplateData = xmlRow.GetXMLString();

                OnSendCommand(commandToSend, null);

                if (DbConnection.SelectPlayer(_currentPlayer))
                {
                    OnSetStatusBarMsg(_currentPlayer.FirstName + " " + _currentPlayer.LastName + " selected", "Green");

                    Global.GlobalCollections.Instance.LoadPlayers();

                    if (RefreshPlayersAfterSelection)
                    {
                        OnRefreshPlayers();  //refresh the players on the PlayerTabVM
                    }
                }

                _currentPlayerTidbit = 0;

                Global.GlobalCollections.Instance.LoadOnTheClock();

                OnResetCycle();
            }
        }
コード例 #6
0
        private void showPollResults()
        {
            string[] poll = DbConnection.GetPoll(true);

            if (poll != null)
            {
                string pollChip = ConfigurationManager.AppSettings["PollChipDirectory"].ToString() + "\\" + _selectedPollChip.FileName;

                if (File.Exists(pollChip))
                {
                    stopCycle();

                    PlayerCommand commandToSend;

                    commandToSend = new PlayerCommand();

                    commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
                    commandToSend.CommandID = Guid.NewGuid().ToString();
                    commandToSend.Parameters = new List<CommandParameter>();
                    commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Poll"));

                    XmlDataRow xmlRow = new XmlDataRow();

                    xmlRow.Add("TITLE_1", poll[0]);
                    xmlRow.Add("TIDBIT_1", poll[1]);

                    xmlRow.Add("CHIP_1", pollChip);
                    xmlRow.Add("VENT_SWATCH_1", "Images\\Swatches\\black_swatch.tga");

                    commandToSend.TemplateData = xmlRow.GetXMLString();

                    sendCommandToPlayout(commandToSend);
                }
            }
        }
コード例 #7
0
        private void updateClock()
        {
            PlayerCommand commandToSend = new PlayerCommand();

            XmlDataRow xmlRow = new XmlDataRow();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.Parameters = new List<CommandParameter>();

            if (_takeClock)
            {
                if (_playlistTabVM.SelectedPlaylist != null)
                {
                    switch (_playlistTabVM.SelectedPlaylist.PlaylistName.ToUpper())
                    {
                        case "PROMPTER":
                            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Prompter"));
                            break;
                        case "BREAK CLOCK":
                            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "BreakClock"));
                            break;
                        default:
                            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Clock"));
                            xmlRow.Add("TURN_CLOCK_RED", _clockRedUnderMin.ToString().ToUpper());
                            break;
                    }
                }
                else
                {
                    commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Clock"));
                    xmlRow.Add("TURN_CLOCK_RED", _clockRedUnderMin.ToString().ToUpper());
                }

                if (_playlistTabVM.SelectedPlaylist != null)
                {
                    if (_playlistTabVM.SelectedPlaylist.PlaylistName.ToUpper() != "BREAK CLOCK" && _playlistTabVM.SelectedPlaylist.PlaylistName.ToUpper() != "PROMPTER")
                    {
                        switch (_clockSeconds)
                        {
                            case 0:
                                if (_prevClockSeconds != 0)
                                {
                                    xmlRow.Add("CLOCK_OVERLAY", "PICK IS IN");
                                }
                                break;
                            case 60:
                                if (_clockRedUnderMin)
                                {
                                    xmlRow.Add("CLOCK_COLOR", "RED");
                                }
                                break;
                            default:
                                if (_clockSeconds > _prevClockSeconds && _prevClockSeconds > 0)
                                {
                                    xmlRow.Add("CLOCK_OVERLAY", "PICK IS IN");
                                    xmlRow.Add("CLOCK", "");
                                    _pickIsIn = true;
                                }
                                else
                                {
                                    //if (_useCountdownClock)
                                    //{
                                    //    xmlRow.Add("CLOCK", _countdownClock);
                                    //}
                                    //else
                                    //{
                                    //    if (_pickIsIn == false)
                                    //    {
                                    //        xmlRow.Add("CLOCK", _clock);
                                    //    }
                                    //}

                                    commandToSend.Parameters.Add(new CommandParameter("MergeDataWithoutTransitions", "true"));
                                }

                                break;
                        }

                        if (_clockSeconds == 0)
                        {
                            _takeClock = false;

                        }
                    }
                }
                else
                {
                    _takeClock = true;
                }
            }
            else
            {
                //commandToSend.Parameters.Add(new CommandParameter("MergeDataWithoutTransitions", "true"));
            }

            _prevClockSeconds = _clockSeconds;

            if (_useCountdownClock)
            {
                xmlRow.Add("CLOCK", _countdownClock);
            }
            else
            {
                if (_pickIsIn == false)
                {
                    xmlRow.Add("CLOCK", _clock);
                }
            }

            commandToSend.TemplateData = xmlRow.GetXMLString();

            _clockTalker.Talk(commandToSend);
        }
コード例 #8
0
        private void updateHashtag()
        {
            //show the hashtag on the right side
            PlayerCommand commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "RightLogo"));

            XmlDataRow xmlRow = new XmlDataRow();

            string hashtag = "";

            if (OTCHashtag && SelectedRightLogoFilename.ToUpper().IndexOf("HASHTAG") > -1)
            {
                hashtag = Global.GlobalCollections.Instance.OnTheClock.Team.Hashtag;
            }

            xmlRow.Add("TIDBIT_1", hashtag);

            commandToSend.TemplateData = xmlRow.GetXMLString();
            commandToSend.CommandID = Guid.NewGuid().ToString();

            OnSendCommand(commandToSend, null);
        }
コード例 #9
0
ファイル: DbConnection.cs プロジェクト: Sandy4321/draft-admin
        public static List<XmlDataRow> GetPlaylistItemData(PlaylistItem playlistItem)
        {
            List<XmlDataRow> xmlDataRows = new List<XmlDataRow>();

            OracleConnection cnO = null;
            OracleCommand cmdO = null;
            OracleDataAdapter adpO = null;
            OracleCommandBuilder bldrO = null;
            OracleDataReader rdrO = null;

            MySqlConnection cnM = null;
            MySqlCommand cmdM = null;
            MySqlDataReader rdrM = null;

            DataTable tbl = null;
            DataSet ds = null;

            string teamLogo = " ";
            string teamSwatch = " ";
            string teamAbbrev = "";

            try
            {
                tbl = new DataTable();

                List<Int32> teamIds = new List<Int32>();

                Int32 teamId = 0;

                FileInfo queryFile = null;

                if (playlistItem.Query != null && playlistItem.Query.ToString().Trim() != "")
                {
                    queryFile = new FileInfo(ConfigurationManager.AppSettings["QueryDirectory"].ToString() + "\\" + playlistItem.Query);
                }

                string query = "";

                if (queryFile != null)
                {
                    if (queryFile.Exists)
                    {
                        query = File.ReadAllText(queryFile.FullName);
                    }
                    else
                    {
                        query = playlistItem.Query;
                    }

                    Object[] parms = null;

                    switch (playlistItem.Datasource.ToUpper())
                    {
                        case "SDR":
                            cnO = createConnectionSDR();

                            cmdO = new OracleCommand();
                            cmdO.BindByName = true;

                            //add the parms to the query/stored proc if there are any
                            if (playlistItem.QueryParameters.ToString() != "")
                            {
                                parms = playlistItem.QueryParameters.Split('|');

                                for (int i = 0; i < parms.Length; i++)
                                {
                                    string[] parmval = parms[i].ToString().Split('=');

                                    string parm = parmval[0].ToString();
                                    string val = parmval[1].ToString();

                                    if (val.Substring(0, 1) == "'" && val.Substring(val.Length - 1, 1) == "'")
                                    {
                                        string parmStr = val.Substring(1, val.Length - 2);

                                        if (parmStr.Length > 0 && parmStr.Substring(0, 1) == "#")
                                        {
                                            if (ConfigurationManager.AppSettings[parmStr.Substring(1)] != null) //pull the value from the app.config file
                                            {
                                                parmStr = ConfigurationManager.AppSettings[parmStr.Substring(1)].ToString();
                                            }
                                        }

                                        if (parmStr.IndexOf(",") > -1 || (parm.IndexOf('(') > -1 && parm.IndexOf(')') > -1)) //this is an array
                                        {
                                            cmdO.Parameters.Add(new OracleParameter(parm, OracleDbType.Varchar2));

                                            string[] arrVals = parmStr.Split(',');

                                            Int32[] arrSize = new Int32[arrVals.Length - 1];

                                            for (int p = 0; p < arrVals.Length - 1; p++)
                                            {
                                                arrSize[p] = arrVals[p].Length;
                                            }

                                            cmdO.Parameters[parm].CollectionType = OracleCollectionType.PLSQLAssociativeArray;
                                            cmdO.Parameters[parm].Value = arrVals;
                                            cmdO.Parameters[parm].Size = arrVals.Length;
                                            cmdO.Parameters[parm].ArrayBindSize = arrSize;

                                            OracleParameterStatus[] arrStatus = new OracleParameterStatus[1];
                                            arrStatus[0] = 0;

                                            cmdO.Parameters[parm].ArrayBindStatus = arrStatus;
                                            cmdO.Parameters[parm].Direction = ParameterDirection.Input;
                                        }
                                        else
                                        {
                                            cmdO.Parameters.Add(new OracleParameter(parm, OracleDbType.Varchar2, parmStr, ParameterDirection.Input));
                                        }

                                    }
                                    else if (val.ToUpper() == "NULL")
                                    {
                                        cmdO.Parameters.Add(new OracleParameter(parm, OracleDbType.NVarchar2, DBNull.Value, ParameterDirection.Input));
                                    }
                                    else
                                    {
                                        if (val.ToString().ToUpper() != "OTC")
                                        {
                                            if (val.Substring(0, 1) == "#")
                                            {
                                                if (ConfigurationManager.AppSettings[val.Substring(1)] != null)
                                                {
                                                    val = ConfigurationManager.AppSettings[val.Substring(1)];
                                                }
                                            }

                                            cmdO.Parameters.Add(new OracleParameter(parm, OracleDbType.Int32, val, ParameterDirection.Input));
                                        }
                                    }

                                    if (parm.ToUpper() == "INTEAMID")
                                    {
                                        //adding a special case for the On The Clock (connected) items, to add the team swatch to the dataset
                                        if (val.ToString().ToUpper() == "OTC")
                                        {
                                            teamId = GlobalCollections.Instance.OnTheClock.Team.ID;
                                            cmdO.Parameters.Add(new OracleParameter(parm, OracleDbType.Int32, teamId, ParameterDirection.Input));
                                        }
                                        else
                                        {
                                            if (val.Substring(0, 1) == "#")
                                            {
                                                if (ConfigurationManager.AppSettings[val.Substring(1)] != null)
                                                {
                                                    val = ConfigurationManager.AppSettings[val.Substring(1)];
                                                }
                                            }

                                            Int32.TryParse(val, out teamId);
                                        }

                                        teamIds.Add(teamId);
                                    }

                                }
                            }

                            if (playlistItem.QueryType.ToUpper() == "SP")
                            {
                                cmdO.Connection = cnO;
                                cmdO.CommandText = playlistItem.Query;
                                cmdO.CommandType = System.Data.CommandType.StoredProcedure;
                                cmdO.BindByName = true;

                                cmdO.Parameters.Add(new OracleParameter(playlistItem.OutputParameter, OracleDbType.RefCursor, ParameterDirection.Output));

                                adpO = new OracleDataAdapter(cmdO);

                                ds = new DataSet();

                                adpO.Fill(ds);

                                tbl = ds.Tables[0];
                            }
                            else
                            {
                                if (query != "")
                                {
                                    cmdO.CommandText = query.ToString();
                                    cmdO.Connection = cnO;
                                    rdrO = cmdO.ExecuteReader();
                                    tbl.Load(rdrO);
                                    rdrO.Close();
                                    rdrO.Dispose();
                                }

                            }

                            break;
                        case "MYSQL":
                            {
                                cnM = createConnectionMySql();
                                cmdM = new MySqlCommand(query.ToString(), cnM);

                                if (playlistItem.QueryType.ToUpper() == "SP")
                                {
                                    cmdM.CommandType = System.Data.CommandType.StoredProcedure;

                                    if (playlistItem.QueryParameters.ToString() != "")
                                    {
                                        parms = playlistItem.QueryParameters.Split('|');

                                        for (int i = 0; i < parms.Length; i++)
                                        {
                                            string[] parmval = parms[i].ToString().Split('=');

                                            string parm = parmval[0].ToString();
                                            string val = parmval[1].ToString();

                                            if (parm.ToUpper() == "INTEAMID")
                                            {
                                                //adding a special case for the On The Clock (connected) items, to add the team swatch to the dataset
                                                if (val.ToString().ToUpper() == "OTC")
                                                {
                                                    teamId = GlobalCollections.Instance.OnTheClock.Team.ID;
                                                    val = teamId.ToString();
                                                }
                                                else
                                                {
                                                    if (val.Substring(0, 1) == "#")
                                                    {
                                                        if (ConfigurationManager.AppSettings[val.Substring(1)] != null)
                                                        {
                                                            val = ConfigurationManager.AppSettings[val.Substring(1)];
                                                        }
                                                    }

                                                    Int32.TryParse(val, out teamId);
                                                }

                                                teamIds.Add(teamId);
                                            }

                                            cmdM.Parameters.AddWithValue(parm, val);
                                        }
                                    }
                                }

                                rdrM = cmdM.ExecuteReader();
                                tbl.Load(rdrM);
                                rdrM.Close();
                                rdrM.Dispose();
                            }

                            break;
                        case "WS":
                            parms = playlistItem.QueryParameters.Split('|');

                            Object[] wsParms = new Object[parms.Length];

                            for (int i = 0; i < parms.Length; i++)
                            {
                                string[] parmval = parms[i].ToString().Split('=');

                                string parm = parmval[0].ToString();
                                string val = parmval[1].ToString();

                                val = val.Replace("'", "");

                                if (val.Length > 0 && val.Substring(0, 1) == "#")
                                {
                                    if (ConfigurationManager.AppSettings[val.Substring(1)] != null)
                                    {
                                        val = ConfigurationManager.AppSettings[val.Substring(1)];
                                    }
                                }

                                wsParms[i] = val;
                            }

                            DataSet dsTemp = null;

                            try
                            {
                                dsTemp = WebService.CallFunctionByName(playlistItem.Query, wsParms);
                            }
                            catch
                            {
                                Debug.Print("Web Service call failed");
                                dsTemp = null;
                            }

                            if (dsTemp != null)
                            {
                                tbl = dsTemp.Tables[0];
                            }

                            break;
                    }

                }

                if (playlistItem.AdditionalDataFields != null)
                {
                    foreach (KeyValuePair<string, string> pair in playlistItem.AdditionalDataFields)
                    {
                        if (pair.Key.ToString().ToUpper().IndexOf("INTEAMID") > -1)
                        {
                            string val = pair.Value;

                            if (val.Substring(0, 1) == "#")
                            {
                                if (ConfigurationManager.AppSettings[val.Substring(1)] != null)
                                {
                                    val = ConfigurationManager.AppSettings[val.Substring(1)];
                                }
                            }

                            Int32.TryParse(val, out teamId);

                            teamIds.Add(teamId);
                        }
                    }
                }

                if (tbl.Rows.Count == 0 && playlistItem.Query != null)
                {
                    Debug.Print("No data returned by " + playlistItem.Query);
                }

                XmlDataRow xmlDataRow;

                switch (playlistItem.MaxRows)
                {
                    case 0:
                        //just add a blank data row
                        xmlDataRow = new XmlDataRow();
                        xmlDataRows.Add(xmlDataRow);
                        break;
                    case 1:
                        foreach (DataRow row in tbl.Rows)
                        {
                            //DataRow row = tbl.Rows[playlistItem.RowIndex];

                            xmlDataRow = new XmlDataRow();

                            foreach (DataColumn col in tbl.Columns)
                            {
                                xmlDataRow.Add(col.ColumnName, row[col.ColumnName].ToString());
                            }

                            if (playlistItem.Description.ToUpper() != "PROMPTER")
                            {
                                xmlDataRow.Add("PANEL_TYPE", playlistItem.PanelType);
                                xmlDataRow.Add("PAGE_TYPE", playlistItem.PageType);
                            }

                            if (playlistItem.AdditionalDataFields != null)
                            {
                                foreach (KeyValuePair<string, string> pair in playlistItem.AdditionalDataFields)
                                {
                                    if (pair.Key.ToString().ToUpper().IndexOf("INTEAMID") == -1) //non-teamid items
                                    {
                                        //possibly put a db field to determine if additional fields should be loaded only on the first item
                                        if (playlistItem.CurrentRow == 0)
                                        {
                                            xmlDataRow.Add(pair.Key, pair.Value);
                                        }
                                    }
                                }
                            }

                            xmlDataRows.Add(xmlDataRow);
                        }
                        break;
                    default:
                        xmlDataRow = new XmlDataRow();
                    int count = 1;

                    if (tbl.Rows.Count > 0)
                    {
                        foreach (DataRow row in tbl.Rows)
                        {
                            if (count > playlistItem.MaxRows)
                            {
                                xmlDataRows.Add(xmlDataRow);
                                xmlDataRow = new XmlDataRow();
                                count = 1;
                            }

                            foreach (DataColumn col in tbl.Columns)
                            {
                                xmlDataRow.Add(col.ColumnName + "_" + count.ToString(), row[col.ColumnName].ToString());
                            }

                            xmlDataRow.Add("PANEL_TYPE", playlistItem.PanelType);
                            xmlDataRow.Add("PAGE_TYPE", playlistItem.PageType);

                            if (playlistItem.AdditionalDataFields != null)
                            {
                                foreach (KeyValuePair<string, string> pair in playlistItem.AdditionalDataFields)
                                {
                                    //possibly put a db field to determine if additional fields should be loaded only on the first item
                                    if (playlistItem.CurrentRow == 0)
                                    {
                                        xmlDataRow.Add(pair.Key, pair.Value);
                                    }
                                }
                            }

                            count++;
                        }

                        ////blank out any extra fields that aren't filled...
                        for (int i = count; i <= playlistItem.MaxRows; i++)
                        {
                            foreach (DataColumn col in tbl.Columns)
                            {
                                xmlDataRow.Add(col.ColumnName + "_" + i.ToString(), "");
                            }
                        }

                        xmlDataRows.Add(xmlDataRow);  //adds in the last row
                    }
                        break;
                }

                //add all the team data to each xmlDataRow (so the team info is included with each data row)
                if (teamIds.Count > 0)
                {
                    for (var i = 0; i < teamIds.Count; i++)
                    {
                        Team team = null;

                        if (GlobalCollections.Instance.Teams != null)
                        {
                            team = (Team)GlobalCollections.Instance.Teams.SingleOrDefault(t => t.ID == teamIds[i]);

                            if (team == null)
                            {
                                team = (Team)GlobalCollections.Instance.Schools.SingleOrDefault(t => t.ID == teamIds[i]);
                            }
                        }
                        else
                        {
                            team = (Team)GlobalCollections.Instance.Schools.SingleOrDefault(t => t.ID == teamIds[i]);
                        }

                        if (team != null)
                        {

                            teamLogo = team.LogoTgaNoKey.LocalPath;

                            FileInfo file = new FileInfo(teamLogo);

                            if (file.Exists == false)
                            {
                                teamLogo = " ";
                            }

                            teamSwatch = team.SwatchTga.LocalPath;

                            file = new FileInfo(teamSwatch);

                            if (file.Exists == false)
                            {
                                teamSwatch = " ";
                            }

                            teamAbbrev = team.Tricode;

                            foreach (XmlDataRow xmlRow in xmlDataRows)
                            {
                                xmlRow.Add("LOGO_" + (i + 1).ToString(), teamLogo);
                                xmlRow.Add("ABBREV_4_" + (i + 1).ToString(), teamAbbrev);
                                xmlRow.Add("SWATCH_" + (i + 1).ToString(), teamSwatch);
                                xmlRow.Add("VENT_SWATCH_" + (i + 1).ToString(), teamSwatch);
                            }
                        }
                    }
                }

            }
            catch (Exception ex)
            {
                SetStatusBarMsg("Error getting playlist item data (item " + playlistItem.PlaylistOrder.ToString() + "): " + ex.Message, "Red");
                xmlDataRows.Clear();
            }
            finally
            {
                if (cmdO != null) cmdO.Dispose();
                if (cmdM != null) cmdM.Dispose();
                if (tbl != null) tbl.Dispose();

                if (cnO != null)
                {
                    cnO.Close();
                    cnO.Dispose();
                }

                if (cnM != null)
                {
                    cnM.Close();
                    cnM.Dispose();
                }
            }

            return xmlDataRows;
        }
コード例 #10
0
        private void showPlayerTidbits()
        {
            if (_currentPlayer.Tidbits != null)
            {
                if (_currentPlayerTidbit < _currentPlayer.Tidbits.Count)
                {
                    PlayerCommand commandToSend = new PlayerCommand();

                    commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
                    commandToSend.CommandID = Guid.NewGuid().ToString();
                    commandToSend.Parameters = new List<CommandParameter>();
                    commandToSend.Parameters.Add(new CommandParameter("TemplateName", "CurrentSelection"));

                    XmlDataRow xmlRow = new XmlDataRow();

                    xmlRow.Add("CURRENT_SELECTION_STATE", "SHOWTIDBITS");

                    string curSelStr = _currentPlayer.FirstName + " " + _currentPlayer.LastName + " <font EventFranklinGothic Book>" + _currentPlayer.Position + " - " + _currentPlayer.School.Name + "<\\font>";

                    if (_currentPlayer.TradeTidbit.Trim() != "")
                    {
                        curSelStr += " " + _currentPlayer.TradeTidbit;
                    }

                    xmlRow.Add("PLAYER_1", curSelStr);
                    xmlRow.Add("TIDBIT_1", _currentPlayer.Tidbits[_currentPlayerTidbit].TidbitText);

                    _currentPlayerTidbit++;

                    commandToSend.TemplateData = xmlRow.GetXMLString();

                    //raise an event to the main...
                    OnSendCommand(commandToSend, null);
                }
            }
        }
コード例 #11
0
        private void updateClock(bool isLastPick)
        {
            PlayerCommand commandToSend;

            //send a command to change the clock on-air
            commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Clock"));

            XmlDataRow xmlRow = new XmlDataRow();

            if (isLastPick)
            {
                xmlRow.Add("CLOCK_OVERLAY", "OVERLAY");
                xmlRow.Add("CHIP_1", ConfigurationManager.AppSettings["ClockOverlayDirectory"].ToString() + "\\" + ConfigurationManager.AppSettings["EndOfDraftChip"].ToString());
            }
            else
            {
                xmlRow.Add("ROUND_1", Global.GlobalCollections.Instance.OnTheClock.Round.ToString());
                xmlRow.Add("PICK_1", Global.GlobalCollections.Instance.OnTheClock.OverallPick.ToString());
                xmlRow.Add("LOGO_1", Global.GlobalCollections.Instance.OnTheClock.Team.LogoTgaNoKey.LocalPath);
                xmlRow.Add("SWATCH_1", Global.GlobalCollections.Instance.OnTheClock.Team.SwatchTga.LocalPath);
                xmlRow.Add("ABBREV_4_1", Global.GlobalCollections.Instance.OnTheClock.Team.Tricode);

                xmlRow.Add("CLOCK_OVERLAY", "ON THE CLOCK");
                xmlRow.Add("CLOCK", "");

                updateTotem(true);
            }

            //xmlRow.Add("CLOCK_COLOR", "NORMAL");

            commandToSend.TemplateData = xmlRow.GetXMLString();
            commandToSend.CommandID = Guid.NewGuid().ToString();

            OnSendCommand(commandToSend, null);
        }
コード例 #12
0
        private void showPickIsIn()
        {
            //int lastPick = Global.GlobalCollections.Instance.OnTheClock.OverallPick - 1;

            //CurrentPlayer = DbConnection.GetPlayerByPick(lastPick);

            PlayerCommand commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.CommandID = Guid.NewGuid().ToString();
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Clock"));

            XmlDataRow xmlRow = new XmlDataRow();

            xmlRow.Add("CLOCK_OVERLAY", "PICK IS IN");
            //xmlRow.Add("CLOCK_COLOR", "NORMAL");

            commandToSend.TemplateData = xmlRow.GetXMLString();

            OnSendCommand(commandToSend, null);
        }
コード例 #13
0
        private void showCurrentSelectionAction(object parameter)
        {
            AskShowCurrentSelection = false;

            PlayerCommand commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.CommandID = Guid.NewGuid().ToString();
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "CurrentSelection"));

            XmlDataRow xmlRow = new XmlDataRow();

            xmlRow.Add("CURRENT_SELECTION_STATE", "CURRENTSELECTION");
            xmlRow.Add("CHIP_1", Global.GlobalCollections.Instance.OnTheClock.Team.PickPlateTga.LocalPath);
            xmlRow.Add("SWATCH_1", Global.GlobalCollections.Instance.OnTheClock.Team.SwatchTga.LocalPath);

            commandToSend.TemplateData = xmlRow.GetXMLString();

            //raise an event to the main...
            OnSendCommand(commandToSend, null);
        }
コード例 #14
0
        private void showClock()
        {
            PlayerCommand commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.CommandID = Guid.NewGuid().ToString();
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Clock"));

            XmlDataRow xmlRow = new XmlDataRow();

            xmlRow.Add("CLOCK_OVERLAY", "CLOCK");

            commandToSend.TemplateData = xmlRow.GetXMLString();

            OnSendCommand(commandToSend, null);
        }
コード例 #15
0
        private void showClock()
        {
            _takeClock = true;
            _pickIsIn = false;

            PlayerCommand commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Clock"));

            XmlDataRow xmlRow = new XmlDataRow();

            xmlRow.Add("CLOCK_OVERLAY", "CLOCK");

            commandToSend.TemplateData = xmlRow.GetXMLString();

            sendCommandToPlayout(commandToSend);
        }
コード例 #16
0
        private void animateTradeAction(object parameter)
        {
            OnStopCycle();

            AskAnimateTrade = false;

            PlayerCommand commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Clock"));
            commandToSend.Parameters.Add(new CommandParameter("QueueCommand", "true"));

            XmlDataRow xmlRow = new XmlDataRow();

            xmlRow.Add("CLOCK_OVERLAY", "TRADE");
            xmlRow.Add("LOGO_1", Global.GlobalCollections.Instance.OnTheClock.Team.LogoTgaNoKey.LocalPath);
            xmlRow.Add("SWATCH_1", Global.GlobalCollections.Instance.OnTheClock.Team.SwatchTga.LocalPath);
            xmlRow.Add("ABBREV_4_1", Global.GlobalCollections.Instance.OnTheClock.Team.Tricode);

            commandToSend.TemplateData = xmlRow.GetXMLString();

            OnSendCommand(commandToSend, null);

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "TradeInterruption"));

            xmlRow = new XmlDataRow();

            xmlRow.Add("TIDBIT_1", _tradeString);

            commandToSend.TemplateData = xmlRow.GetXMLString();
            commandToSend.CommandID = Guid.NewGuid().ToString();

            OnSendCommand(commandToSend, null);

            _tradeString = "";
        }
コード例 #17
0
        private void showClockOverlay()
        {
            if (_selectedClockOverlay != null)
            {
                PlayerCommand commandToSend = new PlayerCommand();

                commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
                commandToSend.Parameters = new List<CommandParameter>();
                commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Clock"));

                XmlDataRow xmlRow = new XmlDataRow();

                if (_selectedClockOverlay.FileName == "<NONE>")
                {
                    xmlRow.Add("CLOCK_OVERLAY", "ON THE CLOCK");
                }
                else
                {
                    xmlRow.Add("CLOCK_OVERLAY", "OVERLAY");
                    xmlRow.Add("CHIP_1", ConfigurationManager.AppSettings["ClockOverlayDirectory"].ToString() + "\\" + _selectedClockOverlay.FileName);
                }

                commandToSend.TemplateData = xmlRow.GetXMLString();
                commandToSend.CommandID = Guid.NewGuid().ToString();

                sendCommandToPlayout(commandToSend);
            }
        }
コード例 #18
0
        private void cancelAnimateTradeAction(object parameter)
        {
            AskAnimateTrade = false;

            _tradeString = "";

            //maybe just hot change the team on the clock here?

            PlayerCommand commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Clock"));

            XmlDataRow xmlRow = new XmlDataRow();

            xmlRow.Add("CLOCK_OVERLAY", "ON THE CLOCK");
            xmlRow.Add("LOGO_1", Global.GlobalCollections.Instance.OnTheClock.Team.LogoTgaNoKey.LocalPath);
            xmlRow.Add("SWATCH_1", Global.GlobalCollections.Instance.OnTheClock.Team.SwatchTga.LocalPath);
            xmlRow.Add("ABBREV_4_1", Global.GlobalCollections.Instance.OnTheClock.Team.Tricode);

            commandToSend.TemplateData = xmlRow.GetXMLString();
            commandToSend.CommandID = Guid.NewGuid().ToString();

            //raise an event to the main...
            OnSendCommand(commandToSend, null);
        }
コード例 #19
0
        private void showRightLogo()
        {
            if (_selectedRightLogo != null)
            {
                PlayerCommand commandToSend = new PlayerCommand();

                commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
                commandToSend.Parameters = new List<CommandParameter>();
                commandToSend.Parameters.Add(new CommandParameter("TemplateName", "RightLogo"));

                XmlDataRow xmlRow = new XmlDataRow();

                if (_selectedRightLogo.FileName == "<NONE>")
                {
                    xmlRow.Add("CHIP_1", "");
                    xmlRow.Add("VISIBLE", "0");
                }
                else
                {
                    xmlRow.Add("CHIP_1", ConfigurationManager.AppSettings["RightLogoDirectory"].ToString() + "\\" + _selectedRightLogo.FileName);
                    xmlRow.Add("VISIBLE", "1");
                }

                if (_selectedRightLogo.FileName.ToUpper().IndexOf("HASHTAG") > -1)
                {
                    xmlRow.Add("TIDBIT_1", _rightSideHashtag);
                }

                commandToSend.TemplateData = xmlRow.GetXMLString();
                commandToSend.CommandID = Guid.NewGuid().ToString();

                sendCommandToPlayout(commandToSend);
            }
        }
コード例 #20
0
        private void hideTradeInterruption()
        {
            OnResetCycle();

            PlayerCommand commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Clock"));
            commandToSend.Parameters.Add(new CommandParameter("QueueCommand", "true"));

            XmlDataRow xmlRow = new XmlDataRow();

            xmlRow.Add("CLOCK_OVERLAY", "ON THE CLOCK");
            xmlRow.Add("LOGO_1", Global.GlobalCollections.Instance.OnTheClock.Team.LogoTgaNoKey.LocalPath);
            xmlRow.Add("SWATCH_1", Global.GlobalCollections.Instance.OnTheClock.Team.SwatchTga.LocalPath);
            xmlRow.Add("ABBREV_4_1", Global.GlobalCollections.Instance.OnTheClock.Team.Tricode);

            commandToSend.TemplateData = xmlRow.GetXMLString();
            commandToSend.CommandID = Guid.NewGuid().ToString();

            OnSendCommand(commandToSend, null);

            //show the hashtag on the right side
            commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "RightLogo"));

            xmlRow = new XmlDataRow();

            string hashtag = "";

            if (OTCHashtag && SelectedRightLogoFilename != null && SelectedRightLogoFilename.ToUpper().IndexOf("HASHTAG") > -1)
            {
                hashtag = Global.GlobalCollections.Instance.OnTheClock.Team.Hashtag;
            }

            xmlRow.Add("TIDBIT_1", hashtag);

            commandToSend.TemplateData = xmlRow.GetXMLString();
            commandToSend.CommandID = Guid.NewGuid().ToString();

            OnSendCommand(commandToSend, null);

            commandToSend = new PlayerCommand();

            commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "HidePage");
            commandToSend.CommandID = Guid.NewGuid().ToString();
            commandToSend.Parameters = new List<CommandParameter>();
            commandToSend.Parameters.Add(new CommandParameter("TemplateName", "TradeInterruption"));

            OnSendCommand(commandToSend, null);
        }
コード例 #21
0
        private void updateCountdownClock()
        {
            if (_useCountdownClock)
            {
                if (_playlistTabVM.SelectedPlaylist != null)
                {
                    PlayerCommand commandToSend = new PlayerCommand();

                    XmlDataRow xmlRow = new XmlDataRow();

                    commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");

                    commandToSend.Parameters = new List<CommandParameter>();

                    if (_playlistTabVM.SelectedPlaylist.PlaylistName.ToUpper() == "PROMPTER")
                    {
                        commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Prompter"));
                    }
                    else
                    {
                        commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Clock"));
                    }

                    commandToSend.Parameters.Add(new CommandParameter("MergeDataWithoutTransitions", "true"));

                    xmlRow.Add("CLOCK", _countdownClock);

                    commandToSend.TemplateData = xmlRow.GetXMLString();

                    _clockTalker.Talk(commandToSend);
                }
            }
        }
コード例 #22
0
        private void tradePickAction(object parameter)
        {
            AskTradePick = false;

            if (DbConnection.TradePick(_selectedPick, _selectedTradePickTeam))
            {
                if (Global.GlobalCollections.Instance.OnTheClock != null)
                {
                    int currentPick = Global.GlobalCollections.Instance.OnTheClock.OverallPick;

                    OnSetStatusBarMsg("#" + _selectedPick.OverallPick + " overall pick traded to " + _selectedTradePickTeam.Name, "Green");

                    int pick = _selectedPick.OverallPick;

                    string fromTeam = "";
                    string toTeam = "";

                    if (_selectedPick.Team.Name.ToUpper() == "49ERS")
                    {
                        fromTeam = "49ers";
                    }
                    else
                    {
                        fromTeam = _selectedPick.Team.Name.ToUpper();
                    }

                    if (_selectedTradePickTeam.Name.ToUpper() == "49ERS")
                    {
                        toTeam = "49ers";
                    }
                    else
                    {
                        toTeam = _selectedTradePickTeam.Name.ToUpper();
                    }

                    _tradeString = "<font EventFranklinGothic-Demi>" + fromTeam + "<\\font> trade pick to <font EventFranklinGothic-Demi>" + toTeam + "<\\font>";

                    Global.GlobalCollections.Instance.LoadDraftOrder();
                    Global.GlobalCollections.Instance.LoadOnTheClock();

                    if (pick == currentPick)
                    {
                        OnStopCycle();

                        PromptMessage = "Animate this trade?";
                        AskAnimateTrade = true;
                    }
                    else if (pick == currentPick + 1 || pick == currentPick + 2)
                    {
                        PlayerCommand commandToSend = new PlayerCommand();

                        commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
                        commandToSend.Parameters = new List<CommandParameter>();
                        commandToSend.Parameters.Add(new CommandParameter("TemplateName", "Next"));

                        XmlDataRow xmlRow = new XmlDataRow();

                        Pick nextPick1;
                        Pick nextPick2;

                        nextPick1 = (Pick)Global.GlobalCollections.Instance.DraftOrder.SingleOrDefault(p => p.OverallPick == currentPick + 1);
                        nextPick2 = (Pick)Global.GlobalCollections.Instance.DraftOrder.SingleOrDefault(p => p.OverallPick == currentPick + 2);

                        xmlRow.Add("ABBREV_4_1", nextPick1.Team.Tricode);
                        xmlRow.Add("ABBREV_4_2", nextPick2.Team.Tricode);
                        xmlRow.Add("CHANGE_TOTEM_FLAG", "0");

                        commandToSend.TemplateData = xmlRow.GetXMLString();
                        commandToSend.CommandID = Guid.NewGuid().ToString();

                        OnSendCommand(commandToSend, null);
                    }
                }
                else
                {
                    //just reload the draft order
                    Global.GlobalCollections.Instance.LoadDraftOrder();
                }
            }
        }
コード例 #23
0
        private void animateBand()
        {
            PlayerCommand commandToSend = new PlayerCommand();

            XmlDataRow xmlRow = new XmlDataRow();

            switch (_animate)
            {
                case "Animate Off":
                    //MJF
                    commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
                    commandToSend.CommandID = Guid.NewGuid().ToString();
                    commandToSend.Parameters = new List<CommandParameter>();
                    commandToSend.Parameters.Add(new CommandParameter("TemplateName", "BandCover"));

                    //xmlRow.Add("ANIMATE_ALL", "1");

                    //commandToSend.TemplateData = xmlRow.GetXMLString();
                    sendCommandToPlayout(commandToSend);

                    commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "HidePage");
                    commandToSend.CommandID = Guid.NewGuid().ToString();
                    commandToSend.Parameters = new List<CommandParameter>();
                    commandToSend.Parameters.Add(new CommandParameter("AnimateAll", "1"));

                    xmlRow.Add("ANIMATE_ALL", "1");

                    commandToSend.TemplateData = xmlRow.GetXMLString();

                    //MJF

                    Animate = "Animate On";

                    break;
                case "Animate On":
                    commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
                    commandToSend.CommandID = Guid.NewGuid().ToString();
                    commandToSend.Parameters = new List<CommandParameter>();
                    commandToSend.Parameters.Add(new CommandParameter("TemplateName", "BandCover"));

                    //xmlRow.Add("ANIMATE_ALL", "1");

                    //commandToSend.TemplateData = xmlRow.GetXMLString();
                    sendCommandToPlayout(commandToSend);

                    commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
                    commandToSend.CommandID = Guid.NewGuid().ToString();
                    commandToSend.Parameters = new List<CommandParameter>();
                    commandToSend.Parameters.Add(new CommandParameter("AnimateAll", "1"));

                    xmlRow.Add("ANIMATE_ALL", "1");

                    commandToSend.TemplateData = xmlRow.GetXMLString();

                    Animate = "Animate Off";

                    break;
            }

            sendCommandToPlayout(commandToSend);
        }
コード例 #24
0
        private void showTweet()
        {
            if (_selectedTweetText != null && _selectedTweetText != "" && _selectedLogo != null)
            {
                if (OnStopCycle != null) OnStopCycle();

                PlayerCommand commandToSend = new PlayerCommand();

                commandToSend.Command = (DraftAdmin.PlayoutCommands.CommandType)Enum.Parse(typeof(DraftAdmin.PlayoutCommands.CommandType), "ShowPage");
                commandToSend.CommandID = Guid.NewGuid().ToString();
                commandToSend.Parameters = new List<CommandParameter>();
                commandToSend.Parameters.Add(new CommandParameter("TemplateName", ConfigurationManager.AppSettings["TwitterTemplate"].ToString()));

                XmlDataRow xmlRow = new XmlDataRow();

                xmlRow.Add("TITLE_1", _selectedTweetUsername);
                xmlRow.Add("CHIP_1", ConfigurationManager.AppSettings["FranchiseChipDirectory"].ToString() + "\\" + _selectedLogo.FileName);
                xmlRow.Add("TIDBIT_1", _selectedTweetText);
                //xmlRow.Add("SWATCH_1", this.Category.SwatchFile.LocalPath);

                commandToSend.TemplateData = xmlRow.GetXMLString();

                OnSendCommand(commandToSend, null);
            }
        }