Пример #1
0
 internal static TradeNews ToTradeNews(NewsInfo tInfo)
 {
     TradeNews news = new TradeNews();
     news.ID = tInfo.ID;
     news.NewsContent = tInfo.NewsContent;
     news.NewsTitle = tInfo.NewsTitle;
     news.NType = (NewsType)tInfo.NType;
     news.PubPerson = tInfo.PubPerson;
     news.PubTime = tInfo.PubTime;
     news.Status = (NewsStatus)tInfo.Status;
     return news;
 }
 /// <summary>
 /// 编辑新闻公告
 /// </summary>
 /// <param name="newsInfo">新闻记录</param>
 /// <param name="loginId">登录用户标识</param>
 /// <returns></returns>
 public ErrType ModifyTradeNews(NewsInfo newsInfo, String loginId)
 {
     try
     {
         TradeNews news = MyConverter.ToTradeNews(newsInfo);
         ResultDesc result = ManagerService.ModifyTradeNews(news, loginId);
         if (!result.Result)
             return new ErrType(ERR.SERVICE, result.Desc);
         return GeneralErr.Success;
     }
     catch (TimeoutException te)
     {
         FileLog.WriteLog("", Assembly.GetExecutingAssembly().GetName().Name, this.GetType().Name, new StackTrace().GetFrame(0).GetMethod().Name, te.Message);
         return new ErrType(ERR.EXEPTION, ErrorText.TimeoutException);
     }
     catch (Exception ex)
     {
         FileLog.WriteLog("", Assembly.GetExecutingAssembly().GetName().Name, this.GetType().Name,
       new StackTrace().GetFrame(0).GetMethod().Name, ex.Message);
         return new ErrType(ERR.EXEPTION, ErrorText.OperationError);
     }
 }
Пример #3
0
 internal static NewsInfo ToNewsInfo(TradeNews news)
 {
     NewsInfo tInfo = new NewsInfo();
     tInfo.ID = news.ID;
     tInfo.NewsContent = news.NewsContent;
     tInfo.NewsTitle = news.NewsTitle;
     //Todo:查看枚举是否可以如此转换
     tInfo.NType = (NewsTypeEnum)news.NType;
     tInfo.PubPerson = news.PubPerson;
     tInfo.PubTime = news.PubTime;
     tInfo.Status = (NewsStatusEnum)news.Status;
     return tInfo;
 }