Beispiel #1
0
        private bool checkUser()
        {
            List <User> users            = new List <User>();
            string      sqlInquiryString = $"SELECT * FROM users_authorization where login = '******'";

            using var connection = new MySqlConnection(createConnection.ConnectionString());
            connection.Open();

            MySqlCommand command = new MySqlCommand(sqlInquiryString, connection);

            using (MySqlDataReader reader = command.ExecuteReader())
            {
                while (reader.Read())
                {
                    users.Add(new User
                    {
                        Login    = reader["login"].ToString(),
                        Password = reader["password"].ToString()
                    });
                }
            }

            if (users.Any(u => u.Password.Equals(Password)))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        private void getInformationAboutCalls()
        {
            string sqlInquiryString = $"SELECT * FROM leads_and_calls WHERE login = '******'";

            using var connection = new MySqlConnection(createConnection.ConnectionString());
            connection.Open();

            MySqlCommand command = new MySqlCommand(sqlInquiryString, connection);

            using (MySqlDataReader reader = command.ExecuteReader())
            {
                while (reader.Read())
                {
                    Calls.Add(new AboutCall
                    {
                        ClientInformation = reader["client_phone_number"].ToString() + " " +
                                            reader["create_lead_date"].ToString() + " " + reader["lead_stats"].ToString(),
                        CallMadeDate = reader["lead_call_date"].ToString(),
                        Login        = reader["login"].ToString(),
                        CallTime     = reader["call_time"].ToString()
                    });
                }
            }
        }