public clsHoivien() { // // TODO: Add constructor logic here // if (Globals.CheckExist) { try { //Create Table string Sql = "CREATE TABLE IF NOT EXISTS " + TableHoiVien + "("; Sql += "id nvarchar(255) NOT NULL default '', "; Sql += "title nvarchar(500) default NULL, "; Sql += "summary mediumtext, "; Sql += "status tinyint(4) default 0, "; Sql += "inquiry tinyint(4) default 0, "; Sql += "idx tinyint(4) default 0, "; Sql += "PRIMARY KEY (id)) "; Sql += "ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;"; DbTask db = new DbTask(); db.ExecuteNonQuery(Sql); } catch { } } if (!Membertask.IsAdministrator()) { _mIdAllow = Membertask.IsChuyenmuc(); } else { _mIdAllow = string.Empty; } }
protected void Page_Load(object sender, EventArgs e) { if (!Membertask.IsAdministrator() && Membertask.IsNewsTask() == string.Empty) { Response.Redirect(Globals.UrlRoot); } }
protected void Page_Load(object sender, EventArgs e) { if (!Membertask.IsAdministrator()) { Response.Redirect(Globals.UrlRoot); } }
private void GetData(string IdLienketC) { News news = new News(); RptIN.DataSource = news.GetAllDataSelect(IdLienketC); RptIN.DataBind(); // string vusername = ""; if (!Membertask.IsAdministrator()) { Member mem = new Member(); DataRow dr = mem.GetInfoName(Membertask.Name); vusername = dr["username"].ToString().Trim(); } else { vusername = string.Empty; } this.txtKeyword.Text = keyword; UssUrl sUrl1 = new UssUrl(Request.CurrentExecutionFilePath); sUrl1.SetParam("Keyword", Server.UrlEncode(txtKeyword.Text.ToString())); sUrl1.SetParam("groupid", groupid); sUrl1.SetParam("id", id); string PageQuery = "page"; string strcPage = Request.QueryString[PageQuery]; if (strcPage == null) { strcPage = "1"; } int cPage = Convert.ToInt32(strcPage); int TotalRecords, TotalPages; rptNews.DataSource = news.Searching_ForLienKet(vusername, keyword, groupid, cPage, 20, out TotalRecords, out TotalPages, IdLienketC); rptNews.DataBind(); PageList1.m_pTotalPage = TotalPages; PageList1.m_pPageQuery = PageQuery; PageList1.m_pCurrentPage = cPage; PageList1.m_pPageUrl = sUrl1.Url; PageList1.m_pIconPath = Globals.UrlImages; PageList2.m_pTotalPage = TotalPages; PageList2.m_pPageQuery = PageQuery; PageList2.m_pCurrentPage = cPage; PageList2.m_pPageUrl = sUrl1.Url; PageList2.m_pIconPath = Globals.UrlImages; if (TotalRecords == 0) { ltlTotal1.Visible = false; } ltlTotal.Text = ltlTotal1.Text = string.Format(Language.GetTextByID(45), TotalRecords); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { if (!Membertask.IsAdministrator() && Membertask.IsThanhvien() == string.Empty) { Response.Redirect(Globals.UrlRoot); } } }
protected void Page_Load(object sender, EventArgs e) { if (id == "" || id == string.Empty || id == null) { Response.Redirect(Globals.URLCurrent + "manager.aspx"); } if (!this.IsPostBack) { if (dr == null) { Response.Redirect(Globals.URLCurrent + "manager.aspx"); } ltlMember.Text = dr["fullname"].ToString() + " (" + dr["username"].ToString() + ")"; string sUserName = dr["username"].ToString(); imgIconHeader.ImageUrl = Globals.UrlImages + "icon_menu1.gif";; ltlHeader.Text = Language.GetTextByID(90); ltlNote.Text = Language.GetTextByID(28); ltlRole.Text = "(*) " + Language.GetTextByID(69); ltlRequireRole.Text = Language.GetTextByID(70); btnRegister.Text = Language.GetTextByID(37); cbxAdministrator.Text = Language.GetTextByID(68); cbxChuyenmuc.Text = Language.GetTextByID(93); cbxThanhvien.Text = Language.GetTextByID(3); cbxQTNoidung.Text = Language.GetTextByID(8); cbxPostOn.Text = Language.GetTextByID(243); if (Membertask.IsAdministrator(sUserName)) { cbxAdministrator.Checked = true; } if (Membertask.IsThanhvien(sUserName) != string.Empty) { cbxThanhvien.Checked = true; } if (Membertask.IsChuyenmuc(sUserName) != string.Empty) { cbxChuyenmuc.Checked = true; } if (Membertask.IsNewsTask(sUserName) != string.Empty) { cbxQTNoidung.Checked = true; } if (Membertask.IsPostOn(sUserName) != string.Empty) { cbxPostOn.Checked = true; } cbxAdministrator.Attributes.Add("onclick", "AdminCheck('Form1', this)"); } }
protected void Page_Load(object sender, EventArgs e) { string sLang = Globals.CurrentLang; if (sLang == "vn") { sLang = "vi"; test_lang = 1; } else { test_lang = 2; } group = new Groups(0); if (!this.IsPostBack) { // Set Editor Globals.CKEditor(txtContent); // End Set Editor txtFileImages.Attributes.Add("style", "Width:250px"); //tbxWidth.Attributes.Add("style", "Width:50px"); //tbxHeight.Attributes.Add("style", "Width:50px"); //ltlWidth.Text = Language.GetTextByID(231); //ltlHeight.Text = Language.GetTextByID(232); imgIconHeader.ImageUrl = Globals.UrlImages + "icon_menu1.gif";; ltlHeader.Text = Language.GetTextByID(159); ltlNote.Text = Language.GetTextByID(28); ltlRequireTitle.Text = "Nhập đầy đủ các trường bắt buộc!"; ltlRequireGroup.Text = Language.GetTextByID(94); rdpPublishDate.SelectedDate = DateTime.Now; ltlRequireContent.Text = Language.GetTextByID(36); BtPost.Text = Language.GetTextByID(218); if (Membertask.IsAdministrator() || (Membertask.IsTaonoidung() != string.Empty && Membertask.IsPostOn() != string.Empty)) { BtPost.Visible = true; } else { BtPost.Visible = false; } //Trees view treeview1.ShowCheckBoxes = TreeNodeTypes.All; treeview1.ShowLines = true; treeview1.ExpandDepth = 0; BildRoot(treeview1); } }
protected void PopulateCategories(TreeNode node) { string sgroup = "," + groupid + ","; group = new Groups(); DataTable dt = null; dt = group.GetChildNews(node.Value); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { TreeNode newNode = new TreeNode(); string sid = dr["pid"].ToString(); newNode.Text = dr["ptitle"].ToString(); newNode.Value = sid; if (sgroup.IndexOf("," + sid + ",") > -1) { newNode.Checked = true; } bool kiemtra = group.CheckChild(dr["pid"].ToString()); if (kiemtra) { newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.SelectExpand; } else { newNode.PopulateOnDemand = false; newNode.SelectAction = TreeNodeSelectAction.Select; } if (Membertask.IsAdministrator()) { node.ChildNodes.Add(newNode); } else { int Checkp = group.CheckP(dr["pid"].ToString(), Session["ID"].ToString()); if (Checkp == 1) { node.ChildNodes.Add(newNode); } else { } } } } }
public News() { if (Globals.CheckExist) { try { //Create Table string StrSql = "CREATE TABLE IF NOT EXISTS " + TableName + "("; StrSql += "id nvarchar(255) NOT NULL default '', "; StrSql += "title nvarchar(500) default NULL, "; StrSql += "groupid nvarchar(255) default NULL, "; StrSql += "fimage nvarchar(255) default NULL, "; StrSql += "summary mediumtext, "; StrSql += "created datetime default NULL, "; StrSql += "userid nvarchar(255) default NULL, "; StrSql += "status tinyint(4) default 2, "; StrSql += "PRIMARY KEY (id)) "; StrSql += "ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;"; DbTask db = new DbTask(); db.ExecuteNonQuery(StrSql); //Create Directory if (!System.IO.Directory.Exists(AbsImages)) { System.IO.Directory.CreateDirectory(AbsHtmls); } if (!System.IO.Directory.Exists(AbsHtmls)) { System.IO.Directory.CreateDirectory(AbsHtmls); } } catch { } } if (!Membertask.IsAdministrator()) { _mGroupIdAllow = Membertask.IsNewsTask(); } else { _mGroupIdAllow = string.Empty; } }
protected void Page_Load(object sender, EventArgs e) { string sLang = Globals.CurrentLang; if (sLang == "vn") { sLang = "vi"; test_lang = 1; } else { test_lang = 2; } group = new Groups(1); if (!this.IsPostBack) { Globals.CKEditor(txtContent); ltlGroup.Text = Language.GetTextByID(91); ltlNote.Text = Language.GetTextByID(28); ltlRequireTitle.Text = "Nhập đầy đủ các trường bắt buộc"; ltlGroup.Text = Language.GetTextByID(91); ltlRequireGroup.Text = Language.GetTextByID(94); rdpPublishDate.SelectedDate = DateTime.Now; ltlRequireContent.Text = Language.GetTextByID(36); BtPost.Text = Language.GetTextByID(218); if (Membertask.IsAdministrator() || (Membertask.IsTaonoidung() != string.Empty && Membertask.IsPostOn() != string.Empty)) { BtPost.Visible = true; } else { BtPost.Visible = false; } //Trees view treeview1.ShowCheckBoxes = TreeNodeTypes.All; treeview1.ShowLines = true; treeview1.ExpandDepth = 1; BildRoot(treeview1); // Hoivien //BuildHoivien(group.GetHoiVien()); } }
public Groups() { if (Globals.CheckExist) { try { //Create Table string Sql = "CREATE TABLE IF NOT EXISTS " + TableName + "("; Sql += "id nvarchar(255) NOT NULL default '', "; Sql += "parentid nvarchar(255) NOT NULL default '', "; Sql += "title nvarchar(500) default NULL, "; Sql += "link nvarchar(500) default NULL, "; Sql += "summary mediumtext, "; Sql += "status tinyint(4) default 0, "; Sql += "idx tinyint(4) default 0, "; Sql += "kind tinyint(4) default 0, "; Sql += "advert tinyint(4) default 1, "; Sql += "inquiry tinyint(4) default 0, "; Sql += "PRIMARY KEY (id)) "; Sql += "ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;"; DbTask db = new DbTask(); db.ExecuteNonQuery(Sql); } catch { } } if (!Membertask.IsAdministrator()) { _mIdAllow = Membertask.IsChuyenmuc(); } else { _mIdAllow = string.Empty; } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { Member mem = new Member(); DataRow dr = mem.GetInfoName(Membertask.Name); ltlWelcome.Text = Language.GetTextByID(109) + ": " + dr["fullname"].ToString(); //ddlLang.DataSource = Language.GetAllLanguage(); //ddlLang.DataValueField = "id"; //ddlLang.DataTextField = "title"; //ddlLang.DataBind(); //ddlLang.Attributes.Add("style", "border:1 solid #ff0000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; font-weight:bold; color: #ff0000; width:130px"); //try //{ // ddlLang.SelectedValue = Globals.CurrentLang; //} //catch //{ //} // ltlLanguage.Text = Language.GetTextByID(1); ltlProfile.Text = Language.GetTextByID(24); hlProfile.Text = Language.GetTextByID(25); hlProfile.NavigateUrl = Globals.UrlRoot + "profile/profile.aspx"; hlChangePwd.Text = Language.GetTextByID(26); hlChangePwd.NavigateUrl = Globals.UrlRoot + "profile/changepwd.aspx"; hlSignout.Text = Language.GetTextByID(27); hlSignout.NavigateUrl = Globals.UrlRoot + "profile/signout.aspx"; //=========== Thanh vien =========== if (!Membertask.IsAdministrator() && Membertask.IsThanhvien() == string.Empty) { tblMember.Visible = false; } else { tblMember.Visible = true; ltlMember.Text = Language.GetTextByID(2); hlRegMember.Text = Language.GetTextByID(4); hlRegMember.NavigateUrl = Globals.UrlRoot + "member/register.aspx"; hlMemberManager.Text = Language.GetTextByID(3); hlMemberManager.NavigateUrl = Globals.UrlRoot + "member/manager.aspx"; } //=========== Chuyen muc =========== if (!Membertask.IsAdministrator() && Membertask.IsChuyenmuc() == string.Empty) { tblGroups.Visible = false; } else { tblGroups.Visible = true; ltlGroup.Text = Language.GetTextByID(91); //tin hlRegGroup.Text = Language.GetTextByID(92); hlRegGroup.NavigateUrl = Globals.UrlRoot + "groups/register.aspx"; hlGroupManager.Text = Language.GetTextByID(93); hlGroupManager.NavigateUrl = Globals.UrlRoot + "groups/manager.aspx"; hlMenus.Text = Language.GetTextByID(14); hlMenus.NavigateUrl = Globals.UrlRoot + "groups/menu.aspx"; } //=========== Tao bai viet =========== if (!Membertask.IsAdministrator() && Membertask.IsNewsTask() == string.Empty) { tblCreate_new.Visible = false; } else { tblCreate_new.Visible = true; ltlCreate_content.Text = "Quản trị nội dung"; //Language.GetTextByID(158); hlCreate.Text = Language.GetTextByID(159); hlCreate.NavigateUrl = Globals.UrlRoot + "news/register.aspx"; hlList.Text = Language.GetTextByID(160); hlList.NavigateUrl = Globals.UrlRoot + "news/listbaiviet.aspx"; } //=========== To Chuc ============ if (!Membertask.IsAdministrator() && Membertask.IsTochuc() == string.Empty) { tblOrgNews.Visible = false; } else { tblOrgNews.Visible = true; ltlOrgNews.Text = Language.GetTextByID(11); hrBanner.Text = Language.GetTextByID(342); hrBanner.NavigateUrl = Globals.UrlRoot + "Slideshow/Slideshow.aspx"; hrfooter.Text = Language.GetTextByID(343); hrfooter.NavigateUrl = Globals.UrlRoot + "publish/footer.aspx"; } //========Quan tri Web =========== if (!Membertask.IsAdministrator()) { tblAdministrator.Visible = false; } else { tblAdministrator.Visible = true; ltlAdministrator.Text = Language.GetTextByID(312); hlInforWeb.Text = Language.GetTextByID(314); hlInforWeb.NavigateUrl = Globals.UrlRoot + "webmanager/infor_manager.aspx"; } } }
protected void rptMember_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Header) { Literal ltlIndexHeader = (Literal)e.Item.FindControl("ltlIndexHeader"); ltlIndexHeader.Text = Language.GetTextByID(40); Literal ltlTitleHeader = (Literal)e.Item.FindControl("ltlTitleHeader"); ltlTitleHeader.Text = Language.GetTextByID(57); Literal ltlLastUpdateHeader = (Literal)e.Item.FindControl("ltlLastUpdateHeader"); ltlLastUpdateHeader.Text = Language.GetTextByID(69); Literal ltlStatusHeader = (Literal)e.Item.FindControl("ltlStatusHeader"); ltlStatusHeader.Text = Language.GetTextByID(39); Literal ltlEditHeader = (Literal)e.Item.FindControl("ltlEditHeader"); ltlEditHeader.Text = Language.GetTextByID(42); Literal ltlDeleteHeader = (Literal)e.Item.FindControl("ltlDeleteHeader"); ltlDeleteHeader.Text = Language.GetTextByID(43); } if (e.Item.ItemIndex != -1 && e.Item.ItemType != ListItemType.Separator) { HtmlTableRow trItems = (HtmlTableRow)e.Item.FindControl("trItems"); Literal ltlID = (Literal)e.Item.FindControl("ltlID"); Literal ltlID_Index = (Literal)e.Item.FindControl("ltlID_Index"); Literal ltlTitle = (Literal)e.Item.FindControl("ltlTitle"); Literal ltlCreated = (Literal)e.Item.FindControl("ltlCreated"); LinkButton lbtOnline = (LinkButton)e.Item.FindControl("lbtOnline"); HtmlAnchor hrEdit = (HtmlAnchor)e.Item.FindControl("hrEdit"); Literal ltlIDMember = (Literal)e.Item.FindControl("ltlIDMember"); CheckBox checkboxID = (CheckBox)e.Item.FindControl("checkboxID"); DataRowView dr = (DataRowView)e.Item.DataItem; if (dr != null) { if (e.Item.ItemIndex % 2 == 1) { trItems.Attributes.Add("class", "alter"); } else { trItems.Attributes.Add("class", "item"); } ltlID.Text = dr["id"].ToString(); ltlID_Index.Text = (e.Item.ItemIndex + 1).ToString(); //STT ltlIDMember.Text = dr["id"].ToString(); ltlTitle.Text = dr["fullname"].ToString() + " (" + dr["username"].ToString() + ")"; if (Membertask.IsAdministrator(dr["username"].ToString())) { if (Convert.ToInt32(dr["IsAdmin"].ToString()) != 1) { ltlCreated.Text = Language.GetTextByID(68); } else { ltlCreated.Text = Language.GetTextByID(199); } } else { ltlCreated.Text = Language.GetTextByID(2); } lbtOnline.Text = (Convert.ToInt32(dr["status"]) == 1) ? "<font color='#0000FF'>" + Language.GetTextByID(73) + "</font>" : "<font color='#FF0000'>" + Language.GetTextByID(74) + "</font>"; lbtOnline.CommandArgument = dr["id"].ToString(); lbtOnline.Visible = false; sUrl = new UssUrl(Globals.URLCurrent + "update.aspx"); sUrl.SetParam("id", dr["id"].ToString()); hrEdit.InnerText = Language.GetTextByID(42); hrEdit.HRef = sUrl.Url; hrEdit.Visible = false; checkboxID.Visible = false; if (Convert.ToInt32(dr["IsAdmin"].ToString()) != 1) { hrEdit.Visible = true; lbtOnline.Visible = true; checkboxID.Visible = true; } } } }