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);
        }
Beispiel #2
0
        internal List <TemplateElements> GetTemplatesElements(Guid?gTemplateGuid)
        {
            List <TemplateElements> liTemplateElements = new List <TemplateElements>();
            TemplateElements        oTemplateElements  = 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 * from tblTemplateElements where active=1 and templateguid='" + gTemplateGuid + "'";
                    sqlCmd.Connection  = conn;
                    reader             = sqlCmd.ExecuteReader();

                    while (reader.Read())
                    {
                        oTemplateElements                       = new TemplateElements();
                        oTemplateElements.guid                  = Guid.Parse(reader["guid"].ToString());
                        oTemplateElements.templateguid          = Guid.Parse(reader["templateguid"].ToString());
                        oTemplateElements.rendertemplateelement = oRenderTemplateElementsBL.GetRenderTemplateElementByGuid(Guid.Parse(reader["renderelementguid"].ToString()));
                        oTemplateElements.title                 = reader["title"].ToString();
                        oTemplateElements.helptext              = Convert.ToString(reader.GetValue(3));
                        oTemplateElements.mode                  = Convert.ToInt16(reader["mode"]);
                        oTemplateElements.defaultvalue          = reader["defaultvalue"].ToString();
                        oTemplateElements.active                = Convert.ToBoolean(reader["active"]);
                        oTemplateElements.sortorder             = Convert.ToInt16(reader["sortorder"]);
                        //reader["sortorder"] != DBNull.Value ? Convert.ToInt32(reader["sortorder"]) : 9999;
                        oTemplateElements.groupname        = Convert.ToString(reader["groupname"]);
                        oTemplateElements.DefaultThumbnail = reader["DefaultThumbnail"].ToString();
                        liTemplateElements.Add(oTemplateElements);
                        //conn.Close();
                    }
                    return(liTemplateElements);

                    if (conn != null)
                    {
                        conn.Close();
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(liTemplateElements);
        }
Beispiel #3
0
        public List <ElementTypes> GetTemplatesElements(int?iElementTypeId = null)
        {
            List <ElementTypes> liElementTypes = new List <ElementTypes>();
            ElementTypes        oElementTypes  = 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 [type],[engineid],[description],[tag],[foldername] FROM [tblElementTypes] WHERE [type]=" + iElementTypeId + "";
                    sqlCmd.Connection  = conn;
                    reader             = sqlCmd.ExecuteReader();

                    while (reader.Read())
                    {
                        oElementTypes             = new ElementTypes();
                        oElementTypes.type        = Convert.ToInt32(reader["type"]);
                        oElementTypes.engineid    = Convert.ToInt32(reader["engineid"]);
                        oElementTypes.description = Convert.ToString(reader["description"]);
                        oElementTypes.tag         = Convert.ToString(reader["tag"]);
                        oElementTypes.foldername  = Convert.ToString(reader["foldername"]);
                        liElementTypes.Add(oElementTypes);
                    }
                    if (conn.State == ConnectionState.Open)
                    {
                        conn.Close();
                    }

                    conn.Dispose();
                }
            }
            catch (Exception ex)
            {
            }
            return(liElementTypes);
        }
Beispiel #4
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);
        }