コード例 #1
0
        public void deleteUser(RemoteUser rUser)
        {//Remove user from the local table
            this.connect();
            SqlCeCommand cmd = this.conn.CreateCommand();

            cmd.CommandText = "delete from " + TABLE_NAME + "  where username='******' and system='" + rUser.getSystemName() + "'";
            cmd.ExecuteNonQuery();
            this.disconnect();
        }
コード例 #2
0
 public void deleteUser(RemoteUser rUser)
 {
     //Remove user from the local table
     this.connect();
     SqlCeCommand cmd = this.conn.CreateCommand();
     cmd.CommandText = "delete from " + TABLE_NAME + "  where username='******' and system='" + rUser.getSystemName() + "'";
     cmd.ExecuteNonQuery();
     this.disconnect();
 }
コード例 #3
0
 public void addUser(RemoteUser rUser)
 {
     //add new user
     this.connect();
     SqlCeCommand cmd = this.conn.CreateCommand();
     DateTime currentTime = DateTime.Now;
     cmd.CommandText = "insert into " + TABLE_NAME + "(system,username,password,modified_date,status) values('" + rUser.getSystemName() + "','" + rUser.getUsername() + "','" + rUser.getPassword() + "','" + currentTime.ToString() + "','" + rUser.getStatus() + "')";
     cmd.ExecuteNonQuery();
     this.disconnect();
 }
コード例 #4
0
        public bool exists(RemoteUser rUser)
        {
            //Check whether the entry with the specified System & Username already exists
            int count = 0;
            this.connect();
            String query = "Select count(*) from " + TABLE_NAME + " where system='" + rUser.getSystemName() + "' and username='******'" ;
            SqlCeCommand cmd = new SqlCeCommand(query, this.conn);
            count = (int)cmd.ExecuteScalar();
            this.disconnect();

            if (count > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
コード例 #5
0
        public void updatePassword(RemoteUser rUser)
        {//change user password
            this.connect();
            SqlCeCommand cmd         = this.conn.CreateCommand();
            DateTime     currentTime = DateTime.Now;

            cmd.CommandText = "update " + TABLE_NAME + " set password='******',status='',modified_date='" + currentTime.ToString() + "' where username='******' and system='" + rUser.getSystemName() + "'";
            cmd.ExecuteNonQuery();
            this.disconnect();
        }
コード例 #6
0
        public void addUser(RemoteUser rUser)
        {//add new user
            this.connect();
            SqlCeCommand cmd         = this.conn.CreateCommand();
            DateTime     currentTime = DateTime.Now;

            cmd.CommandText = "insert into " + TABLE_NAME + "(system,username,password,modified_date,status) values('" + rUser.getSystemName() + "','" + rUser.getUsername() + "','" + rUser.getPassword() + "','" + currentTime.ToString() + "','" + rUser.getStatus() + "')";
            cmd.ExecuteNonQuery();
            this.disconnect();
        }
コード例 #7
0
        public bool exists(RemoteUser rUser)
        {
            //Check whether the entry with the specified System & Username already exists
            int count = 0;

            this.connect();
            String       query = "Select count(*) from " + TABLE_NAME + " where system='" + rUser.getSystemName() + "' and username='******'";
            SqlCeCommand cmd   = new SqlCeCommand(query, this.conn);

            count = (int)cmd.ExecuteScalar();
            this.disconnect();

            if (count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #8
0
        public void updateStatus(RemoteUser rUser)
        {//Set status
            this.connect();
            SqlCeCommand cmd = this.conn.CreateCommand();

            cmd.CommandText = "update " + TABLE_NAME + " set status='" + rUser.getStatus() + "'  where username='******' and system='" + rUser.getSystemName() + "'";
            cmd.ExecuteNonQuery();
            this.disconnect();
        }
コード例 #9
0
 public void updateStatus(RemoteUser rUser)
 {
     //Set status
     this.connect();
     SqlCeCommand cmd = this.conn.CreateCommand();
     cmd.CommandText = "update " + TABLE_NAME + " set status='" + rUser.getStatus() + "'  where username='******' and system='" + rUser.getSystemName() + "'";
     cmd.ExecuteNonQuery();
     this.disconnect();
 }
コード例 #10
0
 public void updatePassword(RemoteUser rUser)
 {
     //change user password
     this.connect();
     SqlCeCommand cmd = this.conn.CreateCommand();
     DateTime currentTime = DateTime.Now;
     cmd.CommandText = "update " + TABLE_NAME + " set password='******',status='',modified_date='" + currentTime.ToString() + "' where username='******' and system='" + rUser.getSystemName() + "'";
     cmd.ExecuteNonQuery();
     this.disconnect();
 }