upd Authentification
This commit is contained in:
@@ -36,6 +36,9 @@ namespace SvetoforVKBot.Models.Commands.LK.Consultation
|
||||
List<int> ids = new List<int>();
|
||||
try
|
||||
{
|
||||
var idsVk = new long[] { chatId };
|
||||
var userVk = client.Users.Get(idsVk);
|
||||
|
||||
if (db.PersonalConsultations.Where(c => c.chatId == chatId).Count() > 0)
|
||||
{
|
||||
@params.Message = "Ваша заявка уже на рассмотрении. Чтобы вернуться назад, нажмите кнопку \"Личный кабинет\".";
|
||||
@@ -69,7 +72,7 @@ namespace SvetoforVKBot.Models.Commands.LK.Consultation
|
||||
|
||||
@params.Message = "📌Ваша заявка:\n\n";
|
||||
|
||||
msg = "ФИО: " + user.fio +
|
||||
msg = "Имя: " + userVk[0].FirstName + " " + userVk[0].LastName + "\n" +
|
||||
"\n" +
|
||||
"Телефон: " + jsPhones[0] +
|
||||
"\n" +
|
||||
@@ -94,7 +97,7 @@ namespace SvetoforVKBot.Models.Commands.LK.Consultation
|
||||
Thread.Sleep(1000);
|
||||
|
||||
@params2.Message = "✅Новая заявка на консультацию:\n\n" +
|
||||
"ФИО: " + user.fio +
|
||||
"Имя: " + userVk[0].FirstName + " " + userVk[0].LastName + "\n" +
|
||||
"\n" +
|
||||
"Телефон: " + jsPhones[0] +
|
||||
"\n" +
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace SvetoforVKBot.Models.Commands.LK.EditData
|
||||
var ids = new long[] { chatId };
|
||||
|
||||
var user = db.Users.Single(usr => usr.chatId == chatId);
|
||||
user.fio = update.@object.message.text.Trim();
|
||||
//user.fio = update.@object.message.text.Trim();
|
||||
user.tag = "Личный кабинет - Данные";
|
||||
db.SaveChanges();
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace SvetoforVKBot.Models.Commands.LK
|
||||
int height = user.height;
|
||||
int gender = user.gender;
|
||||
int notifyCount = user.notifyCount;
|
||||
string fio = user.fio;
|
||||
//string fio = user.fio;
|
||||
var jsPhones = JsonConvert.DeserializeObject<List<string>>(user.phone);
|
||||
var birthday = user.birthday;
|
||||
int track = user.track;
|
||||
@@ -74,7 +74,7 @@ namespace SvetoforVKBot.Models.Commands.LK
|
||||
.AddButton("📐Рост: " + height, "selectEditData-2", KeyboardButtonColor.Primary)
|
||||
.AddLine()
|
||||
.AddButton("🔔Уведомления", "selectEditData-3", KeyboardButtonColor.Primary)
|
||||
.AddButton("✏ФИО", "selectEditData-4", KeyboardButtonColor.Primary)
|
||||
//.AddButton("✏ФИО", "selectEditData-4", KeyboardButtonColor.Primary)
|
||||
.AddLine()
|
||||
.AddButton("📅Дата рождения", "selectEditData-5", KeyboardButtonColor.Primary)
|
||||
.AddButton("📞Телефон", "selectEditData-6", KeyboardButtonColor.Primary)
|
||||
@@ -116,8 +116,6 @@ namespace SvetoforVKBot.Models.Commands.LK
|
||||
|
||||
@params.Message = "РЕДАКТИРОВАНИЕ ДАННЫХ" +
|
||||
"\n\n" +
|
||||
"ФИО: " + fio +
|
||||
"\n" +
|
||||
"Телефон: " + jsPhones[0] +
|
||||
"\n" +
|
||||
"Дата рождения: " + birthday.ToShortDateString() +
|
||||
@@ -190,7 +188,7 @@ namespace SvetoforVKBot.Models.Commands.LK
|
||||
int height = user.height;
|
||||
int gender = user.gender;
|
||||
int notifyCount = user.notifyCount;
|
||||
string fio = user.fio;
|
||||
//string fio = user.fio;
|
||||
var jsPhones = JsonConvert.DeserializeObject<List<string>>(user.phone);
|
||||
var birthday = user.birthday;
|
||||
int track = user.track;
|
||||
@@ -251,8 +249,6 @@ namespace SvetoforVKBot.Models.Commands.LK
|
||||
|
||||
@params.Message = "РЕДАКТИРОВАНИЕ ДАННЫХ" +
|
||||
"\n\n" +
|
||||
"ФИО: " + fio +
|
||||
"\n" +
|
||||
"Телефон: " + jsPhones[0] +
|
||||
"\n" +
|
||||
"Дата рождения: " + birthday.ToShortDateString() +
|
||||
|
||||
@@ -40,8 +40,6 @@ namespace SvetoforVKBot.Models.Commands.LK
|
||||
user.colorId = 0;
|
||||
db.SaveChanges();
|
||||
|
||||
msg += user.fio + "\n\n";
|
||||
|
||||
if ((DateTime.Now.Month >= user.birthday.Month) && (DateTime.Now.Day >= user.birthday.Day))
|
||||
age = DateTime.Now.Year - user.birthday.Year;
|
||||
else
|
||||
|
||||
@@ -38,20 +38,6 @@ namespace SvetoforVKBot.Models.Commands.LK.SportsLK
|
||||
user.colorId = 0;
|
||||
db.SaveChanges();
|
||||
|
||||
//SqlCommand getUser = new SqlCommand("SELECT * FROM Users WHERE chatId = @chatId;", Con);
|
||||
//getUser.Parameters.AddWithValue("@chatId", chatId);
|
||||
//SqlDataReader rgetUser = getUser.ExecuteReader();
|
||||
//rgetUser.Read();
|
||||
//string fio = rgetUser["fio"].ToString();
|
||||
//int weight = Convert.ToInt32(rgetUser["weight"]);
|
||||
//int height = Convert.ToInt32(rgetUser["height"]);
|
||||
//int gender = Convert.ToInt32(rgetUser["gender"]);
|
||||
//var birthday = DateTime.Parse(rgetUser["birthday"].ToString());
|
||||
//int kkal = Convert.ToInt32(rgetUser["kkal"]);
|
||||
//rgetUser.Close();
|
||||
|
||||
msg += user.fio + "\n\n";
|
||||
|
||||
age = (DateTime.Today.Year - user.birthday.Year);
|
||||
|
||||
if (user.gender == 1)
|
||||
|
||||
Reference in New Issue
Block a user