private void ViewPageLayout() { SYS_PageLayoutBSO _pageBSO = new SYS_PageLayoutBSO(); DataTable table = _pageBSO.GetSYS_PageLayoutAllTemplate(Language.language); commonBSO commonBSO = new commonBSO(); commonBSO.FillToGridView(grvPageLayout, table); }
protected void Bind_ddlPageLayout() { SYS_PageLayoutBSO _pageLayoutBSO = new SYS_PageLayoutBSO(); DataTable table = _pageLayoutBSO.GetSYS_PageLayoutAll(Language.language); commonBSO commonBSO = new commonBSO(); ddlPageLayout.Items.Clear(); commonBSO.FillToDropDown(ddlPageLayout, table, "", "", "PageName", "Id", ""); }
private void GetRegion() { List <ControlData> _list = new List <ControlData>(); try { int PageLayoutId = TypeHelper.ToInt32(ddlPageLayout.SelectedValue); SYS_PageLayoutBSO _pageLayoutBSO = new SYS_PageLayoutBSO(); SYS_PageLayout _pageLayout = _pageLayoutBSO.GetSYS_PageLayoutById(PageLayoutId); SYS_TemplatePageBSO _templateBSO = new SYS_TemplatePageBSO(); SYS_TemplatePage _template = _templateBSO.GetSYS_TemplatePageById(_pageLayout.TemplateId); Control objControl = (Control)this.LoadControl(ResolveUrl("~/") + "Client/Skins/Templates/" + _template.TemplateControl); ControlCollection _controls = objControl.Controls; foreach (Control obj1 in _controls) { Type objType = obj1.GetType(); if (obj1 != null) { if (obj1.ID != null) { ControlData objData = new ControlData(); objData.Control = obj1.ID; if (obj1 != null) { objData.Text = obj1.ID; _list.Add(objData); } } } } ddlRegion.Items.Clear(); ddlRegion.DataSource = _list; ddlRegion.DataTextField = "Text"; ddlRegion.DataValueField = "Control"; ddlRegion.DataBind(); } catch { ddlRegion.Items.Clear(); ddlRegion.DataSource = _list; ddlRegion.DataTextField = "Text"; ddlRegion.DataValueField = "Control"; ddlRegion.DataBind(); } }
public static string LoadMasterPage(string urlRoot, string strSlugPage, HttpRequest request, Page pageContainer, PlaceHolder placeHolderMainContent, string lang) { //IList<SYS_PageLayout> list = new List<SYS_PageLayout>(); string strMaster = "MasterPage.master"; if (strSlugPage != string.Empty) { SYS_PageLayoutBSO _pageLayoutBSO = new SYS_PageLayoutBSO(); SYS_PageLayout _pageLayout = new SYS_PageLayout(); if (!AspNetCache.CheckCache("PageLayout_" + strSlugPage + "_" + lang.Replace("-", "_"))) { _pageLayout = _pageLayoutBSO.GetSYS_PageLayoutBySlug(strSlugPage, lang); if (_pageLayout == null) { _pageLayout = _pageLayoutBSO.GetSYS_PageLayoutBySlug("home", lang); } AspNetCache.SetCache("PageLayout_" + strSlugPage + "_" + lang.Replace("-", "_"), _pageLayout); } else { _pageLayout = (SYS_PageLayout)AspNetCache.GetCache("PageLayout_" + strSlugPage + "_" + lang.Replace("-", "_")); } if (_pageLayout != null) { SYS_TemplatePageBSO _templateBSO = new SYS_TemplatePageBSO(); SYS_TemplatePage _template = new SYS_TemplatePage(); if (!AspNetCache.CheckCache("Template_" + _pageLayout.TemplateId)) { _template = _templateBSO.GetSYS_TemplatePageById(_pageLayout.TemplateId); AspNetCache.SetCache("Template_" + _pageLayout.TemplateId, _template); } else { _template = (SYS_TemplatePage)AspNetCache.GetCache("Template_" + _pageLayout.TemplateId); } if (_template != null) { strMaster = _template.MasterControl; } } } return(strMaster); }
public static void AddWidgetPage(string urlRoot, string strSlugPage, HttpRequest request, Page pageContainer, PlaceHolder placeHolderMainContent) { //IList<SYS_PageLayout> list = new List<SYS_PageLayout>(); 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("-", "_")); } if (_pageLayout != null) { SYS_TemplatePageBSO _templateBSO = new SYS_TemplatePageBSO(); SYS_TemplatePage _template = new SYS_TemplatePage(); if (!AspNetCache.CheckCache("Template_" + _pageLayout.TemplateId)) { _template = _templateBSO.GetSYS_TemplatePageById(_pageLayout.TemplateId); AspNetCache.SetCache("Template_" + _pageLayout.TemplateId, _template); } else { _template = (SYS_TemplatePage)AspNetCache.GetCache("Template_" + _pageLayout.TemplateId); } if (_template != null) { string _path = urlRoot + "Client/Skins/Templates/" + _template.TemplateControl; Control objControl = (Control)pageContainer.LoadControl(_path); placeHolderMainContent.Controls.Add(objControl); AddWidgetPageLayout(objControl, _pageLayout.Id, urlRoot, pageContainer); } } } }
protected void btn_Order_Click(object sender, EventArgs e) { foreach (GridViewRow row in grvPageLayout.Rows) { TextBox textOrder = (TextBox)row.FindControl("txtPageOrder"); int cOrder = Convert.ToInt32(textOrder.Text); int ID = Convert.ToInt32(row.Cells[0].Text); SYS_PageLayoutBSO _pageLayoutBSO = new SYS_PageLayoutBSO(); _pageLayoutBSO.SYS_PageLayoutUpOrder(ID, cOrder); } clientview.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Cập nhật thành công !</div>"; ViewPageLayout(); AspNetCache.Reset(); }
protected void btn_edit_Click(object sender, EventArgs e) { try { SYS_PageLayout _pageLayout = new SYS_PageLayout(); _pageLayout = ReceiveHtml(); SYS_PageLayoutBSO _pageLayoutBSO = new SYS_PageLayoutBSO(); _pageLayoutBSO.UpdateSYS_PageLayout(_pageLayout); ViewPageLayout(); clientview.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Cập nhật thành công !</div>"; initControl(_pageLayout.Id); } catch (Exception ex) { clientview.Text = ex.Message.ToString(); } }
protected void btn_add_Click_more(object sender, EventArgs e) { try { SYS_PageLayout _pageLayout = new SYS_PageLayout(); _pageLayout = ReceiveHtml(); SYS_PageLayoutBSO _pageLayoutBSO = new SYS_PageLayoutBSO(); int id = _pageLayoutBSO.CreateSYS_PageLayoutGet(_pageLayout); ViewPageLayout(); clientview.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Thêm mới thành công !</div>"; } catch (Exception ex) { clientview.Text = ex.Message.ToString(); } }
private void initControl(int Id) { if (Id > 0) { btn_add.Visible = false; btn_edit.Visible = true; btn_add1.Visible = false; btn_add2.Visible = false; btn_edit1.Visible = true; try { SYS_PageLayoutBSO _pageLayoutBSO = new SYS_PageLayoutBSO(); SYS_PageLayout _pageLayout = _pageLayoutBSO.GetSYS_PageLayoutById(Id); hddID.Value = Convert.ToString(_pageLayout.Id); txtName.Text = _pageLayout.PageName; txtSlug.Text = _pageLayout.SlugPageName; txtOrder.Text = _pageLayout.Orders.ToString(); BindDropDownList(); ddlTemplate.SelectedValue = Convert.ToString(_pageLayout.TemplateId); } catch (Exception ex) { clientview.Text = ex.Message.ToString(); } } else { BindDropDownList(); btn_edit.Visible = false; btn_add.Visible = true; btn_edit1.Visible = false; btn_add1.Visible = true; btn_add2.Visible = true; } }
protected void grvPageLayout_RowCommand(object sender, GridViewCommandEventArgs e) { int Id = Convert.ToInt32(e.CommandArgument.ToString()); string nName = e.CommandName.ToLower(); switch (nName) { case "_edit": Response.Redirect("~/Homepage.aspx?dll=EditPageLayout&id=" + Id); break; case "_delete": SYS_PageLayoutBSO _pageLayoutBSO = new SYS_PageLayoutBSO(); _pageLayoutBSO.DeleteSYS_PageLayout(Id); ViewPageLayout(); break; case "_widget": break; } }
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; } } } } } }