예제 #1
0
        /// <summary>
        /// 信息记录保存
        /// </summary>
        /// yand    16.06.02
        /// <param name="infoType">信息记录实体</param>
        /// <param name="recordID">RecordID</param>
        /// <param name="messageInfo">报文实体</param>
        /// <param name="postmessage">前端参数</param>
        /// <param name="message"></param>
        /// <returns></returns>
        public bool Compare(InfoTypeInfo infoType, int recordID, int reportID, MessageInfo messageInfo, PostMessage postmessage, ref string message)
        {
            bool result = true;
            InformationRecordInfo informationRecord = new InformationRecordInfo();

            informationRecord.InfoTypeID = postmessage.InfoTypeId;
            informationRecord.ReportID   = postmessage.ReportId;
            informationRecord.Context    = postmessage.Value;

            using (TransactionScope scope = new TransactionScope())
            {
                informationRecord.Context = JsonConvert.SerializeObject(DataAndRuleCompare1(infoType, messageInfo, ref message));

                if (recordID != 0)
                {
                    informationRecord.RecordID = recordID;
                    result &= DataAndRuleCompare(infoType, messageInfo, recordID, reportID, ref message) && new InformationRecord().Modify(informationRecord);
                }
                else
                {
                    result &= DataAndRuleCompare(infoType, messageInfo, recordID, reportID, ref message) && new InformationRecord().Add(informationRecord);
                    if (result)
                    {
                        DataTable dt = new DAL.BankCredit.ReportFilesMapper().FindData(postmessage.ReportId);
                        if (dt.Rows.Count > 0)
                        {
                            ReportFilesInfo reportFile = new ReportFilesInfo();

                            // 已编辑
                            reportFile.ReportState = 2;
                            reportFile.FileID      = Convert.ToInt32(dt.Rows[0]["FileID"].ToString());
                            result = new DAL.BankCredit.ReportFilesMapper().UpdateState(reportFile) > 0;
                        }
                    }
                }

                if (result)
                {
                    scope.Complete();
                }
            }

            return(result);
        }
예제 #2
0
 /// <summary>
 /// 修改
 /// </summary>
 /// cais    16.05.25
 /// <param name="value"></param>
 /// <returns></returns>
 public bool Modify(InformationRecordInfo value)
 {
     return(inforRecordMapper.Update(value) > 0);
 }
예제 #3
0
        /// <summary>
        /// 增加一条信息记录
        /// </summary>
        /// cais    16.05.25
        /// <param name="values"></param>
        /// <returns></returns>
        public bool Add(InformationRecordInfo values)
        {
            inforRecordMapper.Insert(values);

            return(values.RecordID > 0);
        }