コード例 #1
0
ファイル: Person.cs プロジェクト: SanyaRamzik/WebSocial
        public void GetInfoPerson(string NickName)
        {
            MySqlConnection PersonInfo = new MySqlConnection(SQL_Explorer.connectionString());

            PersonInfo.Open();
            string          Select  = "SELECT `id`, `NickName`, `Password`, `Name`, `Surname`, `GroupID` FROM `Users` WHERE Nickname LIKE '" + NickName + "'";
            MySqlCommand    command = new MySqlCommand(Select, PersonInfo);
            MySqlDataReader reader  = command.ExecuteReader();

            if (reader.HasRows == true)
            {
                while (reader.Read())
                {
                    if (reader != null)
                    {
                        ID = Convert.ToInt32(reader[0].ToString());
                        //  NickName = reader[1].ToString();
                        Password = reader[2].ToString();
                        Name     = reader[3].ToString();
                        Surname  = reader[4].ToString();
                        GroupID  = Convert.ToInt32(reader[5].ToString());
                    }
                }
                reader.Close();
                PersonInfo.Close();
            }
        }
コード例 #2
0
 public void activateREG(string NickName, string Email, string Name, string Surname, string Pass, string RePass)
 {
     if (!valide_key)
     {
         lblERROR.Content = REGErrorText(NickName, Email, Name, Surname, Pass, RePass);
         if (!error_key)
         {
             SE = new SQL_Explorer(lblERROR, SQL); SE.ValidOpeningREG(NickName, Email, Name, Surname, Pass); if (SE.ActivateSession == true)
             {
                 SE.Session(); if (SE.ActivateSession)
                 {
                     valide_key = true; MessageBox.Show(SE.User.Name.ToString());                                                                                                                                                                                 /*Site.Send(PersonInfo);Site.generateKeyLing()*/
                 }
             }
         }
     }
     else
     {
         lblERROR.Content = " Session was initialized! ";
     }
 }
コード例 #3
0
 public void activateLOG(string NickName, string Pass)
 {
     if (!valide_key)
     {
         lblERROR.Content = LOGErrorText(NickName, Pass);
         if (!error_key)
         {
             SE = new SQL_Explorer(lblERROR, SQL); SE.ValidOpeningLOG(NickName, Pass); if (SE.ActivateSession == true)
             {
                 SE.Session(); if (SE.ActivateSession)
                 {
                     valide_key = true; MessageBox.Show(SE.User.Name.ToString());
                 }
             }
         }
     }
     else
     {
         lblERROR.Content = " Session was initialized! ";
     }
 }