private string t; //ContentType protected void Page_Load(object sender, EventArgs e) { try { t = Globals.GetStringFromQueryString("t"); btnDelete.OnClientClick = "if (confirm('Nếu xóa chuyên mục này, tất cả tin của chuyên mục này sẽ bị mất hết! Bạn có chắc là muốn xóa hay không?') == false) return false;"; if (!IsPostBack) { string Action = Globals.GetStringFromQueryString("Action"); Globals.BindLanguageToDDL(ddlLanguage); Lang = ddlLanguage.SelectedValue; Globals.BindLanguageToDDL(ddlLanguage2); CommonDropDownList objDDL = new CommonDropDownList(); objDDL.LoadDropDownListArticleCategory(ddlCategory, Lang, "Root", t); LoadTreeViewCategory(TreeViewCategory, Lang); if (Action == "Edit") { btnSave.Text = "Cập nhật"; LoadDataEdit(); linkAddCategory.Visible = true; linkAddCategory.NavigateUrl = Globals.GetAdminFolderUrl() + "Article/Category.aspx?t=" + t; } else { btnSave.Text = "Thêm"; } LoadText(Action); } } catch { } }
protected void ddlLanguage_SelectedIndexChanged(object sender, EventArgs e) { LoadGridViewArticle(ddlLanguage.SelectedValue, Convert.ToInt32(ddlCategory.SelectedValue)); CommonDropDownList objDDL = new CommonDropDownList(); objDDL.LoadDropDownListArticleCategory(ddlCategory, ddlLanguage.SelectedValue, "--- Tất cả ---", t); }
protected void Page_Load(object sender, EventArgs e) { string Action = Globals.GetStringFromQueryString("Action"); t = Globals.GetStringFromQueryString("t"); if (fileUploadImage.IsPosting) { Session["FileImageName"] = Globals.ProcessFileUpload(fileUploadImage, true); } if (!IsPostBack) { Globals.BindLanguageToDDL(ddlLanguage); CommonDropDownList objCateDDL = new CommonDropDownList(); objCateDDL.LoadDropDownListArticleCategory(ddlCategory, ddlLanguage.SelectedValue, "--- Vui lòng chọn ---", t); if (Action == "Edit") { LoadDataEdit(); } LoadText(Action); if (t == "service" || t == "ssg" || t == "ssf" || t == "pt" || t == "job" || t == "text" || t == "agent" || t == "promotion" || t == "ndth" || t == "xdth") { //ddlCategory.SelectedIndex = 1; //ddlCategory.Enabled = false; trCategory.Visible = false; } } }
private void LoadDataEdit() { try { int ArticleID = Globals.GetIntFromQueryString("ArticleID"); int CateID = Globals.GetIntFromQueryString("CateID"); string LangEdit = Globals.GetStringFromQueryString("Lang"); Article objNews = new Article(); DataSet dsNews = new DataSet(); ddlLanguage.SelectedValue = LangEdit; CommonDropDownList objCateDDL = new CommonDropDownList(); objCateDDL.LoadDropDownListArticleCategory(ddlCategory, LangEdit, "--- Vui lòng chọn ---", t); ddlCategory.SelectedValue = CateID.ToString(); dsNews = objNews.GetArticleByArticleID("Article", ArticleID, LangEdit); txtTitle.Value = Convert.ToString(dsNews.Tables[0].Rows[0]["Title"]); txtKeyword.Value = Convert.ToString(dsNews.Tables[0].Rows[0]["Keyword"]); txtExcerpt.Value = Convert.ToString(dsNews.Tables[0].Rows[0]["Excerpt"]); txtImageDesc.Value = Convert.ToString(dsNews.Tables[0].Rows[0]["ImageDesc"]); txtAuthor.Value = Convert.ToString(dsNews.Tables[0].Rows[0]["Authors"]); fckContent.Value = Convert.ToString(dsNews.Tables[0].Rows[0]["Content"]); ImageArticle.Src = Globals.GetUploadsUrl() + Convert.ToString(dsNews.Tables[0].Rows[0]["ImageURL"]); rblViewIndex.SelectedValue = Convert.ToString(dsNews.Tables[0].Rows[0]["ViewIndex"]); cbHotArticle.Checked = Convert.ToBoolean(dsNews.Tables[0].Rows[0]["IsHot"]); Session["FileImageName"] = Convert.ToString(dsNews.Tables[0].Rows[0]["ImageURL"]); } catch { } }
protected void ddlLanguage_SelectedIndexChanged(object sender, EventArgs e) { CommonDropDownList objCateDDL = new CommonDropDownList(); objCateDDL.LoadDropDownListArticleCategory(ddlCategory, ddlLanguage.SelectedValue, "--- Vui lòng chọn ---", t); if (t == "agent" || t == "promotion" || t == "service" || t == "job" || t == "text" || t == "ndth" || t == "xdth") { ddlCategory.SelectedIndex = 1; ddlCategory.Enabled = false; } }
protected void Page_Load(object sender, EventArgs e) { t = Globals.GetStringFromQueryString("t"); if (!IsPostBack) { Globals.BindLanguageToDDL(ddlLanguage); Lang = ddlLanguage.SelectedValue; CommonDropDownList objDDL = new CommonDropDownList(); objDDL.LoadDropDownListArticleCategory(ddlCategory, Lang, "--- Tất cả ---", t); LoadGridViewArticle(Lang, -1); LoadText(); if (t == "bs") { ddlLanguage.Enabled = false; } } }
private void LoadDataEdit() { try { ArticleCategory obj = new ArticleCategory(); int CateID = Globals.GetIntFromQueryString("CateID"); int ParentCateID = obj.GetParentCategoryIDByCategoryID(CateID, t); string LangEdit = Globals.GetStringFromQueryString("Lang"); DataSet ds = obj.GetCategoryByCategoryID("ArticleCategory", CateID, LangEdit); ddlLanguage.SelectedValue = LangEdit; CommonDropDownList objDDL = new CommonDropDownList(); objDDL.LoadDropDownListArticleCategory(ddlCategory, LangEdit, "Root", t); ddlCategory.SelectedValue = ParentCateID.ToString(); txtCategoryName.Value = Convert.ToString(ds.Tables[0].Rows[0]["CategoryName"]); txtCategoryOrder.Value = Convert.ToString(ds.Tables[0].Rows[0]["CategoryOrder"]); // ddlLanguage2.SelectedValue = ddlLanguage.SelectedValue; LoadTreeViewCategory(TreeViewCategory, ddlLanguage2.SelectedValue); } catch { } }
protected void ddlLanguage_SelectedIndexChanged(object sender, EventArgs e) { CommonDropDownList objDDL = new CommonDropDownList(); objDDL.LoadDropDownListArticleCategory(ddlCategory, ddlLanguage.SelectedValue, "Root", t); }