upd Authentification
This commit is contained in:
@@ -38,12 +38,16 @@ namespace SvetoforVKBot.Models.Commands.ExpertLK
|
||||
|
||||
var user = db.Users.Single(usr => usr.id == userId);
|
||||
int uChatId = Convert.ToInt32(user.chatId);
|
||||
string fio = user.fio;
|
||||
|
||||
var idsVk = new long[] { uChatId };
|
||||
var userVk = client.Users.Get(idsVk);
|
||||
|
||||
//string fio = user.fio;
|
||||
var birthday = user.birthday;
|
||||
var jsPhones = JsonConvert.DeserializeObject<List<string>>(user.phone);
|
||||
|
||||
@params.Message = "Участник:\n\n" +
|
||||
fio + "\n" +
|
||||
userVk[0].FirstName + " " + userVk[0].LastName + "\n" +
|
||||
"Дата рождения: " + birthday.ToShortDateString() + "\n" +
|
||||
"Телефон: " + jsPhones[0];
|
||||
|
||||
|
||||
@@ -37,27 +37,19 @@ namespace SvetoforVKBot.Models.Commands.ExpertLK
|
||||
string[] payload = update.@object.message.payload.Split('-');
|
||||
int userId = Convert.ToInt32(regex.Replace(payload[1], ""));
|
||||
//@params.Message = "Выберите участника.\n";
|
||||
|
||||
|
||||
|
||||
var user = db.Users.Single(usr => usr.id == userId);
|
||||
int uChatId = user.chatId;
|
||||
string fio = user.fio;
|
||||
|
||||
var idsVk = new long[] { uChatId };
|
||||
var userVk = client.Users.Get(idsVk);
|
||||
|
||||
user.personal = 1;
|
||||
db.Entry(db.PersonalConsultations.Where(el => el.chatId == uChatId)).Property("state").CurrentValue = 2;
|
||||
db.SaveChanges();
|
||||
|
||||
//SqlCommand updTag = new SqlCommand("UPDATE Users SET personal = @personal WHERE chatId = @chatId;", Con);
|
||||
//updTag.Parameters.AddWithValue("@chatId", uChatId);
|
||||
//updTag.Parameters.AddWithValue("@personal", 1);
|
||||
//updTag.ExecuteNonQuery();
|
||||
|
||||
//SqlCommand updState = new SqlCommand("UPDATE PersonalConsultation SET state = @state WHERE chatId = @chatId;", Con);
|
||||
//updState.Parameters.AddWithValue("@chatId", uChatId);
|
||||
//updState.Parameters.AddWithValue("@state", 2);
|
||||
//updState.ExecuteNonQuery();
|
||||
|
||||
@params.Message = "✅Персональный режим для участника " + fio + " включен";
|
||||
@params.Message = "✅Персональный режим для участника " + userVk[0].FirstName + " " + userVk[0].LastName + " включен";
|
||||
|
||||
keyboardBuilder
|
||||
//.AddButton("Вкл. персональный режим", "selectPersonalPlan-", KeyboardButtonColor.Positive)
|
||||
|
||||
Reference in New Issue
Block a user