Example #1
0
		/// <summary>Actualiza a data do ltimo login</summary>
		public override void updateLastLogin( string userMail )
		{
			MySqlUtility.executeNonQuery(
				string.Format("update Users set user_lastLogin = NOW() where user_mail = '{0}'",
							  	userMail
							  )
			);
		}
Example #2
0
		/// <summary>Modifica a password de um utilizador</summary>
		public override bool resetPassword( string userMail, string newPassword )
		{
			if( !checkUser(userMail) ) {
				return false;
			}
			
			MySqlUtility.executeNonQuery(
				string.Format("update Users set user_pass = '******' where user_mail = '{1}'",
							  newPassword, userMail
						)
			);
			
			return true;
		}
Example #3
0
        /// <summary>Regista um scan</summary>
        public override void Register(Scan scan)
        {
            string script = string.Format("INSERT INTO Scans VALUES('', {0}, '{1}', {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14} )",
                                          scan.SourcePlanetId, scan.Target.ToString(), scan.ScanLevel,
                                          scan.Intercepted?1:0, scan.Success?1:0,
                                          scan.Turn,
                                          scan.Culture, scan.HasCommsSatellite, scan.HasGate,
                                          scan.HasStarGate, scan.HasStarPort, scan.InBattle, scan.NumberOfFleets,
                                          scan.TargetPlanetOwner,
                                          scan.TotalShips
                                          );

            Chronos.Utils.Log.log(script);
            MySqlUtility.executeNonQuery(script);
        }
Example #4
0
        /// <summary>Regista uma nova notícia</summary>
        protected override void Register(Entry entry)
        {
            /*CREATE TABLE News (
             *      Id int NOT NULL auto_increment,
             * Title varchar(100) NOT NULL,
             * Content mediumtext NOT NULL,
             * Date datetime NOT NULL default '0000-00-00 00:00:00',
             * PRIMARY KEY  (Id)
             * ) TYPE=MyISAM;
             */
            string query = string.Format("INSERT INTO News(Title, Content, Date) VALUES('{0}', '{1}', NOW())",
                                         entry.Title,
                                         entry.Content
                                         );

            MySqlUtility.executeNonQuery(query);
        }
 /// <summary>
 /// remove todas as excepes
 /// </summary>
 public override void removeAll()
 {
     MySqlUtility.executeNonQuery("DELETE FROM `Exceptions`");
 }
Example #6
0
		/// <summary>Obtm a quantidade de utilizadores registados</summary>
		public override int getUserCount()
		{
			return MySqlUtility.executeNonQuery("select count(*) from Users");
		}