示例#1
0
        public static async Task<Frame> GetNextFrameAsync(int panelId, int displayId, int previousFrameId)
		{
            Frame nci = new Frame()
            {
                PanelId = panelId,
                DisplayId = displayId
            };

            using (SqlCommand cmd = new SqlCommand("sp_GetNextFrame"))
            {
				cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@panelId", SqlDbType.Int).Value = panelId;
                cmd.Parameters.Add("@displayId", SqlDbType.Int).Value = displayId;
                cmd.Parameters.Add("@lastFrameId", SqlDbType.Int).Value = previousFrameId;

                await cmd.ExecuteReaderExtAsync((dr) =>
                {
                    nci._initfromRow(dr);
                    return false;
                });
            }

            if (nci.FrameId > 0)
            {
                switch (nci.FrameType)
                {
                    case FrameTypes.Clock:
                        nci = new Clock(nci);
                        break;

                    case FrameTypes.Html:
                        nci = new Html(nci);
                        break;

                    case FrameTypes.Memo:
                        nci = new Memo(nci);
                        break;

                    //case FrameTypes.News:

                    case FrameTypes.Outlook:
                        nci = new Outlook(nci);
                        break;

                    case FrameTypes.Picture:
                        nci = new Picture(nci);
                        break;

                    case FrameTypes.Powerbi:
                        nci = new Powerbi(nci);
                        break;

                    case FrameTypes.Report:
                        nci = new Report(nci);
                        break;

                    case FrameTypes.Video:
                        nci = new Video(nci);
                        break;

                    case FrameTypes.Weather:
                        nci = new Weather(nci);
                        break;

                    case FrameTypes.YouTube:
                        nci = new YouTube(nci);
                        break;

                    default:
                        break;
                }
            }

            return nci;
		}
示例#2
0
        public static Frame GetNextFrame(int panelId, int displayId, int previousFrameId)
        {
            Frame nci = new Frame()
            {
                PanelId   = panelId,
                DisplayId = displayId
            };

            using (SqlCommand cmd = new SqlCommand("sp_GetNextFrame"))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@panelId", SqlDbType.Int).Value     = panelId;
                cmd.Parameters.Add("@displayId", SqlDbType.Int).Value   = displayId;
                cmd.Parameters.Add("@lastFrameId", SqlDbType.Int).Value = previousFrameId;

                using (DataSet ds = DataAccess.RunSql(cmd))
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        DataRow r = ds.Tables[0].Rows[0];
                        nci._initfromRow(r);
                    }
                }
            }

            if (nci.FrameId > 0)
            {
                switch (nci.FrameType)
                {
                case FrameTypes.Clock:
                    nci = new Clock(nci);
                    break;

                case FrameTypes.Html:
                    nci = new Html(nci);
                    break;

                case FrameTypes.Memo:
                    nci = new Memo(nci);
                    break;

                //case FrameTypes.News:
                case FrameTypes.Outlook:
                    nci = new Outlook(nci);
                    break;

                case FrameTypes.Picture:
                    nci = new Picture(nci);
                    break;

                case FrameTypes.Report:
                    nci = new Report(nci);
                    break;

                case FrameTypes.Video:
                    nci = new Video(nci);
                    break;

                case FrameTypes.Weather:
                    nci = new Weather(nci);
                    break;

                case FrameTypes.YouTube:
                    nci = new YouTube(nci);
                    break;

                default:
                    break;
                }
            }

            return(nci);
        }
示例#3
0
        public static Frame GetNextFrame(int panelId, int displayId, int previousFrameId)
		{
            Frame nci = new Frame()
            {
                PanelId = panelId,
                DisplayId = displayId
            };

            using (SqlCommand cmd = new SqlCommand("sp_GetNextFrame"))
            {
				cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@panelId", SqlDbType.Int).Value = panelId;
                cmd.Parameters.Add("@displayId", SqlDbType.Int).Value = displayId;
                cmd.Parameters.Add("@lastFrameId", SqlDbType.Int).Value = previousFrameId;

                using (DataSet ds = DataAccess.RunSql(cmd))
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        DataRow r = ds.Tables[0].Rows[0];
                        nci._initfromRow(r);
                    }
                }
            }

            if (nci.FrameId > 0)
            {
                switch (nci.FrameType)
                {
                    case FrameTypes.Clock:
                        nci = new Clock(nci);
                        break;

                    case FrameTypes.Html:
                        nci = new Html(nci);
                        break;

                    case FrameTypes.Memo:
                        nci = new Memo(nci);
                        break;

                    //case FrameTypes.News:
                    case FrameTypes.Outlook:
                        nci = new Outlook(nci);
                        break;

                    case FrameTypes.Picture:
                        nci = new Picture(nci);
                        break;

                    case FrameTypes.Report:
                        nci = new Report(nci);
                        break;

                    case FrameTypes.Video:
                        nci = new Video(nci);
                        break;

                    case FrameTypes.Weather:
                        nci = new Weather(nci);
                        break;

                    case FrameTypes.YouTube:
                        nci = new YouTube(nci);
                        break;

                    default:
                        break;
                }
            }

            return nci;
		}
示例#4
0
        public static async Task <Frame> GetNextFrameAsync(int panelId, int displayId, int previousFrameId)
        {
            Frame nci = new Frame()
            {
                PanelId   = panelId,
                DisplayId = displayId
            };

            using (SqlCommand cmd = new SqlCommand("sp_GetNextFrame"))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@panelId", SqlDbType.Int).Value     = panelId;
                cmd.Parameters.Add("@displayId", SqlDbType.Int).Value   = displayId;
                cmd.Parameters.Add("@lastFrameId", SqlDbType.Int).Value = previousFrameId;

                await cmd.ExecuteReaderExtAsync((dr) =>
                {
                    nci._initfromRow(dr);
                    return(false);
                });
            }

            if (nci.FrameId > 0)
            {
                switch (nci.FrameType)
                {
                case FrameTypes.Clock:
                    nci = new Clock(nci);
                    break;

                case FrameTypes.Html:
                    nci = new Html(nci);
                    break;

                case FrameTypes.Memo:
                    nci = new Memo(nci);
                    break;

                //case FrameTypes.News:

                case FrameTypes.Outlook:
                    nci = new Outlook(nci);
                    break;

                case FrameTypes.Picture:
                    nci = new Picture(nci);
                    break;

                case FrameTypes.Powerbi:
                    nci = new Powerbi(nci);
                    break;

                case FrameTypes.Report:
                    nci = new Report(nci);
                    break;

                case FrameTypes.Video:
                    nci = new Video(nci);
                    break;

                case FrameTypes.Weather:
                    nci = new Weather(nci);
                    break;

                case FrameTypes.YouTube:
                    nci = new YouTube(nci);
                    break;

                default:
                    break;
                }
            }

            return(nci);
        }