コード例 #1
0
        public CommunicationObject AddNotify(string xml)
        {
            try
            {
                CommunicationObject notifyInfo   = XmlAnalyzer.AnalyseXmlToCommunicationObject <CommunicationObject>(xml);
                NoticeEntity        noticeEntity = new NoticeEntity();
                noticeEntity.NoticeId      = notifyInfo.Id;
                noticeEntity.NoticeVersion = notifyInfo.Version;
                noticeEntity.MessengerId   = notifyInfo.MessengerId;
                noticeEntity.Timestamp     = notifyInfo.Timestamp;
                noticeEntity.TranType      = (int)notifyInfo.TransactionType;
                noticeEntity.Digest        = notifyInfo.Digest;
                noticeEntity.ResponseText  = xml;
                noticeEntity.NotifyTime    = DateTime.Now;
                noticeEntity.XmlHeader     = notifyInfo.XmlHeader;
                NoticeManager noticeManager = new NoticeManager(DbAccess);
                noticeManager.AddNotice(noticeEntity);

                return(notifyInfo);
            }
            catch (Exception ex)
            {
                string errMsg = "添加通知XML到数据库失败!" + xml;
                throw HandleException(LogCategory.Notice, errMsg, ex);
            }
        }
コード例 #2
0
 public void AddNotice(NoticeInfo noticeInfo)
 {
     try
     {
         NoticeEntity entity = new NoticeEntity();
         entity.Id          = Guid.NewGuid().ToString("N");
         entity.Name        = noticeInfo.Name;
         entity.Title       = noticeInfo.Title;
         entity.IsHasDetail = noticeInfo.IsHasDetail;
         entity.Message     = noticeInfo.Message;
         entity.IsForeRed   = noticeInfo.IsForeRed;
         entity.IsForeBold  = noticeInfo.IsForeBold;
         entity.StartTime   = noticeInfo.StartTime;
         entity.EndTime     = noticeInfo.EndTime;
         entity.IsEnd       = noticeInfo.IsEnd;
         NoticeManager manager = new NoticeManager(DbAccess);
         manager.AddNotice(entity);
         noticeInfo.Id = entity.Id;
     }
     catch (Exception ex)
     {
         throw HandleException("Notice", "Add", ex);
     }
 }
コード例 #3
0
        public CommunicationObject AddNotify(string xml)
        {
            try
            {
                CommunicationObject notifyInfo = XmlAnalyzer.AnalyseXmlToCommunicationObject<CommunicationObject>(xml);
                NoticeEntity noticeEntity = new NoticeEntity();
                noticeEntity.NoticeId = notifyInfo.Id;
                noticeEntity.NoticeVersion = notifyInfo.Version;
                noticeEntity.MessengerId = notifyInfo.MessengerId;
                noticeEntity.Timestamp = notifyInfo.Timestamp;
                noticeEntity.TranType = (int)notifyInfo.TransactionType;
                noticeEntity.Digest = notifyInfo.Digest;
                noticeEntity.ResponseText = xml;
                noticeEntity.NotifyTime = DateTime.Now;
                noticeEntity.XmlHeader = notifyInfo.XmlHeader;
                NoticeManager noticeManager = new NoticeManager(DbAccess);
                noticeManager.AddNotice(noticeEntity);

                return notifyInfo;
            }
            catch (Exception ex)
            {
                string errMsg = "添加通知XML到数据库失败!" + xml;
                throw HandleException(LogCategory.Notice, errMsg, ex);
            }
        }
コード例 #4
0
 public Result AddNotice(AddNotice addNotice, string account)
 {
     return(_noticeManager.AddNotice(addNotice, account));
 }