public Info_about_way()
 {
     Id = 0;
     User_main = new Registration();
     Way_info = new Way();
     Companion = new Collection<Registration>();
     On_me = new Collection<int>();
 }
        public void AddRegistration(Registration obj)
        {
            using (var connection1 = new SqlConnection(ConfigurationManager.ConnectionStrings["MSSQL"].ToString()))
               {
               using (var command1 = new SqlCommand(String.Format(@"INSERT  INTO Registration
                                                   (Name_user, SurName_user, Phone_number,Email, Login,Password)
                                                    Values(@Name_user, @SurName_user, @Phone_number, @Email,@Login,@Password)
                                                   ")))
               {
                   command1.Parameters.AddWithValue("@Name_user", obj.Name_user);
                   command1.Parameters.AddWithValue("@SurName_user", obj.SurName_user);
                   command1.Parameters.AddWithValue("@Phone_number", obj.Phone_number);
                   command1.Parameters.AddWithValue("@Email", obj.Email);
                   command1.Parameters.AddWithValue("@Login", obj.Login);
                   command1.Parameters.AddWithValue("@Password", obj.Password);

                   command1.Connection = connection1;
                   connection1.Open();
                   command1.ExecuteNonQuery();

               }
               }
        }
        public Registration return_infa_user(int par)
        {
            Registration obj = null;
               using (var connection1 = new SqlConnection(ConfigurationManager.ConnectionStrings["MSSQL"].ToString()))
               {
               connection1.Open();
               using (var command1 = new SqlCommand(String.Format("SELECT * FROM Registration WHERE ID_USER_proect =" + par)))
               {
                   command1.Connection = connection1;
                   using (var reader = command1.ExecuteReader())
                   {

                       if (reader.Read())
                       {
                           obj = new Registration(Convert.ToInt32(reader["ID_USER_proect"].ToString()),
                               (reader["Name_user"].ToString()),
                               (reader["SurName_user"].ToString()),
                               (reader["Phone_number"].ToString()),
                               (reader["Email"].ToString()),
                               (reader["Login"].ToString()),
                               (reader["Password"].ToString()));
                       }
                   }
               }
               }
               return obj;
        }