Exemplo n.º 1
0
 public bool AddNewCard(Models.CardModels.BotUser botUser, byte[] buffer, string cardName, bool IsShared)
 {
     try
     {
         BotCards.Add(new Models.CardModels.BotCard {
             BotUserID = botUser.BotUserID, IsShare = IsShared, Name = cardName, Photo = buffer
         });
         this.SaveChanges();
         return(true);
     }
     catch (Exception exc)
     {
         Logging.Logger.Error(exc);
         return(false);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Добавление пользователя
        /// </summary>
        /// <param name="recipientID"></param>
        /// <param name="isJoinGroup"></param>
        /// <returns></returns>
        public CardBotContext AddBotUser(string recipientID)
        {
            try
            {
                var btusr = new Models.CardModels.BotUser();

                btusr.BotUserVKID      = recipientID;
                btusr.Locale           = "ru_RU";
                btusr.LastActivityDate = DateTime.Now;
                btusr.NowIs            = Helpers.CardBotWhatIsHappeningNow.Start;

                BotUser.Add(btusr);
                SaveChanges();
                return(this);
            }
            catch (Exception exc)
            {
                Logging.Logger.Error(exc);
                return(null);
            }
        }