Exemplo n.º 1
0
        /// <summary>
        /// 添加单条管理员处消息
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public bool AddData(InvalidAssigneesNotification data)
        {
            using (TransactionScope scope = TransactionScopeFactory.Create())
            {
                using (DbContext context = DbContext.GetContext(this.GetConnectionName()))
                {
                    Database  db      = DatabaseFactory.Create(context);
                    DbCommand command = db.GetSqlStringCommand(InsertSql);

                    this.SetCommandParames(db, command, data);

                    int count = command.ExecuteNonQuery();

                    scope.Complete();

                    return(count == 1 ? true : false);
                }
            }
        }
Exemplo n.º 2
0
 private void SetCommandParames(Database db, DbCommand command, InvalidAssigneesNotification data)
 {
     db.AddInParameter(command, "NOTIFICATION_ID", DbType.String, string.IsNullOrEmpty(data.NotificationID) ? UuidHelper.NewUuidString() : data.NotificationID);
     db.AddInParameter(command, "Description", DbType.String, data.Description);
     db.AddInParameter(command, "CreateTime", DbType.String, data.CreateTime);
 }