Beispiel #1
0
        /// <summary>
        /// 撤销泰隆优选大使公告。
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public void UndoAmbassadorNews(AmbassadorNewsVM data, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            NewsInfoMaintainVM news = new NewsInfoMaintainVM();

            if (data != null)
            {
                news.SysNo    = data.SysNo;
                news.NewsType = 12;
                news.Status   = NewsStatus.Deactive;
                news.Title    = data.Title;
                news.Content  = data.Content;
                ///处理大区信息。
                if (data.ReferenceSysNo < 0)
                {
                    news.ReferenceSysNo = 0;
                }
                else
                {
                    news.ReferenceSysNo = data.ReferenceSysNo;
                }

                NewsInfo entity = news.ConvertVM <NewsInfoMaintainVM, NewsInfo>();
                entity.Title.Content   = news.Title;
                entity.Content.Content = news.Content;
                if (CurrentNewsFacade != null)
                {
                    CurrentNewsFacade.Update(entity, callback);
                }
            }
        }
 public UCAddNewsAndBulletinNew(IWindow _Window)
 {
     InitializeComponent();
     entity           = new NewsInfo();
     viewModel        = new NewsInfoMaintainVM();
     this.DataContext = viewModel;
     facade           = new NewsFacade(CPApplication.Current.CurrentPage);
     this.ucPosition.PageTypeSelectionChanged += new EventHandler <PageTypeSelectionChangedEventArgs>(ucPosition_PageTypeSelectionChanged);
     this.ucPosition.SetDefaultCategoryClick  += new EventHandler <RoutedEventArgs>(ucPosition_SetDefaultCategoryClick);
     this.ucPosition.PageTypeLoadCompleted    += new EventHandler(ucPosition_PageTypeLoadCompleted);
     this.ucPosition.PageLoadCompleted        += new EventHandler(ucPosition_PageLoadCompleted);
     this.Window = _Window;
 }