public List <Product> GetListProducts(object Ticket, object TypeID) { _ws = new WS_TTX.WebService1SoapClient(); var listData = new List <Product>(); _listContent = _ws.getListProduct(Ticket.ToString()); WS_TTX.Product[] Info = _listContent.listProduct; if (Info != null) { for (int i = 0; i < Info.Length; i++) { if (Info[i].TypeID == int.Parse(TypeID.ToString())) { var product = new Product { ProductID = Info[i].ProductID, ProductName = Info[i].ProductName, LanguageID = Info[i].LanguageID, TypeID = Info[i].TypeID, TypeName = Info[i].TypeName }; listData.Add(product); } } } return(listData); }
public List <Category> GetListCategorys(object Ticket, object TypeID, object ProductID, object LanguageID) { _ws = new WS_TTX.WebService1SoapClient(); var listData = new List <Category>(); _listContent = _ws.getListContent(Ticket.ToString()); WS_TTX.Category[] Info = _listContent.listCategory; if (Info != null) { for (int i = 0; i < Info.Length; i++) { if (Info[i].TypeID == int.Parse(TypeID.ToString()) && Info[i].ProductID == int.Parse(ProductID.ToString()) && Info[i].LanguageID == int.Parse(LanguageID.ToString())) { var cate = new Category { CategoryID = Info[i].CategoryID, CategoryName = Info[i].CategoryName, TypeID = Info[i].TypeID, TypeName = Info[i].TypeName, ProductID = Info[i].ProductID, ProductName = Info[i].ProductName, LanguageID = Info[i].LanguageID, LanguageName = Info[i].LanguageName }; listData.Add(cate); } } } return(listData); }
public List <Language> GetListLanguages(object Ticket, object TypeID, object ProductID) { _ws = new WS_TTX.WebService1SoapClient(); var listData = new List <Language>(); _listContent = _ws.getListContent(Ticket.ToString()); WS_TTX.Language[] Info = _listContent.listLanguage; if (Info != null) { for (int i = 0; i < Info.Length; i++) { if (Info[i].TypeID == int.Parse(TypeID.ToString()) && Info[i].ProductID == int.Parse(ProductID.ToString())) { var lang = new Language { LanguageID = Info[i].LanguageID, LanguageName = Info[i].LanguageName, TypeID = Info[i].TypeID, TypeName = Info[i].TypeName, ProductID = Info[i].ProductID, ProductName = Info[i].ProductName }; listData.Add(lang); } } } return(listData); }
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 { } }
public List <Type> GetListTypes(object Ticket) { _ws = new WS_TTX.WebService1SoapClient(); var listData = new List <Type>(); _listContent = _ws.getListType(Ticket.ToString()); WS_TTX.TypeInfo[] Info = _listContent.listTypeInfo; if (Info != null) { for (int i = 0; i < Info.Length; i++) { var type = new Type { TypeID = Info[i].TypeID, TypeName = Info[i].TypeName }; listData.Add(type); } } return(listData); }
public string Login(object IpClient) { string _strResult = ""; try { _ws = new WS_TTX.WebService1SoapClient(); _LoginResult = _ws.login("dat6447", "ncud2014", IpClient.ToString(), "", ""); //_LoginResult. if (_LoginResult.authenticationResult == "Success" && _LoginResult.isAuthenticated == true) { _strResult = _LoginResult.authenticationTicket; } else { _strResult = "unsuccess"; } } catch (Exception ex) { } return(_strResult); }
public Image GetContentImageByID(object Ticket, object ProductID, object ID) { Image objImage = new Image(); _ws = new WS_TTX.WebService1SoapClient(); WS_TTX.ObjectImage Info = _ws.getContentImageByID(Ticket.ToString(), int.Parse(ProductID.ToString()), int.Parse(ID.ToString())); if (Info != null) { objImage.ID = Info.ID; objImage.Title = System.Uri.EscapeDataString(Info.Title); objImage.Summary = System.Uri.EscapeDataString(ConvertWordToHTML(Info.Summary)); objImage.dataBinary = Info.dataBinary; objImage.Author = Info.Author; objImage.ProductID = Info.ProductID; objImage.ProductName = Info.ProductName; objImage.CategoryID = Info.CategoryID; objImage.CategoryName = Info.CategoryName; objImage.DateCreate = Convert.ToDateTime(Info.DateCreate.ToString()).ToString("dd/MM/yyyy HH:mm:ss").ToString(); objImage.URLImg = Info.URLImg; } return(objImage); }
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); }
public ListData BindGridData(object Ticket, object TypeID, object ProductID, object LanguageID, object CategoryID, object FromDate, object ToDate, object TuKhoa, object PageIndex, object PageSize) { try { string _TuKhoa = System.Uri.UnescapeDataString(TuKhoa.ToString()); if (int.Parse(TypeID.ToString()) == 1) { _TuKhoa = SplitStringSearch(_TuKhoa); } _ws = new WS_TTX.WebService1SoapClient(); var data = new ListData(); int total = 0; List <NewsData> objDataNews = new List <NewsData>(); List <PhotosData> objDataPhotos = new List <PhotosData>(); DateTimeFormatInfo dtfi = CultureInfo.CreateSpecificCulture("en-US").DateTimeFormat; //DateTimeFormatInfo dtfi = new DateTimeFormatInfo(); string fromdate = DateTime.ParseExact(FromDate.ToString(), "dd/MM/yyyy", CultureInfo.InvariantCulture) .ToString("MM/dd/yyyy", CultureInfo.InvariantCulture); string todate = DateTime.ParseExact(ToDate.ToString(), "dd/MM/yyyy", CultureInfo.InvariantCulture) .ToString("MM/dd/yyyy", CultureInfo.InvariantCulture); dtfi.ShortDatePattern = @"M/d/yyyy"; dtfi.DateSeparator = "/"; DateTime _FromDate = Convert.ToDateTime(fromdate, dtfi); DateTime _ToDate = Convert.ToDateTime(todate, dtfi); int _TypeID = int.Parse(TypeID.ToString()); int _LangID = int.Parse(LanguageID.ToString()); int _ProductID = int.Parse(ProductID.ToString()); int _CateID = int.Parse(CategoryID.ToString()); int _PageIndex = int.Parse(PageIndex.ToString()); int _PageSize = int.Parse(PageSize.ToString()); if (int.Parse(TypeID.ToString()) == 1) { WS_TTX.ListNews _listData = _ws.getListSearchNews(Ticket.ToString(), _TypeID, _LangID, _ProductID , _CateID, _PageIndex, _PageSize, _FromDate, _ToDate, _TuKhoa); WS_TTX.ObjectNews[] Info = _listData.listNews; if (Info != null) { for (int i = 0; i < Info.Length; i++) { string _Title = ""; string _Content = ""; if (Info[i].Title != null) { _Title = System.Uri.EscapeDataString(Info[i].Title); } if (Info[i].Content != null) { _Content = System.Uri.EscapeDataString(Info[i].Content); } objDataNews.Add(new NewsData(Info[i].ID, Info[i].ProductID, _Title, _Content, Info[i].FileName, Info[i].Author, Info[i].CategoryID, Info[i].CategoryName, Convert.ToDateTime(Info[i].DateCreate.ToString()).ToString("dd/MM/yyyy HH:mm:ss").ToString())); } } total = _listData.total; data.ListNews = objDataNews; } else { WS_TTX.ListImage _listData = _ws.getListSearchImages(Ticket.ToString(), _TypeID, _LangID, _ProductID, _CateID , _PageIndex, _PageSize, _FromDate, _ToDate, _TuKhoa); WS_TTX.ObjectImage[] Info = _listData.listImage; if (Info != null) { for (int i = 0; i < Info.Length; i++) { string _Title = ""; string _Summary = ""; if (Info[i].Title != null) { _Title = System.Uri.EscapeDataString(Info[i].Title); } if (Info[i].Summary != null) { _Summary = System.Uri.EscapeDataString(Info[i].Summary); } objDataPhotos.Add(new PhotosData(Info[i].ID, _Title, _Summary, Info[i].CategoryID, Info[i].CategoryName, Info[i].ImageThumbString, Info[i].Author , Convert.ToDateTime(Info[i].DateCreate.ToString()).ToString("dd/MM/yyyy HH:mm:ss").ToString(), Info[i].FileName, Info[i].ProductID, Info[i].ProductName, Info[i].URLImg)); } } total = _listData.total; data.ListPhotos = objDataPhotos; } data.TotalRecords = total; return(data); } catch (Exception) { throw; } }