Example #1
0
        private void LoadData()
        {
            MediaFiles media_obj = new MediaFiles();
            DataTable  dt        = media_obj.GetDetailById(_idx);

            string PortalId    = dt.Rows[0]["PortalId"].ToString();
            string TypeId      = dt.Rows[0]["TypeId"].ToString();
            string Title       = dt.Rows[0]["Title"].ToString();
            string Description = dt.Rows[0]["Description"].ToString();
            string FileName    = dt.Rows[0]["FileName"].ToString();

            PopulatePortalList2DDL(PortalId);
            PopulateMediaTypeList2DDL(TypeId);

            txtTitle.Text         = Title;
            txtDescription.Text   = Description;
            Literal_FileName.Text = FileName;
            string dir_path  = System.Configuration.ConfigurationManager.AppSettings["upload_background_audio_dir"];
            string file_path = "../../../" + dir_path + "/" + FileName;

            ViewState["filename"] = FileName;


            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("<object type=\"application/x-shockwave-flash\" data=\"../../../scripts/plugins/dewplayer/dewplayer-vol.swf?mp3=" + file_path + "\" width=\"240\" height=\"20\" id=\"dewplayer-vol\"><param name=\"wmode\" value=\"transparent\" /><param name=\"movie\" value=\"../../../scripts/plugins/dewplayer/dewplayer-vol.swf?mp3=" + file_path + "/></object>");
            Literal_Preview.Text = sb.ToString();
        }
        private void LoadData()
        {
            MediaFiles media_obj = new MediaFiles();
            DataTable  dt        = media_obj.GetDetailById(_idx);

            ViewState["TopicId"] = dt.Rows[0]["TopicId"].ToString();
            string TypeId     = dt.Rows[0]["TypeId"].ToString();
            string AlbumId    = dt.Rows[0]["AlbumId"].ToString();
            string ArtistId   = dt.Rows[0]["ArtistId"].ToString();
            string ComposerId = dt.Rows[0]["ComposerId"].ToString();
            string PlayListId = dt.Rows[0]["PlayListId"].ToString();

            string Title       = dt.Rows[0]["Title"].ToString();
            string Dimension   = dt.Rows[0]["Dimension"].ToString();
            string Description = dt.Rows[0]["Description"].ToString();

            ViewState["FileName"] = dt.Rows[0]["FileName"].ToString();
            ViewState["FileUrl"]  = dt.Rows[0]["FileUrl"].ToString();
            string Source = dt.Rows[0]["Source"].ToString();

            ViewState["Photo"]     = dt.Rows[0]["Photo"].ToString();
            ViewState["Thumbnail"] = dt.Rows[0]["Thumbnail"].ToString();
            imgPhoto.ImageUrl      = upload_front_image_dir + "/" + ViewState["Thumbnail"].ToString();
            string AutoStart = dt.Rows[0]["AutoStart"].ToString();
            string MediaLoop = dt.Rows[0]["MediaLoop"].ToString();
            string Status    = dt.Rows[0]["Status"].ToString();

            PopulateMediaTypeList2DDL(TypeId);
            PopulateMediaTopicList2DDL(ViewState["TopicId"].ToString());
            PopulateMediaAlbumList2DDL(AlbumId);
            PopulateMediaArtistList2DDL(ArtistId);
            PopulateMediaComposerList2DDL(ComposerId);
            PopulateMediaPlayList2DDL(PlayListId);

            if (AutoStart == "True")
            {
                chkAutoStart.Checked = true;
            }
            if (MediaLoop == "True")
            {
                chkMedialoop.Checked = true;
            }
            if (Status == "1")
            {
                chkIsFilePublished.Checked = true;
            }
            txtDimension.Text    = Dimension;
            txtSource.Text       = Source;
            txtFileTitle.Text    = Title;
            txtDescription.Value = Description;
            //if (ViewState["FileName"].ToString() != string.Empty && ViewState["FileUrl"].ToString() == string.Empty)
            //    Literal_FileName.Text = ViewState["FileName"].ToString();
            //else if (ViewState["FileName"].ToString() == string.Empty && ViewState["FileUrl"].ToString() != string.Empty)
            //    Literal_FileName.Text = ViewState["FileUrl"].ToString();
            //else
            //    Literal_FileName.Text = "No File";
            hdFileId.Value = _idx.ToString();
        }
Example #3
0
        public string[] GetMediaFile(int FileId)
        {
            Uri    requestUri = Context.Request.Url;
            string baseUrl    = requestUri.Scheme + Uri.SchemeDelimiter + requestUri.Host + (requestUri.IsDefaultPort ? "" : ":" + requestUri.Port);

            MediaFiles media_obj = new MediaFiles();
            DataTable  dt        = media_obj.GetDetailById(FileId);
            string     Title     = dt.Rows[0]["Title"].ToString();
            string     FileName  = dt.Rows[0]["FileName"].ToString();
            string     FileUrl   = dt.Rows[0]["FileUrl"].ToString();
            string     Photo     = dt.Rows[0]["Photo"].ToString();
            string     Thumbnail = dt.Rows[0]["Photo"].ToString();
            int        TypeId    = Convert.ToInt32(dt.Rows[0]["TypeId"].ToString());

            //====MediaType=================================================================
            MediaTypes media_type_obj = new MediaTypes();
            string     TypePath       = media_type_obj.GetTypePathByTypeId(TypeId);
            //==============================================================================

            //string dir_path = Server.MapPath("~/" + TypePath);

            string file_path = baseUrl + "/" + TypePath + "/" + FileName;

            string dir_image_path = System.Configuration.ConfigurationManager.AppSettings["upload_media_image_dir"];
            string image          = "";

            if (Photo != string.Empty)
            {
                image = baseUrl + "/" + dir_image_path + "/photo/" + Photo;
            }
            if (Photo == string.Empty)
            {
                image = baseUrl + "/" + dir_image_path + "/thumbnails/" + Thumbnail;
            }
            if (Photo == string.Empty && Thumbnail == string.Empty)
            {
                image = baseUrl + "/images/no_image.jpg";
            }


            string[] array_list = new string[3];
            array_list[0] = Title;
            if (FileName != string.Empty && FileUrl == string.Empty)
            {
                array_list[1] = file_path;
            }
            else
            {
                array_list[1] = FileUrl;
            }
            array_list[2] = image;
            return(array_list);
        }
Example #4
0
        private void LoadData()
        {
            MediaFiles media_obj = new MediaFiles();
            DataTable  dt        = media_obj.GetDetailById(_idx);

            string TopicId     = dt.Rows[0]["TopicId"].ToString();
            string TypeId      = dt.Rows[0]["TypeId"].ToString();
            string Title       = dt.Rows[0]["Title"].ToString();
            string Dimension   = dt.Rows[0]["Dimension"].ToString();
            string Description = dt.Rows[0]["Description"].ToString();
            string FileName    = dt.Rows[0]["FileName"].ToString();
            string Source      = dt.Rows[0]["Source"].ToString();

            ViewState["Photo"]     = dt.Rows[0]["Photo"].ToString();
            ViewState["Thumbnail"] = dt.Rows[0]["Thumbnail"].ToString();
            string AutoStart = dt.Rows[0]["AutoStart"].ToString();
            string MediaLoop = dt.Rows[0]["MediaLoop"].ToString();
            string Status    = dt.Rows[0]["Status"].ToString();

            PopulateMediaTopicList2DDL(TopicId);
            PopulateMediaTypeList2DDL(TypeId);

            if (AutoStart == "True")
            {
                chkAutoStart.Checked = true;
            }
            if (MediaLoop == "True")
            {
                chkMedialoop.Checked = true;
            }
            if (Status == "1")
            {
                chkIsFilePublished.Checked = true;
            }
            txtDimension.Text    = Dimension;
            txtSource.Text       = Source;
            txtFileTitle.Text    = Title;
            txtDescription.Value = Description;
            //Literal_FileName.Text = FileName;
            string dir_path  = System.Configuration.ConfigurationManager.AppSettings["upload_video_dir"];
            string file_path = "../../../" + dir_path + "/" + FileName;


            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("<object type=\"application/x-shockwave-flash\" data=\"../../../scripts/plugins/dewplayer/dewplayer-vol.swf?mp3=" + file_path + "\" width=\"240\" height=\"20\" id=\"dewplayer-vol\"><param name=\"wmode\" value=\"transparent\" /><param name=\"movie\" value=\"../../../scripts/plugins/dewplayer/dewplayer-vol.swf?mp3=" + file_path + "/></object>");
            //Literal_Preview.InnerHtml = sb.ToString();
        }
Example #5
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int        id        = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values[0].ToString());
            string     userid    = Session["UserId"].ToString();
            MediaFiles media_obj = new MediaFiles();
            DataTable  dt        = media_obj.GetDetailById(id);

            if (dt.Rows.Count > 0)
            {
                string filename  = dt.Rows[0]["FileName"].ToString();
                string photo     = dt.Rows[0]["Photo"].ToString();
                string thumbnail = dt.Rows[0]["Thumbnail"].ToString();

                int i = media_obj.Delete(userid, id, photo, thumbnail, filename);
            }
            FillDataInGrid();
        }