Ejemplo n.º 1
0
        public ActionResult GetNews(int page=1)
        {
            List<News> news = new List<News>();
            TViewSummary view = new TViewSummary();
            view.CurrentPage = page;
            //TODO убрать
            //view.CurrentPage = page;
            //view.TotalPages = 10;
            //TODO поставить 0
            TNews[] newsRec=new TNews[0];

            //TODO убрать
            //TNews n = new TNews();
            /*n.NewsDate = new DateTime();
            n.Title = "Title";
            n.Text = "В аукционном приглашении AU123456789 произошли изменения";
            n.References = new TReference[1];
            n.References[0] = new TReference();
            n.References[0].Link = "AU123456789";
            n.References[0].LinkedID = 1;
            for (int i = 0; i < 30; i++)
            {
                newsRec[i] = n;
            }*/

            //TODO убрать комменты
            client.GetNews(ref view,ref newsRec);
            foreach (TNews rec in newsRec)
            {
                news.Add(new News(DateTimeUtils.DoubleToDateTime(rec.NewsDate), rec.Title, rec.HyperText.Equals("")?rec.Text:rec.HyperText));
            }
            PageStateStruc p;
            p.news = news;
            p.viewSummary = view;
            return Json(p);
        }
Ejemplo n.º 2
0
        public FileResult Rss()
        {
            TViewSummary view = new TViewSummary();
            TNews[] newsRec = new TNews[0];
            view.CurrentPage = 1;
            client.GetNews(ref view,ref newsRec);

            List<SyndicationItem> rssItems = new List<SyndicationItem>();
            SyndicationFeed feed =
                new SyndicationFeed("ГОСЗАКУПКИ РБ",
                                    "Новости аукционов ЭТП ГОСЗАКУПКИ РБ",
                                    new Uri(Request.Url.ToString()),
                                    "rssID",
                                    DateTime.Now);

            foreach (TNews rec in newsRec)
            {
                var rssItem = new SyndicationItem(rec.Title,
                    rec.Text,
                    new Uri("http://zakupki.butb.by"),
                    rec.NewsID.ToString(),
                    DateTimeUtils.DoubleToDateTime(rec.NewsDate));
                rssItems.Add(rssItem);
            }
            feed.Items = rssItems;

            return new FeedResult(feed, FeedType.Rss);
        }
Ejemplo n.º 3
0
 /// <remarks/>
 public void GetNewsAsync(TViewSummary ViewSummary, TNews[] News) {
     this.GetNewsAsync(ViewSummary, News, null);
 }
Ejemplo n.º 4
0
 /// <remarks/>
 public void GetNewsAsync(TViewSummary ViewSummary, TNews[] News, object userState) {
     if ((this.GetNewsOperationCompleted == null)) {
         this.GetNewsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetNewsOperationCompleted);
     }
     this.InvokeAsync("GetNews", new object[] {
                 ViewSummary,
                 News}, this.GetNewsOperationCompleted, userState);
 }
Ejemplo n.º 5
0
 public bool GetNews(ref TViewSummary ViewSummary, ref TNews[] News) {
     object[] results = this.Invoke("GetNews", new object[] {
                 ViewSummary,
                 News});
     ViewSummary = ((TViewSummary)(results[1]));
     News = ((TNews[])(results[2]));
     return ((bool)(results[0]));
 }