Exemplo n.º 1
0
        private VideosCate VideosCateReader(SqlDataReader reader)
        {
            VideosCate videoscate = new VideosCate();

            videoscate.VideosCateID    = (int)reader["VideosCateID"];
            videoscate.ParentCateID    = (int)reader["ParentCateID"];
            videoscate.VideosCateName  = (string)reader["VideosCateName"];
            videoscate.VideosCateTotal = (int)reader["VideosCateTotal"];
            videoscate.VideosCateOrder = (int)reader["VideosCateOrder"];
            videoscate.ImageThumb      = (string)reader["ImageThumb"];
            videoscate.ImageLarge      = (string)reader["ImageLarge"];
            videoscate.Description     = (string)reader["Description"];
            videoscate.UserName        = (string)reader["UserName"];
            videoscate.Created         = (DateTime)reader["Created"];
            videoscate.Language        = (string)reader["Language"];
            return(videoscate);
        }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int Id = 0;

        if (!String.IsNullOrEmpty(Request["id"]))
        {
            int.TryParse(Request["id"], out Id);
        }
        hddID.Value = Convert.ToString(Id);

        int cId = 0;

        if (!String.IsNullOrEmpty(Request["cId"]))
        {
            int.TryParse(Request["cId"], out cId);
        }
        hddCateID.Value = Convert.ToString(cId);

        if (!IsPostBack)
        {
            //   int cateID = Convert.ToInt32(hddValue.Value);
            ViewVideo(cId);
            VideosCateBSO videoCateBSO = new VideosCateBSO();
            VideosCate    videoCate    = videoCateBSO.GetVideosCateById(cId);
            //string strIcon = "";
            if (videoCate != null)
            {
                string strTitle = "<a class='news_cm_tt_a' style='float:left' href='" + ResolveUrl("~/") + "thu-vien-video/" + GetString(videoCate.VideosCateName) + "-" + videoCate.VideosCateID + ".aspx' title='" + videoCate.VideosCateName + "'>" + videoCate.VideosCateName + "</a>";
                lblTitle.Text = strTitle;
                //strIcon += "<a href='" + ResolveUrl("~/") + "thu-vien-video/" + GetString(videoCate.VideosCateName) + "-" + GetString(videoCate.VideosCateName) + "-" + videoCate.VideosCateID + ".aspx' title='" + videoCate.VideosCateName + "'>";
                //strIcon += "<img class='is_img onLaw2-icon1 onLaw1-Submit-Arrow' src='" + ResolveUrl("~/") + "images/invis.gif' style='border-width: 0px;'>";
                //strIcon += "</a>";
                //lblIcon.Text = strIcon;
            }
            else
            {
                lblTitle.Text = "Video";
            }
        }
    }
Exemplo n.º 3
0
        /// <summary>
        /// Tao dieu huong cho danh muc
        /// Khi su dung can phai khai bao: string cate_navigator = "";
        /// url co dang: Default.aspx?go=videoscate&id= ;
        /// </summary>
        /// <param name="cate_navigator"></param>
        /// <param name="cateId"></param>
        /// <param name="url"></param>

        public void CateNavigator(ref string cate_navigator, int cateId, string url)
        {
            try
            {
                VideosCate videoscate = GetVideosCateById(cateId);

                if (!string.IsNullOrEmpty(cate_navigator))
                {
                    cate_navigator = " &raquo; " + cate_navigator;
                }

                cate_navigator = "<a href='" + url + cateId + "'>" + videoscate.VideosCateName + "</a>" + cate_navigator;

                if (videoscate.ParentCateID != 0)
                {
                    this.CateNavigator(ref cate_navigator, videoscate.ParentCateID, url);
                }
            }
            catch (Exception ex)
            {
                throw new BusinessException(ex.Message.ToString());
            }
        }
Exemplo n.º 4
0
        public VideosCate GetVideosCateById(int cId)
        {
            VideosCate videoscate = null;

            using (SqlConnection connection = GetConnection())
            {
                SqlCommand command = new SqlCommand("_VideosCateById", connection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.AddWithValue("@VideosCateID", cId);
                connection.Open();
                using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    if (reader.Read())
                    {
                        videoscate = VideosCateReader(reader);
                    }
                    //else
                    //    throw new DataAccessException("Không tìm thấy danh mục");
                    command.Dispose();
                }
            }
            return(videoscate);
        }
Exemplo n.º 5
0
        public int CreateVideosCateGet(VideosCate videoscate)
        {
            int i = 0;

            using (SqlConnection connection = GetConnection())
            {
                SqlCommand command = new SqlCommand("_VideosCateInsert", connection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.AddWithValue("@Type", 0);
                command.Parameters.AddWithValue("@VideosCateID", 0);
                command.Parameters.AddWithValue("@ParentCateID", videoscate.ParentCateID);
                command.Parameters.AddWithValue("@VideosCateName", videoscate.VideosCateName);
                command.Parameters.AddWithValue("@VideosCateTotal", videoscate.VideosCateTotal);
                command.Parameters.AddWithValue("@VideosCateOrder", videoscate.VideosCateOrder);
                command.Parameters.AddWithValue("@ImageThumb", videoscate.ImageThumb);
                command.Parameters.AddWithValue("@ImageLarge", videoscate.ImageLarge);
                command.Parameters.AddWithValue("@Description", videoscate.Description);
                command.Parameters.AddWithValue("@UserName", videoscate.UserName);
                command.Parameters.AddWithValue("@Created", videoscate.Created);
                command.Parameters.AddWithValue("@Language", videoscate.Language);

                SqlParameter parameter = new SqlParameter("@ReturnId", SqlDbType.Int);
                parameter.Direction = ParameterDirection.ReturnValue;
                command.Parameters.Add(parameter);
                connection.Open();
                if (command.ExecuteNonQuery() <= 0)
                {
                    throw new DataAccessException("Khong them duoc san pham");
                }
                else
                {
                    i = (int)parameter.Value;
                    command.Dispose();
                }
            }
            return(i);
        }
Exemplo n.º 6
0
        public void UpdateVideosCate(VideosCate videoscate)
        {
            VideosCateDAO videoscateDAO = new VideosCateDAO();

            videoscateDAO.UpdateVideosCate(videoscate);
        }
Exemplo n.º 7
0
        public int CreateCateNewGet(VideosCate videoscate)
        {
            VideosCateDAO videoscateDAO = new VideosCateDAO();

            return(videoscateDAO.CreateVideosCateGet(videoscate));
        }
Exemplo n.º 8
0
        public void CreateCateNew(VideosCate videoscate)
        {
            VideosCateDAO videoscateDAO = new VideosCateDAO();

            videoscateDAO.CreateVideosCate(videoscate);
        }
Exemplo n.º 9
0
    public static void GetNavigation(string strSlugPage, string g, string cId, string Id, string urlRoot)
    {
        if (strSlugPage != string.Empty)
        {
            SYS_PageLayoutBSO _pageLayoutBSO = new SYS_PageLayoutBSO();
            SYS_PageLayout    _pageLayout    = new SYS_PageLayout();

            if (!AspNetCache.CheckCache("PageLayout_" + strSlugPage + "_" + Language.language.Replace("-", "_")))
            {
                _pageLayout = _pageLayoutBSO.GetSYS_PageLayoutBySlug(strSlugPage, Language.language);
                if (_pageLayout == null)
                {
                    _pageLayout = _pageLayoutBSO.GetSYS_PageLayoutBySlug("home", Language.language);
                }

                AspNetCache.SetCache("PageLayout_" + strSlugPage + "_" + Language.language.Replace("-", "_"), _pageLayout);
            }
            else
            {
                _pageLayout = (SYS_PageLayout)AspNetCache.GetCache("PageLayout_" + strSlugPage + "_" + Language.language.Replace("-", "_"));
            }

            Navigation.TitleName = _pageLayout.PageName;
            Navigation.TitleCate = "<li><a href='" + urlRoot + "'>Trang chủ</a></li>";

            CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO();
            NewsGroupBSO     newsgroupBSO     = new NewsGroupBSO();
            CateNewsBSO      catenewsBSO      = new CateNewsBSO();


            if (strSlugPage == "du-an")
            {
                if (!String.IsNullOrEmpty(Id))
                {
                    Navigation.TitleName = "Thông tin dự án";

                    string cate = "<li><a href='" + urlRoot + "c2/du-an-c/du-an-1.aspx'>Dự án";
                    cate += "</a></li>";
                    Navigation.TitleCate  = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>";
                    Navigation.TitleCate += cate;
                }
            }
            else
            if (strSlugPage == "detailvideos")
            {
                if (!String.IsNullOrEmpty(cId))
                {
                    VideosCateBSO videosCateBSO = new VideosCateBSO();
                    VideosCate    videoCate     = videosCateBSO.GetVideosCateById(Convert.ToInt32(cId));

                    Navigation.TitleName = "<a href='" + urlRoot + "thu-vien-video" + "-" + videoCate.VideosCateID + ".aspx'>" + videoCate.VideosCateName + "</a>";

                    string cate = "<li><a href='" + urlRoot + "thu-vien-video.aspx'>Thư viện Video";
                    string s1   = "";
                    while (videoCate.ParentCateID != 0)
                    {
                        int pId = videoCate.ParentCateID;
                        videoCate = videosCateBSO.GetVideosCateById(pId);
                        s1        = "<li><a href='" + urlRoot + "thu-vien-video/" + videoCate.VideosCateName + "-" + videoCate.VideosCateID + ".aspx'>" + videoCate.VideosCateName + "</a></li>" + s1;
                    }

                    //   cate += "Video"; //Sửa lại
                    cate += "</a></li>";
                    cate += s1;
                    Navigation.TitleCate  = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>";
                    Navigation.TitleCate += cate;
                }
            }
            else
            if (strSlugPage == "detailalbums")
            {
                if (!String.IsNullOrEmpty(cId))
                {
                    AlbumsCateBSO albumsCateBSO = new AlbumsCateBSO();
                    AlbumsCate    videoCate     = albumsCateBSO.GetAlbumsCateById(Convert.ToInt32(cId));

                    Navigation.TitleName = "<a href='" + urlRoot + "thu-vien-video" + "-" + videoCate.AlbumsCateID + ".aspx'>" + videoCate.AlbumsCateName + "</a>";

                    string cate = "<li><a href='" + urlRoot + "thu-vien-video.aspx'>Thư viện Video";
                    string s1   = "";
                    while (videoCate.ParentCateID != 0)
                    {
                        int pId = videoCate.ParentCateID;
                        videoCate = albumsCateBSO.GetAlbumsCateById(pId);
                        s1        = "<li><a href='" + urlRoot + "thu-vien-video/" + videoCate.AlbumsCateName + "-" + videoCate.AlbumsCateID + ".aspx'>" + videoCate.AlbumsCateName + "</a></li>" + s1;
                    }

                    //   cate += "Video"; //Sửa lại
                    cate += "</a></li>";
                    cate += s1;
                    Navigation.TitleCate  = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>";
                    Navigation.TitleCate += cate;
                }
            }
            else
            if (strSlugPage == "dh")
            {
                if (!String.IsNullOrEmpty(g))
                {
                    Navigation.TitleName = "<a href='" + urlRoot + "tim-truong/0-0-0-0-0-0-0/search.aspx'>Thông tin trường</a>";

                    Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>";
                }
            }
            else
            if (strSlugPage == "dang-ky-ts")
            {
                if (!String.IsNullOrEmpty(g))
                {
                    Navigation.TitleName = "<a href='" + urlRoot + "c2/dh-dk/Dang-ky-tuyen-sinh-truc-tuyen-20.aspx'>Trang Đăng ký tuyển sinh</a>";

                    Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>";
                }
            }
            else
            if (strSlugPage == "dh-dk")
            {
                if (!String.IsNullOrEmpty(g))
                {
                    Navigation.TitleName = "<a href='" + urlRoot + "c2/dh-dk/Dang-ky-tuyen-sinh-truc-tuyen-20.aspx'>Trang Đăng ký tuyển sinh</a>";

                    Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>";
                }
            }
            else
            if (!String.IsNullOrEmpty(Id))
            {
                NewsGroup newsgroup = newsgroupBSO.GetNewsGroupById(Convert.ToInt32(Id));
                if (newsgroup != null && newsgroup.CateNewsID > 0)
                {
                    CateNews      catenews      = catenewsBSO.GetCateNewsById(newsgroup.CateNewsID);
                    CateNewsGroup cateNewsGroup = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate, Language.language);

                    Navigation.TitleName = "<a href='" + urlRoot + "c3/" + catenewsBSO.GetSlugByCateId(catenews.CateNewsID) + "/" + GetString(catenews.CateNewsName) + "-" + catenews.GroupCate + "-" + catenews.CateNewsID + ".aspx'>" + catenews.CateNewsName + "</a>";

                    string cate = "<li><a href='" + urlRoot + "c2/" + cateNewsgroupBSO.GetSlugById(cateNewsGroup.CateNewsGroupID) + "/" + GetString(cateNewsGroup.CateNewsGroupName) + "-" + catenews.GroupCate + ".aspx'>";
                    string s1   = "";
                    while (catenews.ParentNewsID != 0)
                    {
                        int pId = catenews.ParentNewsID;
                        catenews = catenewsBSO.GetCateNewsById(pId);
                        s1       = "<li><a href='" + urlRoot + "c3/" + catenewsBSO.GetSlugByCateId(catenews.CateNewsID) + "/" + GetString(catenews.CateNewsName) + "-" + catenews.GroupCate + "-" + catenews.CateNewsID + ".aspx'>" + catenews.CateNewsName + "</a></li>" + s1;
                    }

                    cate += cateNewsGroup.CateNewsGroupName.ToString();                         //Sửa lại
                    cate += "</a></li>";
                    cate += s1;
                    Navigation.TitleCate  = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>";
                    Navigation.TitleCate += cate;
                }
            }
            else
            {
                if (!String.IsNullOrEmpty(cId) && !String.IsNullOrEmpty(g))
                {
                    CateNews      cateNewsById     = catenewsBSO.GetCateNewsById(Convert.ToInt32(cId));
                    CateNewsGroup groupByGroupCate = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(Convert.ToInt32(g), Language.language);

                    if (groupByGroupCate != null && cateNewsById != null)
                    {
                        Navigation.TitleName = cateNewsById.CateNewsName;

                        string cate = "<li><a href='" + urlRoot + "c2/" + cateNewsgroupBSO.GetSlugById(groupByGroupCate.CateNewsGroupID) + "/" + GetString(groupByGroupCate.CateNewsGroupName) + "-" + cateNewsById.GroupCate + ".aspx' title='" + groupByGroupCate.CateNewsGroupName + "'>";
                        string s1   = "";
                        while (cateNewsById.ParentNewsID != 0)
                        {
                            int parentNewsId = cateNewsById.ParentNewsID;
                            cateNewsById = catenewsBSO.GetCateNewsById(parentNewsId);
                            s1           = "<li><a href='" + urlRoot + "c3/" + catenewsBSO.GetSlugByCateId(cateNewsById.CateNewsID) + "/" + GetString(cateNewsById.CateNewsName) + "-" + cateNewsById.GroupCate + "-" + cateNewsById.CateNewsID + ".aspx' title='" + cateNewsById.CateNewsName + "'>" + cateNewsById.CateNewsName + "</a></li>" + s1;
                        }

                        cate += groupByGroupCate.CateNewsGroupName.ToString() + "</a></li>" + s1;
                        Navigation.TitleCate  = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>";
                        Navigation.TitleCate += cate;
                    }
                }
                else
                {
                    if (!String.IsNullOrEmpty(g))
                    {
                        CateNewsGroup groupByGroupCate = cateNewsgroupBSO.GetCateNewsGroupByGroupCate(Convert.ToInt32(g), Language.language);
                        Navigation.TitleCate = "<li><a href='" + urlRoot + "Default.aspx'>" + Resources.resource.T_home + "</a></li>";
                        if (groupByGroupCate != null)
                        {
                            Navigation.TitleName = groupByGroupCate.CateNewsGroupName;
                        }
                    }
                }
            }
        }
    }