コード例 #1
0
        public static int Insert(Notification notification)
        {
            using (ObjectConnection objectConnection = new ObjectConnection())
            {
                using (InsertNotificationCommand objectCommand = new InsertNotificationCommand(objectConnection))
                {
                    objectCommand.NotificationId      = notification.NotificationId;
                    objectCommand.NotificationMessage = notification.NotificationMessage;
                    objectCommand.OrderId             = notification.OrderId;
                    objectCommand.NotificationTypeId  = notification.NotificationTypeId;
                    objectCommand.IsRead = notification.IsRead;

                    objectConnection.Open();
                    objectCommand.ExecuteNonQuery();

                    return(objectCommand.ReturnValue);
                }
            }
        }
コード例 #2
0
        public static int Insert(Guid?notificationId, string notificationMessage, Guid orderId, int notificationTypeId, bool isRead)
        {
            using (ObjectConnection objectConnection = new ObjectConnection())
            {
                using (InsertNotificationCommand objectCommand = new InsertNotificationCommand(objectConnection))
                {
                    objectCommand.NotificationId      = notificationId ?? Guid.NewGuid();
                    objectCommand.NotificationMessage = notificationMessage;
                    objectCommand.OrderId             = orderId;
                    objectCommand.NotificationTypeId  = notificationTypeId;
                    objectCommand.IsRead = isRead;

                    objectConnection.Open();
                    objectCommand.ExecuteNonQuery();

                    return(objectCommand.ReturnValue);
                }
            }
        }