upd Authentification

This commit is contained in:
Daria
2021-10-20 06:09:18 +03:00
parent eab3081ec2
commit 72069508d2
24 changed files with 457 additions and 191 deletions

View File

@@ -34,44 +34,11 @@ namespace SvetoforVKBot.Models.Commands.Registration
{
var user = db.Users.Single(usr => usr.chatId == chatId);
List<MediaAttachment> listDoc = new List<MediaAttachment>()
user.tag = "Подписчик - Регистрация - Авторизация";
db.SaveChanges();
if (user.isAuthorized == 0)
{
new Document() { Id = 602601883, OwnerId = 59111081 } //59111081_600676073
};
if (user.agree == 0)
{
switch (user.child)
{
case 0:
@params.Message = "Вам уже исполнилось 18 лет? Исходя из возраста, мы сформируем для Вас подходящий документ " +
"согласия на обработку персональных данных.\n\n" +
"Нажмите кнопку на специальной клавиатуре👇";
keyboardBuilder
.AddButton("Да", "selectChildAge-2", KeyboardButtonColor.Positive)
.AddButton("Нет", "selectChildAge-1", KeyboardButtonColor.Negative)
.AddLine()
.AddButton("Назад", "startPL", KeyboardButtonColor.Default);
@params.Keyboard = keyboardBuilder.Build();
@params.UserId = chatId;
@params.RandomId = GetRandomId();
client.Messages.SendAsync(@params);
return;
default:
SelectAgreementCommand selectAgreement = new SelectAgreementCommand();
selectAgreement.ExecutePL(update, client, db);
return;
}
}
else
{
user.tag = "Подписчик - Регистрация - Пол";
db.SaveChanges();
keyboardBuilder
.AddButton("М", "selectGender-1", KeyboardButtonColor.Primary)
.AddButton("Ж", "selectGender-2", KeyboardButtonColor.Primary)
@@ -81,10 +48,12 @@ namespace SvetoforVKBot.Models.Commands.Registration
@params.Keyboard = keyboardBuilder.Build();
@params.UserId = chatId;
@params.Message = //1 шаг из 4.
"Выберите на клавиатуре внизу или напишите пол в формате \"М\" или \"Ж\"";
"Для продолжения необходимо авторизоваться. Введите Ваш логин, ипользуемый на портале ВятГУ.\n" +
"Например, stud0000";
@params.RandomId = GetRandomId();
client.Messages.SendAsync(@params);
}
}
catch (Exception ee)
{