private void ViewNavigator(int Id) { CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO(); CateNewsBSO catenewsBSO = new CateNewsBSO(); CateNews catenews = catenewsBSO.GetCateNewsById(Id); //HyperLinkCate.NavigateUrl = "~/Default.aspx?go=cate&Id=" + catenews.CateNewsID; title_name.Text = catenews.CateNewsName; // Label1.Text = "<div class='gt_title'> <div class='title_article_top'>" + Literal1.Text + "</div><div class='title_article_bg'></div></div>"; string cate = "<a href='" + ResolveUrl("~/") + "FullNews/" + catenews.GroupCate + "/" + GetString(cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName) + "/default.aspx' class='content_Text_Cat'>"; string s1 = ""; while (catenews.ParentNewsID != 0) { int pId = catenews.ParentNewsID; catenews = catenewsBSO.GetCateNewsById(pId); s1 = "<a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + "/default.aspx' class='content_Text_Cat'>" + catenews.CateNewsName + "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' >" + s1; } cate += cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName.ToUpper(); //Sửa lại cate += "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' > "; cate += s1; title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + Resources.resource.Home + "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' > "; title_cate.Text += cate; Page.Title = "Thủy điện Sơn La : " + GetString(catenews.CateNewsName); }
private void ViewNavigator(int Id) { CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO(); OfficialBSO officialBSO = new OfficialBSO(); ETO.Official official = officialBSO.GetOfficialById(Id); CateNewsBSO catenewsBSO = new CateNewsBSO(); CateNews catenews = catenewsBSO.GetCateNewsById(official.CateOfficialID); //HyperLinkCate.NavigateUrl = "~/Default.aspx?go=cate&Id=" + catenews.CateNewsID; title_name.Text = "<a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + "/default.aspx'>" + catenews.CateNewsName + "</a>"; string cate = "<a href='" + ResolveUrl("~/") + "FullNews/" + catenews.GroupCate + "/" + GetString(cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName) + "/default.aspx' class='content_Text_Cat'>"; string s1 = ""; while (catenews.ParentNewsID != 0) { int pId = catenews.ParentNewsID; catenews = catenewsBSO.GetCateNewsById(pId); s1 = "<a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + "/default.aspx' class='content_Text_Cat'>" + catenews.CateNewsName + "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' > " + s1; } cate += cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName.ToUpper(); //Sửa lại cate += "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png' >"; cate += s1; title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + Resources.resource.Home + "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'> "; title_cate.Text += cate; }
private void ViewNewsGroupDetail(int Id) { CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO(); NewsGroupBSO newsgroupBSO = new NewsGroupBSO(); NewsGroup newsgroup = newsgroupBSO.GetNewsGroupById(Id); if (newsgroup == null) Response.Redirect("~/Default.aspx"); ltlTitle.Text = newsgroup.Title; LabelDate.Text = newsgroup.PostDate.ToString("dd/MM/yyyy");// Convert.ToString(newsgroup.PostDate); ltlDescribe.Text = newsgroup.ShortDescribe; FullDescirbe.Text = newsgroup.FullDescribe; LabelAuthor.Text = newsgroup.Author; txtNewsGroupID.Value = Convert.ToString(newsgroup.NewsGroupID); //if (newsgroup.ImageThumb != "") // ltlImageThumb.Text = @"<img src='"+ResolveUrl("~/")+"Admin/Upload/NewsGroup/NewsGroupThumb/" + newsgroup.ImageThumb + "' align='left' class='border_image' width='250' >"; //Page.Title = newsgroup.Title; if (newsgroup.FileName != "") ltlFile.Text = @"<a href='" + ResolveUrl("~/") + "Admin/Upload/NewsGroup/Files/" + newsgroup.FileName + "'><img src='" + ResolveUrl("~/") + "images/icon_file.png' width='30' class='icon_bullet'/> Tải File đính kèm</a>"; newsgroupBSO.NewsGroupClickUpdate(Id); NewsGroupFollow(newsgroup.NewsGroupID, newsgroup.CateNewsID); CateNewsBSO catenewsBSO = new CateNewsBSO(); CateNews catenews = catenewsBSO.GetCateNewsById(newsgroup.CateNewsID); //HyperLinkCate.NavigateUrl = "~/Default.aspx?go=cate&Id=" + catenews.CateNewsID; title_name.Text = "<a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + ".aspx'>" + catenews.CateNewsName + "</a>"; string cate = "<a href='" + ResolveUrl("~/") + "FullNews/" + catenews.GroupCate + "/" + GetString(cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName) + ".aspx' class='content_Text_Cat'>"; string s1 = ""; while (catenews.ParentNewsID != 0) { int pId = catenews.ParentNewsID; catenews = catenewsBSO.GetCateNewsById(pId); s1 = "<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'><a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + ".aspx'' class='content_Text_Cat'>" + catenews.CateNewsName + "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'> " + s1; } cate += cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName.ToUpper(); //Sửa lại cate += "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>"; cate += s1; title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + String.Format(Resources.resource.Home) + "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'> "; title_cate.Text += cate; if (!String.IsNullOrEmpty(Request["error"])) error.Text = "<div class='error_register_text'>" + String.Format(Resources.resource.ThanksComment) + "</div>"; if (!newsgroup.IsComment) { CommentPanel.Visible = false; } else { CommentPanel.Visible = true; GetNewsCommentById(Id); } Page.Title = GetString(newsgroup.Title); }
private void InitControl(int id) { if (id > 0) { btn_add.Visible = false; btn_edit.Visible = true; try { var catenewsBSO = new CateNewsBSO(); var catenews = catenewsBSO.GetCateNewsById(id); hddCateNewsID.Value = Convert.ToString(catenews.CateNewsID); hddParentID.Value = Convert.ToString(catenews.ParentNewsID); ddlCateNews.SelectedValue = Convert.ToString(catenews.ParentNewsID); ddlCateNews.Items.Remove(new ListItem(catenews.CateNewsName, Convert.ToString(catenews.CateNewsID))); txtCateNewsName.Text = catenews.CateNewsName; hddCateNewsOrder.Value = Convert.ToString(catenews.CateNewsOrder); hddCateNewsTotal.Value = Convert.ToString(catenews.CateNewsTotal); //rdbGroupCate.SelectedValue = Convert.ToString(catenews.GroupCate); hddIcon.Value = catenews.Icon; hddImage.Value = catenews.Image; uploadPreview.Src = ResolveUrl("~/Upload/Category/") + catenews.Icon; uploadPreview1.Src = ResolveUrl("~/Upload/Category/") + catenews.Image; txtSlogan.Text = catenews.Slogan; hddUserName.Value = Session["Admin_UserName"].ToString(); hddCreated.Value = DateTime.Now.ToString(); // HddGroupCate.Value = Convert.ToString(catenews.GroupCate); rdbType.SelectedValue = Convert.ToString(catenews.isUrl); txtUrl.Text = catenews.Url; if (catenews.isUrl == true) { txtUrl.Visible = true; } else { txtUrl.Visible = false; } ViewCateGroup(catenews.GroupCate); } catch (Exception ex) { clientview.Text = ex.Message.ToString(); } } else { btn_edit.Visible = false; btn_add.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { int Id = 0; if (Page.RouteData.Values["Id"] != null) int.TryParse(Page.RouteData.Values["Id"].ToString().Replace(",", ""), out Id); if (Page.RouteData.Values["dll"] != null) NavigationTitle(Page.RouteData.Values["dll"].ToString()); hddCateNewsID.Value = Convert.ToString(Id); if (!IsPostBack) { CateNewsBSO catenewBSO = new CateNewsBSO(); CateNews catenews = catenewBSO.GetCateNewsById(Id); ltlTitle.Text = catenews.CateNewsName; initControl(Id); } }
private void GetNewsGroupByCate(int cId) { CateNewsGroupBSO cateNewsgroupBSO = new CateNewsGroupBSO(); NewsGroupBSO newsGroupBSO = new NewsGroupBSO(); DataTable table = newsGroupBSO.GetNewsGroupByCate(cId, Language.language, "1"); DataView view = new DataView(table); view.Sort = "PostDate Desc"; table = view.ToTable(); DataTable tableClone = table.Clone(); DataTable tblClone = table.Clone(); for (int j = 0; j < table.Rows.Count; j++) { if (j < 10) tableClone.ImportRow(table.Rows[j]); else if (j < 20) { tblClone.ImportRow(table.Rows[j]); Label1.Text = "<div class='gt_title'> <div class='title_article_top'>Các tin khác</div></div>"; } else break; } if (table.Rows.Count > 0) { DataListCateNews.Visible = true; DataListCateNews.DataSource = tableClone; DataListCateNews.DataBind(); CateNewsPanel.Visible = true; Repeater1.DataSource = tblClone; Repeater1.DataBind(); } else { DataListCateNews.Visible = false; CateNewsPanel.Visible = false; } CateNewsBSO catenewsBSO = new CateNewsBSO(); CateNews catenews = catenewsBSO.GetCateNewsById(cId); //HyperLinkCate.NavigateUrl = "~/Default.aspx?go=cate&Id=" + catenews.CateNewsID; title_name.Text = catenews.CateNewsName; // Label1.Text = "<div class='gt_title'> <div class='title_article_top'>" + Literal1.Text + "</div><div class='title_article_bg'></div></div>"; string cate = "<a href='" + ResolveUrl("~/") + "FullNews/" + catenews.GroupCate + "/" + GetString(cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName) + "/default.aspx' class='content_Text_Cat'>"; string s1 = ""; while (catenews.ParentNewsID != 0) { int pId = catenews.ParentNewsID; catenews = catenewsBSO.GetCateNewsById(pId); s1 = "<a href='" + ResolveUrl("~/") + "Category/" + catenews.GroupCate + "/" + catenews.CateNewsID + "/" + GetString(catenews.CateNewsName) + "/default.aspx' class='content_Text_Cat'>" + catenews.CateNewsName + "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'> " + s1; } cate += cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName.ToUpper(); //Sửa lại cate += "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>"; cate += s1; title_cate.Text = "<a href='" + ResolveUrl("~/") + "Default.aspx' class='content_Text_Cat'>" + Resources.resource.Home + "</a> <img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'> "; title_cate.Text += cate; Page.Title = GetString(cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName); }
private void sendMailToGroup(ListQuestion lstQuestion) { /* ------------- Gui email den nguoi co trach nhiem tra loi cau hoi --*/ string strObj = "Ban nhan duoc yeu cau ho tro tu khach hang cua EVNIT. Ngay gui: " + DateTime.Now.ToString("dd/MM/yyyy"); string strBody = "Khách hàng có gửi cho bạn một yêu cầu hỗ trợ.<br /><br/>"; strBody += "<i>Tiêu đề : </i><strong>" + lstQuestion.Question_Title + "</strong><br/>"; strBody += "<span><i>Nội dung:</i><br /></span>"; strBody += "<div style='margin-left: 20px; font-size: 11pt; border-left: 3px solid green; padding: 5px;'>"; strBody += lstQuestion.Question_Content; strBody += "</div>"; strBody += "<div style='border-bottom: 1px dashed red; width: 500px; height: 20px;'/>"; strBody += "<p>Trang hỗ trợ sản phẩm dịch vụ EVNIT <strong>http://support.evn.com.vn</strong></p>"; MailBSO mailBSO = new MailBSO(); ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); mailBSO.EmailFrom = config.Email_from; CateNewsBSO cateNewsBSO = new CateNewsBSO(); CateNews cateNews = new CateNews(); cateNews = cateNewsBSO.GetCateNewsById(int.Parse(ddlCateNews.SelectedValue.ToString())); //list user of product //Get list email AdminBSO adminBSO = new AdminBSO(); DataTable dtUser = new DataTable(); dtUser = adminBSO.GetAllAdmin(); if (dtUser.Rows.Count > 0) { DataView view1 = new DataView(dtUser); string strUser = cateNews.Roles; strUser = strUser.Remove(strUser.LastIndexOf(",")).Replace(",", "','"); view1.RowFilter = "Admin_UserName in('" + strUser + "')"; dtUser = view1.ToTable(); for (int i = 0; i < dtUser.Rows.Count; i++) { //clientview.Text += dtUser.Rows[i]["Admin_Email"].ToString(); mailBSO.SendMail(dtUser.Rows[i]["Admin_Email"].ToString(), strObj, strBody); //sendMailToGroup(dtUser.Rows[i]["Admin_Email"].ToString().Trim()); //Gui mai den nhom support cua san pham } } /* ------------- End Gui email den nguoi co trach nhiem tra loi cau hoi --*/ }