Example #1
0
        protected void LoadData(string ticket, int proID, int id)
        {
            try
            {
                WS_TTX.WebService1SoapClient _ws  = new WS_TTX.WebService1SoapClient();
                WS_TTX.ObjectNews            Info = _ws.getContentNewsByID(ticket, proID, id);
                if (Info != null)
                {
                    this.litDateTime.Text  = Convert.ToDateTime(Info.DateCreate.ToString()).ToString("HH:mm, dd/MM/yyyy");
                    this.litTittle.Text    = Info.Title;
                    this.litSapo.Text      = ConvertWordToHTML(Info.Summary);
                    this.litContents.Text  = ConvertWordToHTML(Info.Content);
                    this.litCategorys.Text = Info.CategoryName;
                    if (Info.Author != "")
                    {
                        this.litAuthor.Text += "<div class=\"author\">";
                        this.litAuthor.Text += Info.Author;
                        this.litAuthor.Text += "</div>";
                    }
                    InsertLogTin(Info.CategoryName, Info.Title, Info.ProductID, Info.ID, 0, _user.UserID, _user.UserName);
                }
                //if (_dr["News_DateEdit"] != System.DBNull.Value)
                //    this.litDateTime.Text = Convert.ToDateTime(_dr["News_DateEdit"]).ToString("HH:mm, dd/MM/yyyy");
                //if (_dr["News_DatePublished"] != System.DBNull.Value)
                //    this.litDateTime.Text = Convert.ToDateTime(_dr["News_DatePublished"]).ToString("HH:mm, dd/MM/yyyy");
                //this.litTittle.Text = _dr["News_Tittle"].ToString();
                //this.litSapo.Text = _dr["News_Summary"].ToString();
                //string contents = _dr["News_Body"].ToString();
                //this.litCategorys.Text = "<a href=\"#\">" + HPCBusinessLogic.UltilFunc.GetCategoryName(_dr["CAT_ID"]) + "</a>";
                ////this.litContents.Text = SearchImgTag(contents);
                //this.litContents.Text = contents;

                //if (_dr["News_AuthorName"] != null)
                //{
                //    this.litAuthor.Text += "<div class=\"author\">";
                //    this.litAuthor.Text += _dr["News_AuthorName"].ToString();
                //    this.litAuthor.Text += "</div>";
                //}
            }
            catch { }
        }
Example #2
0
        public News GetContentNewsByID(object Ticket, object ProductID, object ID)
        {
            News objNews = new News();

            _ws = new WS_TTX.WebService1SoapClient();
            WS_TTX.ObjectNews Info = _ws.getContentNewsByID(Ticket.ToString(), int.Parse(ProductID.ToString()), int.Parse(ID.ToString()));
            if (Info != null)
            {
                objNews.ID           = Info.ID;
                objNews.Title        = System.Uri.EscapeDataString(Info.Title);
                objNews.Summary      = System.Uri.EscapeDataString(ConvertWordToHTML(Info.Summary));
                objNews.Content      = System.Uri.EscapeDataString(ConvertWordToHTML(Info.Content));
                objNews.Author       = Info.Author;
                objNews.ProductID    = Info.ProductID;
                objNews.ProductName  = Info.ProductName;
                objNews.CategoryID   = Info.CategoryID;
                objNews.CategoryName = Info.CategoryName;
                objNews.DateCreate   = Convert.ToDateTime(Info.DateCreate.ToString()).ToString("dd/MM/yyyy HH:mm:ss").ToString();
                objNews.FileName     = Info.FileName;
            }
            return(objNews);
        }