Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="touristID"></param>
        /// <returns></returns>
        public TourList TourListByTourist(Guid touristID)
        {
            TourList tlist = new TourList();
            Tour     t;

            SqlCommand   command;
            SqlParameter paramTouristID = new SqlParameter("@IDUtilizador", SqlDbType.UniqueIdentifier);

            command             = new SqlCommand("PercursosUtilizador", this.connection);
            command.CommandType = CommandType.StoredProcedure;

            paramTouristID.Value = touristID;
            command.Parameters.Add(paramTouristID);

            this.reader = command.ExecuteReader();

            while (this.reader.Read())
            {
                t = new Tour();

                t.tourID   = Int32.Parse(reader["ID"].ToString());
                t.cityID   = Int32.Parse(reader["IDCidade"].ToString());
                t.cityName = reader["NOME"].ToString();
                t.begin    = DateTime.Parse(reader["DATA_HORA_INICIO"].ToString());

                tlist.tours.Add(t);
            }

            this.reader.Close();

            return(tlist);
        }
Beispiel #2
0
        public TourList TourListForTourist(String username, String password)
        {
            TourList tlist = new TourList();

            //if (Membership.ValidateUser(username, password))
            //{
            //Guid guid = (Guid)Membership.GetUser(username).ProviderUserKey;
            Guid     guid     = new Guid("12345678-9012-3456-7890-123456789013");
            Database database = new Database();

            database.connect();
            tlist = database.Query.TourListByTourist(guid);
            database.disconnect();

            tlist.authenticated = true;
            //}

            return(tlist);
        }
        public TourList TourListForTourist(String username, String password)
        {
            TourList tlist = new TourList();

            //if (Membership.ValidateUser(username, password))
            //{
                //Guid guid = (Guid)Membership.GetUser(username).ProviderUserKey;
            Guid guid = new Guid("12345678-9012-3456-7890-123456789013");
                Database database = new Database();
                database.connect();
                    tlist = database.Query.TourListByTourist(guid);
                database.disconnect();

                tlist.authenticated = true;
            //}

            return tlist;
        }
Beispiel #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="touristID"></param>
        /// <returns></returns>
        public TourList TourListByTourist(Guid touristID)
        {
            TourList tlist = new TourList();
            Tour t;

            SqlCommand command;
            SqlParameter paramTouristID = new SqlParameter("@IDUtilizador", SqlDbType.UniqueIdentifier);

            command = new SqlCommand("PercursosUtilizador", this.connection);
            command.CommandType = CommandType.StoredProcedure;

            paramTouristID.Value = touristID;
            command.Parameters.Add(paramTouristID);

            this.reader = command.ExecuteReader();

            while (this.reader.Read())
            {                
                t = new Tour();

                t.tourID = Int32.Parse(reader["ID"].ToString());
                t.cityID = Int32.Parse(reader["IDCidade"].ToString());
                t.cityName = reader["NOME"].ToString();
                t.begin = DateTime.Parse(reader["DATA_HORA_INICIO"].ToString());                

                tlist.tours.Add(t);
            }

            this.reader.Close();

            return tlist;
        }