private List <MediaFiles> GetMediaFiles(Guid?gGuid = null)
        {
            List <MediaFiles> liMediaFiles = new List <MediaFiles>();
            MediaFiles        oMediaFiles  = null;

            try
            {
                using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["DemoVideoBurstConnection"].ConnectionString))
                {
                    conn.Open();
                    RenderTemplateElementsBL oRenderTemplateElementsBL = new RenderTemplateElementsBL();
                    SqlDataReader            reader = null;
                    SqlCommand sqlCmd = new SqlCommand();
                    sqlCmd.CommandType = CommandType.Text;
                    sqlCmd.CommandText = " Select M.urlid ,MP.description,M.width, M.height, M.mediatype, isnull(Mu.dsignedurl, '') dsignedurl from tblJobs Job INNER JOIN tblMedia M ON Job.id = M.jobid INNER JOIN tblMediaUrls MU On M.urlid = MU.id INNER JOIN tblMediaProfiles MP On M.profile = MP.profileid WHERE MP.active = 1 and M.active=1 and Job.status=100000 and Job.deleted=0 and Job.guid='" + gGuid + "' Order by MU.created desc";
                    sqlCmd.Connection  = conn;
                    reader             = sqlCmd.ExecuteReader();
                    ElementTypesBL oElementTypesBL = new ElementTypesBL();
                    while (reader.Read())
                    {
                        oMediaFiles             = new MediaFiles();
                        oMediaFiles.url         = Convert.ToString(reader["dsignedurl"]);
                        oMediaFiles.description = Convert.ToString(reader["description"]);
                        oMediaFiles.width       = Convert.ToInt32(reader["width"]);
                        oMediaFiles.height      = Convert.ToInt32(reader["height"]);
                        oMediaFiles.mediatype   = Convert.ToInt32(reader["mediatype"]);
                        liMediaFiles.Add(oMediaFiles);
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(liMediaFiles);
        }
Example #2
0
        private List <RenderTemplateElements> GetRenderTemplateElements(Guid?gElementGuid = null)
        {
            List <RenderTemplateElements> liRenderTemplateElements = new List <RenderTemplateElements>();
            RenderTemplateElements        oRenderTemplateElements  = null;

            try
            {
                using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["DemoVideoBurstConnection"].ConnectionString))
                {
                    conn.Open();
                    RenderTemplateElementsBL oRenderTemplateElementsBL = new RenderTemplateElementsBL();
                    SqlDataReader            reader = null;
                    SqlCommand sqlCmd = new SqlCommand();
                    sqlCmd.CommandType = CommandType.Text;
                    sqlCmd.CommandText = " SELECT [elements].[type],[types].[tag] typetext,[starttime],[stoptime],[width],[height],[minlength],[maxlength],[group] FROM dbo.[tblRenderTemplateElements] [elements] INNER JOIN dbo.[tblElementTypes][types] ON[types].[type] = [elements].[type] where guid='" + gElementGuid + "'";
                    sqlCmd.Connection  = conn;
                    reader             = sqlCmd.ExecuteReader();
                    ElementTypesBL oElementTypesBL = new ElementTypesBL();
                    while (reader.Read())
                    {
                        oRenderTemplateElements             = new RenderTemplateElements();
                        oRenderTemplateElements.elementtype = oElementTypesBL.GetElementTypesByElementType(Convert.ToInt32(reader["type"]));
                        oRenderTemplateElements.typetext    = Convert.ToString(reader["typetext"]);
                        oRenderTemplateElements.starttime   = reader["starttime"] != DBNull.Value ? Math.Round(Convert.ToDecimal(reader["starttime"]), 0).ToString() : "0";
                        oRenderTemplateElements.stoptime    = reader["stoptime"] != DBNull.Value ? Math.Round(Convert.ToDecimal(reader["stoptime"]), 0).ToString() : "0";
                        oRenderTemplateElements.width       = !String.IsNullOrEmpty(Convert.ToString(reader["width"])) ? (int?)(reader["width"]) : null;
                        oRenderTemplateElements.height      = !String.IsNullOrEmpty(Convert.ToString(reader["height"])) ? (int?)(reader["height"]) : null;
                        oRenderTemplateElements.minlength   = !String.IsNullOrEmpty(Convert.ToString(reader["minlength"])) ? (int?)(reader["minlength"]) : null;
                        oRenderTemplateElements.maxlength   = !String.IsNullOrEmpty(Convert.ToString(reader["maxlength"])) ? (int?)(reader["maxlength"]) : null;
                        oRenderTemplateElements.group       = Convert.ToInt32(reader["group"]);
                        liRenderTemplateElements.Add(oRenderTemplateElements);
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(liRenderTemplateElements);
        }