Пример #1
0
        private static BulletinDescription CreateBulletinDescriptionFromRecord(IDataRecord record)
        {
            var bulletin = new BulletinDescription
            {
                bulletinID = record.GetValue <int>(0),
                groupEID   = record.GetValue <long>(1),
                title      = record.GetValue <string>(2),
                startDate  = record.GetValue <DateTime>(3),
                startedBy  = record.GetValue <int>(4)
            };

            return(bulletin);
        }
Пример #2
0
        public void SendBulletinUpdate(BulletinDescription bulletin, CorporationBulletinEvent bulletinEvent, Character issuer)
        {
            var result = new Dictionary <string, object>
            {
                { k.description, bulletin.ToDictionary() },
                { k.eventType, (int)bulletinEvent },
                { k.characterID, issuer.Id }
            };

            var corporation = Corporation.GetOrThrow(bulletin.groupEID);

            Message.Builder.SetCommand(Commands.CorporationBulletinUpdate)
            .WithData(result)
            .ToCorporation(corporation)
            .Send();
        }
Пример #3
0
        public BulletinDescription StartBulletin(long groupEID, string title, Character startedBy)
        {
            var bulletinID = Db.Query().CommandText("insert bulletins (groupEID,title,startedby) values (@groupEID,@title,@startedBy); select cast (scope_identity() as int)")
                             .SetParameter("@groupEID", groupEID)
                             .SetParameter("@title", title)
                             .SetParameter("@startedBy", startedBy.Id)
                             .ExecuteScalar <int>();

            var bd = new BulletinDescription
            {
                bulletinID = bulletinID,
                title      = title,
                groupEID   = groupEID,
                startDate  = DateTime.Now,
                startedBy  = startedBy.Id
            };

            return(bd);
        }