From 7ea5b180cbbff754f2bf1f67c8774dab357c6c73 Mon Sep 17 00:00:00 2001 From: jetsparrow Date: Wed, 19 Dec 2018 15:37:14 +0300 Subject: [PATCH] create Services folder and move Db.cs into it --- JetKarmaBot/{ => Services}/Db.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename JetKarmaBot/{ => Services}/Db.cs (96%) diff --git a/JetKarmaBot/Db.cs b/JetKarmaBot/Services/Db.cs similarity index 96% rename from JetKarmaBot/Db.cs rename to JetKarmaBot/Services/Db.cs index a32d44a..0868bd3 100644 --- a/JetKarmaBot/Db.cs +++ b/JetKarmaBot/Services/Db.cs @@ -57,7 +57,7 @@ namespace JetKarmaBot public byte GetAwardTypeId(string name) => AwardTypesByCommandName.GetOrDefault(name)?.AwardTypeId ?? DefaultAwardTypeId; - public bool AddAward(byte awardTypeId, long fromId, long toId, long chatId) + public bool AddAward(byte awardTypeId, long fromId, long toId, long chatId, int amount) { AddChat(new Chat() { ChatId = chatId }); AddUser(new User() { UserId = fromId}); @@ -67,8 +67,8 @@ namespace JetKarmaBot @"INSERT INTO award (chatid, fromid, toid, awardtypeid, amount) VALUES - (@chatId, @fromId, @toId, @awardTypeId, 1)", - new { awardTypeId, fromId, toId, chatId }); + (@chatId, @fromId, @toId, @awardTypeId, @amount)", + new { awardTypeId, fromId, toId, chatId, amount }); return affected == 1; }