예제 #1
0
        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> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>&nbsp;" + s1;
            }
            cate += cateNewsgroupBSO.GetCateNewsGroupByGroupCate(catenews.GroupCate).CateNewsGroupName.ToUpper(); //Sửa lại
            cate += "</a> &nbsp;<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> &nbsp;<img src='" + ResolveUrl("~/") + "images/icon_arrows1.png'>&nbsp; ";
            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);
        }
예제 #2
0
        private void ViewNews(int Id)
        {
            NewsGroupBSO newsGroupBSO = new NewsGroupBSO();
            NewsGroup newsGroup = newsGroupBSO.GetNewsGroupById(Id);
            if (newsGroup != null)
            {
                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;

                if (newsGroup.ImageThumb != "")
                    ltlImageThumb.Text = @"<img src='" + ResolveUrl("~/") + "Upload/NewsGroup/NewsGroupThumb/" + newsGroup.ImageThumb + "' align='left' class='border_image' width='250'  >";

            }
        }
        //#region ViewCateNews
        //private void ViewCateNews(int group)
        //{

        //    ddlCateNews.Items.Clear();
        //    CateNewsBSO catenewsBSO = new CateNewsBSO();
        //    DataTable table = catenewsBSO.GetCateGroupRoles(Language.language, group, Session["Admin_UserName"].ToString());
        //    commonBSO commonBSO = new commonBSO();
        //    commonBSO.FillToDropDown(ddlCateNews, table, "", "", "CateNewsName", "CateNewsID", "");
        //}
        //#endregion

        #region initControl
        private void initControl(int Id)
        {
            AdminBSO adminBSO = new AdminBSO();
            ETO.Admin admin = new ETO.Admin();
            if (Id > 0)
            {
                btn_add.Visible = false;
                btn_edit.Visible = true;
                try
                {
                    NewsGroup newsgroup = new NewsGroup();
                    NewsGroupBSO newsgroupBSO = new NewsGroupBSO();
                    newsgroup = newsgroupBSO.GetNewsGroupById(Id);
                    hddNewsGroupID.Value = Convert.ToString(newsgroup.NewsGroupID);
                    ddlCateNews.SelectedValue = Convert.ToString(newsgroup.CateNewsID);
                    hddParentNewsID.Value = Convert.ToString(newsgroup.ParentNewsID);

                    //rdbGroupCate.SelectedValue = Convert.ToString(newsgroup.GroupCate); //Thêm

                    txtTitle.Text = newsgroup.Title;
                    txtRadShort.Html = newsgroup.ShortDescribe;
                    txtRadFull.Html = newsgroup.FullDescribe;
                    hddImageThumb.Value = newsgroup.ImageThumb;
                    hddImageLarge.Value = newsgroup.ImageLarge;
                    hddFileName.Value = newsgroup.FileName;

                    txtAuthor.Text = newsgroup.Author;
                    txtRadDate.SelectedDate = newsgroup.PostDate;
                    hddRelationTotal.Value = Convert.ToString(newsgroup.RelationTotal);
                    rdbStatus.SelectedValue = Convert.ToString(newsgroup.Status);
                    rdbIshot.SelectedValue = Convert.ToString(newsgroup.Ishot);
                    rdbIshome.SelectedValue = Convert.ToString(newsgroup.Ishome);


                    hddCommentTotal.Value = Convert.ToString(newsgroup.CommentTotal);
                    hddIsView.Value = Convert.ToString(newsgroup.Isview);
                    hddCreateUserName.Value = newsgroup.CreatedUserName;
                    hddApprovalUserName.Value = newsgroup.ApprovalUserName;
                    hddApprovalDate.Value = Convert.ToString(newsgroup.ApprovalDate);


                    rdbComment.SelectedValue = Convert.ToString(newsgroup.IsComment);

                    admin = adminBSO.GetAdminById(Session["Admin_UserName"].ToString());

                    if (Session["Admin_UserName"].ToString().Equals("administrator") || adminBSO.CheckPermission(Session["Admin_UserName"].ToString(), "Approval"))
                    {
                        rdbApproval.SelectedValue = Convert.ToString(newsgroup.IsApproval);
                        rdbApproval.Enabled = true;
                    }
                    else
                    {
                        rdbApproval.SelectedValue = Convert.ToString(newsgroup.IsApproval);
                        rdbApproval.Enabled = false;
                    }

                    hddGroup.Value = newsgroup.GroupCate.ToString();
                    BindToCateNews(newsgroup.GroupCate);
                    ddlCateNewsGroup.SelectedValue = hddGroup.Value;
                    ddlCateNews.SelectedValue = Convert.ToString(newsgroup.CateNewsID);

                    rdbTypeNews.SelectedValue = Convert.ToString(newsgroup.TypeNews);

                }
                catch (Exception ex)
                {
                    clientview.Text = ex.Message.ToString();
                }
            }
            else
            {
                txtRadDate.SelectedDate = DateTime.Now;
                btn_add.Visible = true;
                btn_edit.Visible = false;
                if (Session["Admin_UserName"].ToString().Equals("administrator") || adminBSO.CheckPermission(Session["Admin_UserName"].ToString(), "Approval"))
                {

                    rdbApproval.Enabled = true;
                }
                else
                {

                    rdbApproval.Enabled = false;
                }

            }
        }
예제 #4
0
        protected void Send_Click(object sender, EventArgs e)
        {
            ccJoin.ValidateCaptcha(txtCapcha.Text.Trim());

            if (!ccJoin.UserValidated)
            {
                ErrorMess.Visible = true;
                txtCapcha.Focus();
                lblError.Text = "Mã bảo mật chưa chính xác";
                return;
            }
            else
            {
                NewsComment newsComment = ReceiveHtml();
                NewsCommentBSO newsCommentBSO = new NewsCommentBSO();
                newsCommentBSO.CreateNewsComment(newsComment);

                ConfigBSO configBSO = new ConfigBSO();
                Config config = configBSO.GetAllConfig(Language.language);

                string strBody = "Thông tin nhận xét đánh giá về bài viết trên trang Website " + config.WebName + " (" + config.WebDomain + ") : <br>";
                strBody += "<b>Tiêu đề: </b> " + newsComment.Title + "<br>";
                strBody += "<b>Họ tên khách hàng : </b> " + newsComment.FullName + "<br>";

                strBody += "<b>Email : </b> " + newsComment.Email + "<br>";
                strBody += "<b>Mã bài viết : </b> " + newsComment.NewsID + "<br>";
                strBody += "<b>Nội dung : </b> <br>" + newsComment.Content + "<br>";

                NewsGroupBSO newsBSO = new NewsGroupBSO();
                NewsGroup news = newsBSO.GetNewsGroupById(newsComment.NewsID);

                strBody += "<b>Tiêu đề bài viết : </b>  <a href='" + config.WebDomain + "/newsg/" + hddGroupCate.Value + "/" + newsComment.NewsID + "/" + GetString(news.Title) + "/default.aspx'>" + news.Title + "</a><br>";

                MailBSO mailBSO = new MailBSO();
                mailBSO.EmailFrom = newsComment.Email;

                mailBSO.EmailFrom = config.Email_from;

                string strObj = "Thông tin nhận xét về bài viết trên trang Web " + config.WebName + " (" + config.WebDomain + ") - Ngày " + DateTime.Now.ToString("dd:MM:yyyy");
                mailBSO.SendMail(config.Email_to, strObj, strBody);

                int Id = Convert.ToInt32(txtNewsGroupID.Value);
                Response.Redirect("~/newsg/" + hddGroupCate.Value + "/" + Id + "/2//default.aspx");
            }
        }
예제 #5
0
        protected void Send_Click(object sender, EventArgs e)
        {

            NewsComment newsComment = ReceiveHtml();
            NewsCommentBSO newsCommentBSO = new NewsCommentBSO();
            newsCommentBSO.CreateNewsComment(newsComment);

            ConfigBSO configBSO = new ConfigBSO();
            Config config = configBSO.GetAllConfig(Language.language);

            string strBody = "Thông tin nhận xét đánh giá về bài viết trên trang Website " + config.WebName + " (" + config.WebDomain + ") : <br>";
            strBody += "<b>Tiêu đề: </b> " + newsComment.Title + "<br>";
            strBody += "<b>Họ tên khách hàng : </b> " + newsComment.FullName + "<br>";

            strBody += "<b>Email : </b> " + newsComment.Email + "<br>";
            strBody += "<b>Mã bài viết : </b> " + newsComment.NewsID + "<br>";
            strBody += "<b>Nội dung : </b> <br>" + newsComment.Content + "<br>";

            NewsGroupBSO newsBSO = new NewsGroupBSO();
            NewsGroup news = newsBSO.GetNewsGroupById(newsComment.NewsID);

            strBody += "<b>Tiêu đề bài viết : </b>  <a href='" + config.WebDomain + "/News/" + hddGroupCate.Value + "/" + newsComment.NewsID + "/" + GetString(news.Title) + ".aspx'>" + news.Title + "</a><br>";

            MailBSO mailBSO = new MailBSO();
            mailBSO.EmailFrom = newsComment.Email;




            mailBSO.EmailFrom = config.Email_from;

            string strObj = "Thông tin nhận xét về bài viết trên trang Web " + config.WebName + " (" + config.WebDomain + ") - Ngày " + DateTime.Now.ToString("dd:MM:yyyy");
            mailBSO.SendMail(config.Email_to, strObj, strBody);



            int Id = Convert.ToInt32(txtNewsGroupID.Value);
            Response.Redirect("~/News/" + hddGroupCate.Value + "/" + Id + "/2/Default.aspx");


        }