コード例 #1
0
        public static bool Put(MeetupAttendee e, byte[] key)
        {
            if (key.Length == 0)
            {
                return(false);
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            byte[] _bkeyTag = Helper.Concat(key, _bclassKeyTag);

            e._state = NeoEntityModel.EntityState.PUTTED;
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, Helper.Concat(_bkeyTag, _bSTA), e._state.AsBigInteger());

            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, Helper.Concat(_bkeyTag, _bAttendeeName), e._attendeeName);         // Template: NPCLevel2CPut_cs.txt
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, Helper.Concat(_bkeyTag, _bAttendeeID), e._attendeeID);             // Template: NPCLevel2CPut_cs.txt
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, Helper.Concat(_bkeyTag, _bAttendeeUrl), e._attendeeUrl);           // Template: NPCLevel2CPut_cs.txt
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, Helper.Concat(_bkeyTag, _bAttendeePhotoUrl), e._attendeePhotoUrl); // Template: NPCLevel2CPut_cs.txt
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, Helper.Concat(_bkeyTag, _bMeetingID), e._meetingID);               // Template: NPCLevel2CPut_cs.txt
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, Helper.Concat(_bkeyTag, _bMeetingUrl), e._meetingUrl);             // Template: NPCLevel2CPut_cs.txt
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, Helper.Concat(_bkeyTag, _bAttended), e._attended);                 // Template: NPCLevel2CPut_cs.txt
            if (NeoTrace.RUNTIME)
            {
                LogExt("Put(bkey).MeetupAttendee", e);                   // Template: NPCLevel2DPut_cs.txt
            }
            return(true);
        }
        /// <summary>
        /// Collectible methods (NPC Level 4)
        /// </summary>
        /// <param name="e">e</param>
        /// <param name="vau">vau</param>
        /// <param name="index">index</param>
        /// <returns>bool</returns>
        public static bool PutElement(MeetupAttendee e, NeoVersionedAppUser vau, byte[] domain, int index)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(false);
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            NeoStorageKey nsk = NeoStorageKey.New(vau, domain, _bClassName);

            //byte[] bkey;
            e._state = NeoEntityModel.EntityState.PUTTED;
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bSTA), e._state.AsBigInteger());

            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeeName), e._attendeeName);         // Template: NPCLevel4APutElement_cs.txt

            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeeID), e._attendeeID);             // Template: NPCLevel4APutElement_cs.txt

            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeeUrl), e._attendeeUrl);           // Template: NPCLevel4APutElement_cs.txt

            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeePhotoUrl), e._attendeePhotoUrl); // Template: NPCLevel4APutElement_cs.txt

            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bMeetingID), e._meetingID);               // Template: NPCLevel4APutElement_cs.txt

            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bMeetingUrl), e._meetingUrl);             // Template: NPCLevel4APutElement_cs.txt

            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttended), e._attended);                 // Template: NPCLevel4APutElement_cs.txt

            if (NeoTrace.RUNTIME)
            {
                LogExt("PutElement(vau,i).MeetupAttendee", e);                   // Template: NPCLevel4BGetElement_cs.txt
            }
            return(true);
        }
        /// <summary>
        /// Get an element of an array of entities from Storage based on a NeoStorageKey (NPC Level 4)
        /// </summary>
        /// <param name="vau">vau</param>
        /// <param name="index">index</param>
        /// <returns>MeetupAttendee</returns>
        public static MeetupAttendee GetElement(NeoVersionedAppUser vau, byte[] domain, int index)
        {
            if (NeoVersionedAppUser.IsNull(vau))
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            NeoStorageKey nsk = NeoStorageKey.New(vau, domain, _bClassName);

            MeetupAttendee e;

            //byte[] bkey;
            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bSTA));
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(bkey).MeetupAttendee.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = MeetupAttendee.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                if (sta == NeoEntityModel.EntityState.TOMBSTONED)
                {
                    e = MeetupAttendee.Tombstone();
                }
                else // not MISSING && not TOMBSTONED
                {
                    e = new MeetupAttendee();
                    string AttendeeName = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeeName)).AsString();                                                               // Template: NPCLevel4CGetElement_cs.txt

                    string AttendeeID = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeeID)).AsString();                                                                   // Template: NPCLevel4CGetElement_cs.txt

                    string AttendeeUrl = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeeUrl)).AsString();                                                                 // Template: NPCLevel4CGetElement_cs.txt

                    string AttendeePhotoUrl = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeePhotoUrl)).AsString();                                                       // Template: NPCLevel4CGetElement_cs.txt

                    string MeetingID = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bMeetingID)).AsString();                                                                     // Template: NPCLevel4CGetElement_cs.txt

                    string MeetingUrl = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bMeetingUrl)).AsString();                                                                   // Template: NPCLevel4CGetElement_cs.txt

                    BigInteger Attended = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttended)).AsBigInteger();                                                               // Template: NPCLevel4CGetElement_cs.txt

                    e._attendeeName = AttendeeName; e._attendeeID = AttendeeID; e._attendeeUrl = AttendeeUrl; e._attendeePhotoUrl = AttendeePhotoUrl; e._meetingID = MeetingID; e._meetingUrl = MeetingUrl; e._attended = Attended; // NPCLevel4DBuryElement_cs.txt
                    e._state        = sta;
                    e._state        = NeoEntityModel.EntityState.GETTED;                                                                                                                                                            /* OVERRIDE */
                }
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(bkey).MeetupAttendee.e", e);
            }
            return(e);
        }
コード例 #4
0
 // Factory methods // Template: NPCLevel1Part2_cs.txt
 private static MeetupAttendee _Initialize(MeetupAttendee e)
 {
     e._attendeeName = ""; e._attendeeID = ""; e._attendeeUrl = ""; e._attendeePhotoUrl = ""; e._meetingID = ""; e._meetingUrl = ""; e._attended = 0;
     e._state        = NeoEntityModel.EntityState.NULL;
     if (NeoTrace.RUNTIME)
     {
         LogExt("_Initialize(e).MeetupAttendee", e);
     }
     return(e);
 }
コード例 #5
0
        public static MeetupAttendee Null()
        {
            MeetupAttendee e = new MeetupAttendee();

            _Initialize(e);
            if (NeoTrace.RUNTIME)
            {
                LogExt("Null().MeetupAttendee", e);
            }
            return(e);
        }
コード例 #6
0
        public static MeetupAttendee Tombstone()
        {
            MeetupAttendee e = new MeetupAttendee();

            e._attendeeName = ""; e._attendeeID = ""; e._attendeeUrl = ""; e._attendeePhotoUrl = ""; e._meetingID = ""; e._meetingUrl = ""; e._attended = 0;
            e._state        = NeoEntityModel.EntityState.TOMBSTONED;
            if (NeoTrace.RUNTIME)
            {
                LogExt("Tombstone().MeetupAttendee", e);
            }
            return(e);
        }
コード例 #7
0
        public static MeetupAttendee New(string AttendeeName, string AttendeeID, string AttendeeUrl, string AttendeePhotoUrl, string MeetingID, string MeetingUrl, BigInteger Attended)
        {
            MeetupAttendee e = new MeetupAttendee();

            e._attendeeName = AttendeeName; e._attendeeID = AttendeeID; e._attendeeUrl = AttendeeUrl; e._attendeePhotoUrl = AttendeePhotoUrl; e._meetingID = MeetingID; e._meetingUrl = MeetingUrl; e._attended = Attended;
            e._state        = NeoEntityModel.EntityState.INIT;
            if (NeoTrace.RUNTIME)
            {
                LogExt("New(.,.).MeetupAttendee", e);
            }
            return(e);
        }
コード例 #8
0
        public static MeetupAttendee Missing()
        {
            MeetupAttendee e = new MeetupAttendee();

            e._attendeeName = ""; e._attendeeID = ""; e._attendeeUrl = ""; e._attendeePhotoUrl = ""; e._meetingID = ""; e._meetingUrl = ""; e._attended = 0;
            e._state        = NeoEntityModel.EntityState.MISSING;
            if (NeoTrace.RUNTIME)
            {
                LogExt("Missing().MeetupAttendee", e);
            }
            return(e);
        }
コード例 #9
0
        public static MeetupAttendee Get(string key)
        {
            if (key.Length == 0)
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            string _skeyTag = key + _classKeyTag;

            MeetupAttendee e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(skey).MeetupAttendee.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = MeetupAttendee.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new MeetupAttendee();

                string     AttendeeName     = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sAttendeeName).AsString();     //NPCLevel2IGet_cs.txt
                string     AttendeeID       = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sAttendeeID).AsString();       //NPCLevel2IGet_cs.txt
                string     AttendeeUrl      = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sAttendeeUrl).AsString();      //NPCLevel2IGet_cs.txt
                string     AttendeePhotoUrl = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sAttendeePhotoUrl).AsString(); //NPCLevel2IGet_cs.txt
                string     MeetingID        = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sMeetingID).AsString();        //NPCLevel2IGet_cs.txt
                string     MeetingUrl       = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sMeetingUrl).AsString();       //NPCLevel2IGet_cs.txt
                BigInteger Attended         = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sAttended).AsBigInteger();     //NPCLevel2IGet_cs.txt
                if (NeoTrace.RUNTIME)
                {
                    TraceRuntime("Get(skey).e._attendeeName, e._attendeeID, e._attendeeUrl, e._attendeePhotoUrl, e._meetingID, e._meetingUrl, e._attended", e._attendeeName, e._attendeeID, e._attendeeUrl, e._attendeePhotoUrl, e._meetingID, e._meetingUrl, e._attended);                   // Template: NPCLevel2Part2_cs.txt
                }
                e._attendeeName = AttendeeName; e._attendeeID = AttendeeID; e._attendeeUrl = AttendeeUrl; e._attendeePhotoUrl = AttendeePhotoUrl; e._meetingID = MeetingID; e._meetingUrl = MeetingUrl; e._attended = Attended;
                e._state        = sta;
                e._state        = NeoEntityModel.EntityState.GETTED; /* OVERRIDE */
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(skey).MeetupAttendee", e);
            }
            return(e);
        }
        /// <summary>
        /// Bury an element of an array of entities in Storage based on a NeoStorageKey (NPC Level 4)
        /// </summary>
        /// <param name="vau">vau</param>
        /// <param name="index">index</param>
        /// <returns>MeetupAttendee</returns>
        public static MeetupAttendee BuryElement(NeoVersionedAppUser vau, byte[] domain, int index)
        {
            if (NeoVersionedAppUser.IsNull(vau)) // TODO - create NeoEntityModel.EntityState.BADKEY?
            {
                return(MeetupAttendee.Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            NeoStorageKey nsk = NeoStorageKey.New(vau, domain, _bClassName);

            //byte[] bkey;
            MeetupAttendee e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, NeoStorageKey.StorageKey(nsk, index, _bSTA));
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Bury(vau,index).MeetupAttendee.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = MeetupAttendee.Missing();
            }
            else // not MISSING - bury it
            {
                e = MeetupAttendee.Tombstone(); // TODO - should Bury() preserve the exist field values or re-initialize them? Preserve is cheaper but not as private
                Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bSTA), e._state.AsBigInteger());

                Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeeName), e._attendeeName);         // NPCLevel4EBuryElement_cs.txt

                Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeeID), e._attendeeID);             // NPCLevel4EBuryElement_cs.txt

                Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeeUrl), e._attendeeUrl);           // NPCLevel4EBuryElement_cs.txt

                Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttendeePhotoUrl), e._attendeePhotoUrl); // NPCLevel4EBuryElement_cs.txt

                Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bMeetingID), e._meetingID);               // NPCLevel4EBuryElement_cs.txt

                Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bMeetingUrl), e._meetingUrl);             // NPCLevel4EBuryElement_cs.txt

                Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, NeoStorageKey.StorageKey(nsk, index, _bAttended), e._attended);                 // NPCLevel4EBuryElement_cs.txt
            } // Template: NPCLevel4Part2_cs.txt
            if (NeoTrace.RUNTIME)
            {
                LogExt("Bury(vau,i).MeetupAttendee", e);
            }
            return(e);
        }
コード例 #11
0
        public static MeetupAttendee Get(byte[] key)
        {
            if (key.Length == 0)
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            byte[] _bkeyTag = Helper.Concat(key, _bclassKeyTag);

            MeetupAttendee e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bSTA));
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Get(bkey).bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = MeetupAttendee.Missing();
            }
            else // not MISSING
            {
                int ista = (int)bsta.AsBigInteger();
                NeoEntityModel.EntityState sta = (NeoEntityModel.EntityState)ista;
                e = new MeetupAttendee();

                string     AttendeeName     = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bAttendeeName)).AsString();                                                                    //NPCLevel2GGet_cs.txt
                string     AttendeeID       = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bAttendeeID)).AsString();                                                                      //NPCLevel2GGet_cs.txt
                string     AttendeeUrl      = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bAttendeeUrl)).AsString();                                                                     //NPCLevel2GGet_cs.txt
                string     AttendeePhotoUrl = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bAttendeePhotoUrl)).AsString();                                                                //NPCLevel2GGet_cs.txt
                string     MeetingID        = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bMeetingID)).AsString();                                                                       //NPCLevel2GGet_cs.txt
                string     MeetingUrl       = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bMeetingUrl)).AsString();                                                                      //NPCLevel2GGet_cs.txt
                BigInteger Attended         = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, Helper.Concat(_bkeyTag, _bAttended)).AsBigInteger();                                                                    //NPCLevel2GGet_cs.txt
                e._attendeeName = AttendeeName; e._attendeeID = AttendeeID; e._attendeeUrl = AttendeeUrl; e._attendeePhotoUrl = AttendeePhotoUrl; e._meetingID = MeetingID; e._meetingUrl = MeetingUrl; e._attended = Attended; // Template: NPCLevel2HGet_cs.txt
                e._state        = sta;
                e._state        = NeoEntityModel.EntityState.GETTED;                                                                                                                                                            /* OVERRIDE */
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Get(bkey).MeetupAttendee", e);
            }
            return(e);
        }
コード例 #12
0
        public static bool Put(MeetupAttendee e, string key)
        {
            if (key.Length == 0)
            {
                return(false);
            }
            if (NeoTrace.RUNTIME)
            {
                LogExt("Put(skey).MeetupAttendee", e);
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            string _skeyTag = key + _classKeyTag;

            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Put(skey)._skeyTag", _skeyTag);
            }

            e._state = NeoEntityModel.EntityState.PUTTED;
            BigInteger bis = e._state.AsBigInteger();

            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Put(skey).bis", bis);
            }
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sSTA, bis);
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sAttendeeName, e._attendeeName);         // Template: NPCLevel2EPut_cs.txt
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sAttendeeID, e._attendeeID);             // Template: NPCLevel2EPut_cs.txt
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sAttendeeUrl, e._attendeeUrl);           // Template: NPCLevel2EPut_cs.txt
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sAttendeePhotoUrl, e._attendeePhotoUrl); // Template: NPCLevel2EPut_cs.txt
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sMeetingID, e._meetingID);               // Template: NPCLevel2EPut_cs.txt
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sMeetingUrl, e._meetingUrl);             // Template: NPCLevel2EPut_cs.txt
            Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sAttended, e._attended);                 // Template: NPCLevel2EPut_cs.txt
            if (NeoTrace.RUNTIME)
            {
                LogExt("Put(skey).MeetupAttendee", e);                   // Template: NPCLevel2FGet_cs.txt
            }
            return(true);
        }
コード例 #13
0
        public static MeetupAttendee Bury(string key)
        {
            if (key.Length == 0)
            {
                return(Null());
            }

            Neo.SmartContract.Framework.Services.Neo.StorageContext ctx = Neo.SmartContract.Framework.Services.Neo.Storage.CurrentContext;
            string _skeyTag = key + _classKeyTag;

            MeetupAttendee e;

            byte[] bsta = Neo.SmartContract.Framework.Services.Neo.Storage.Get(ctx, _skeyTag + _sSTA);
            if (NeoTrace.RUNTIME)
            {
                TraceRuntime("Bury(skey).MeetupAttendee.bsta", bsta.Length, bsta);
            }
            if (bsta.Length == 0)
            {
                e = MeetupAttendee.Missing();
            }
            else // not MISSING - bury it
            {
                e = MeetupAttendee.Tombstone(); // but don't overwrite existing field values - just tombstone it
                Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sSTA, e._state.AsBigInteger());

                //Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sAttendeeName, e._attendeeName); // Template: NPCLevel3CBury_cs.txt
                //Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sAttendeeID, e._attendeeID); // Template: NPCLevel3CBury_cs.txt
                //Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sAttendeeUrl, e._attendeeUrl); // Template: NPCLevel3CBury_cs.txt
                //Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sAttendeePhotoUrl, e._attendeePhotoUrl); // Template: NPCLevel3CBury_cs.txt
                //Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sMeetingID, e._meetingID); // Template: NPCLevel3CBury_cs.txt
                //Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sMeetingUrl, e._meetingUrl); // Template: NPCLevel3CBury_cs.txt
                //Neo.SmartContract.Framework.Services.Neo.Storage.Put(ctx, _skeyTag + _sAttended, e._attended); // Template: NPCLevel3CBury_cs.txt
            } // Template: NPCLevel3Part2_cs.txt
            if (NeoTrace.RUNTIME)
            {
                LogExt("Bury(skey).MeetupAttendee", e);
            }
            return(e); // return Entity e to signal if key is Missing or bad key
        }
コード例 #14
0
        public static MeetupAttendee Main()
        {
            // NEO Blockchain Toronto Meetup Attendee Test Data:
            //
            // "Michael H.",
            // "2169884", "https://www.meetup.com/NEO-Blockchain-Toronto/members/2169884",
            // "https://secure.meetupstatic.com/photos/member/1/4/0/9/member_266165129.jpeg",
            // "phzmjpyxgbpb", "https://www.meetup.com/NEO-Blockchain-Toronto/events/phzmjpyxgbpb",
            // 0

            MeetupAttendee e1 = MeetupAttendee.New();

            MeetupAttendee.Set(e1, "Michael H.",
                               "2169884", "https://www.meetup.com/NEO-Blockchain-Toronto/members/2169884",
                               "https://secure.meetupstatic.com/photos/member/1/4/0/9/member_266165129.jpeg",
                               "phzmjpyxgbpb", "https://www.meetup.com/NEO-Blockchain-Toronto/events/phzmjpyxgbpb",
                               0
                               );

            MeetupAttendee.Log("e1", e1);

            MeetupAttendee.Put(e1, "phzmjpyxgbpb" + "/" + "2169884");

            MeetupAttendee e2 = MeetupAttendee.Get("phzmjpyxgbpb" + "/" + "2169884xx");

            MeetupAttendee.Log("e2", e2);

            if (MeetupAttendee.IsMissing(e2))
            {
                NeoTrace.Trace("e2 was Missing from Storage");
            }
            else
            {
                NeoTrace.Trace("e2 was not Missing from Storage");
            }

            return(e2);
        }
コード例 #15
0
 public static string GetAttendeePhotoUrl(MeetupAttendee e)
 {
     return(e._attendeePhotoUrl);
 }
コード例 #16
0
 // Persistable methods
 public static bool IsMissing(MeetupAttendee e)
 {
     return(e._state == NeoEntityModel.EntityState.MISSING);
 }
コード例 #17
0
 // Deletable methods
 public static bool IsBuried(MeetupAttendee e)
 {
     return(e._state == NeoEntityModel.EntityState.TOMBSTONED);
 }
コード例 #18
0
 // EntityState wrapper methods
 public static bool IsNull(MeetupAttendee e)
 {
     return(e._state == NeoEntityModel.EntityState.NULL);
 }
コード例 #19
0
 public static BigInteger GetAttended(MeetupAttendee e)
 {
     return(e._attended);
 }
コード例 #20
0
 public static void Set(MeetupAttendee e, string AttendeeName, string AttendeeID, string AttendeeUrl, string AttendeePhotoUrl, string MeetingID, string MeetingUrl, BigInteger Attended) // Template: NPCLevel1Set_cs.txt
 {
     e._attendeeName = AttendeeName; e._attendeeID = AttendeeID; e._attendeeUrl = AttendeeUrl; e._attendeePhotoUrl = AttendeePhotoUrl; e._meetingID = MeetingID; e._meetingUrl = MeetingUrl; e._attended = Attended;  e._state = NeoEntityModel.EntityState.SET;
 }
コード例 #21
0
 public static string GetMeetingUrl(MeetupAttendee e)
 {
     return(e._meetingUrl);
 }
コード例 #22
0
 public static void SetAttended(MeetupAttendee e, BigInteger value) // Template: NPCLevel1SetXGetX_cs.txt
 {
     e._attended = value; e._state = NeoEntityModel.EntityState.SET;
 }
コード例 #23
0
 public static void SetMeetingUrl(MeetupAttendee e, string value) // Template: NPCLevel1SetXGetX_cs.txt
 {
     e._meetingUrl = value; e._state = NeoEntityModel.EntityState.SET;
 }
コード例 #24
0
 public static string GetMeetingID(MeetupAttendee e)
 {
     return(e._meetingID);
 }
コード例 #25
0
 public static void LogExt(string label, MeetupAttendee e)
 {
     TraceRuntime(label, e._attendeeName, e._attendeeID, e._attendeeUrl, e._attendeePhotoUrl, e._meetingID, e._meetingUrl, e._attended, e._state);
 }
コード例 #26
0
 public static string GetAttendeeID(MeetupAttendee e)
 {
     return(e._attendeeID);
 }
コード例 #27
0
 public static string GetAttendeeName(MeetupAttendee e)
 {
     return(e._attendeeName);
 }