コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            utility = new Utility();
            utility.loadClient();
            user = getUser();

            //call the web service to retrieve media data
            media = utility.getMedia(itemID);
            comment_list = media.Comments;
            media_url = utility.getMediaUrl(media.MediaId);

            if (user != null)
            {

                isRented = utility.isRented(media.MediaId, user);
            }

            //preload media for viewing if rented
            if (isRented)
            {
                utility.loadFileService();
                Tuple<string, RentItServices.Media, RentItServices.User> tuple =
                    new Tuple<string, RentItServices.Media, RentItServices.User>(user.SharedKey, media, user);

            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //load webservice client
            utility = new Utility();
            utility.loadClient();

            user_list = utility.getAllUsers();
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            utility = new Utility();
            utility.loadClient();

            media_list = utility.getAllMedia();
            user_list = utility.getAllUsers();
        }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            utility = new Utility();
            utility.loadClient();

            //call the web service to retrieve media data
            media = utility.getMedia(itemID);
            media_url = utility.getMediaUrl(media.MediaId);

            music_category_list = utility.getMusicCategories();
            movie_category_list = utility.getMovieCategories();
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //load webservice client
            utility = new Utility();
            utility.loadClient();
            currentUser = getUser();
            if (currentUser == null)
            {
                Response.Redirect("~/index.aspx?msg=You have no permission to carry out the action!");
                return;
            }

            //determine which action to execute
            String deleteBookmark = Request.QueryString["deleteBookmark"];
            if (deleteBookmark != null)
            {
                doDeleteBookmark(Convert.ToInt32(deleteBookmark));
                return;
            }

            //determine if suspend action
            String suspendUser = Request.QueryString["suspend"];
            if (suspendUser != null)
            {
                doSuspend(suspendUser);
                return;
            }

            //determine if unsuspend action
            String unsuspendUser = Request.QueryString["unsuspend"];
            if (unsuspendUser != null)
            {
                doUnSuspend(unsuspendUser);
                return;
            }

            //determine if make admin action
            String makeAdmin = Request.QueryString["make_admin"];
            if (makeAdmin != null)
            {
                doMakeAdmin(makeAdmin);
                return;
            }

            //determine if revoke admin action
            String revokeAdmin = Request.QueryString["revoke_admin"];
            if (revokeAdmin != null)
            {
                doRevokeAdmin(revokeAdmin);
                return;
            }
        }
コード例 #6
0
ファイル: header.ascx.cs プロジェクト: eugenechong/RentIt
        protected void Page_Load(object sender, EventArgs e)
        {
            //load webservice client
            utility = new Utility();
            utility.loadClient();

            //call the web service to load data
            country_list = utility.getCountries();
            music_category_list = utility.getMusicCategories();
            movie_category_list = utility.getMovieCategories();

            currentUser = getUser();
            if (currentUser != null)
            {
                //if user is not null, load his history
                bookmark_list = utility.getUserBookmarks(currentUser);
                rental_list = utility.getRentalHistory(currentUser);
            }
        }
コード例 #7
0
ファイル: index.aspx.cs プロジェクト: eugenechong/RentIt
        protected void Page_Load(object sender, EventArgs e)
        {
            //GET params that determine what UI to show
            String actionType = Request.QueryString["type"];
            String param = Request.QueryString["param"];
            String item = Request.QueryString["item"];

            //GET params that determine if a msg need to be displayed
            String msgTitle = Request.QueryString["msgTitle"];
            String msg = Request.QueryString["msg"];

            //load webservice client
            utility = new Utility();
            utility.loadClient();

            //PREPARE THE NAV BAR WITH INFO
            header thisHeader = (header)LoadControl("~/header.ascx");

            currentUser = getUser();

            if (currentUser != null)
            {

                //login = true;
                //login = utility.isLoggedIn(currentUser);
                login = true;
                thisHeader.login = login;

                thisHeader.userid = currentUser.UserId;
                thisHeader.username = currentUser.Username;
                thisHeader.email = currentUser.Email;
                thisHeader.dp_url = currentUser.FbImageUrl;
                thisHeader.edollar = currentUser.Credits;

            }

            headerBar.Controls.Add(thisHeader);

            //PREPARE MSG BAR
            if (msg != null)
            {
                showMsg(msgTitle, msg);
            }
            //OLD LOGIN

            /*
            //login = true;
            //PREPARE MAIN BODY UI
            if (login)
            {
                if (actionType == null)
                {
                    //if user is loggedin, default to most popular UI

                    if (item != null)
                    { //handle ITEM VIEW

                        //if a param is provided, proceed to do ITEM VIEW
                        showItemUI(Convert.ToInt32(item));

                    }
                    else
                    {
                        showListUI(0);
                    }

                }

                else
                {
                    actionType = actionType.ToLower();
                    //determine which UI to show base on action type
                    if (actionType == "popular")
                    {
                        showListUI(0);
                    }
                    if (actionType == "music")
                    {
                        showListUI(2,null, Convert.ToInt32(param));
                    }
                    if (actionType == "movie")
                    {
                        showListUI(3, null, Convert.ToInt32(param));
                    }
                    if (actionType == "search")
                    { //handle search action
                        if (param != null)
                        {
                            //if a keyword is provided, trigger show search UI
                            showListUI(1, param,0);
                        }
                        else
                        {
                            //no keyword provided, default the most popular UI
                            showListUI(0);
                        }
                    }

                }
            }
            else
            {
                //SINCE NOT LOGIN, add the splash
                splash_carousel splasher = (splash_carousel)LoadControl("~/splash_carousel.ascx");
                mainBody.Controls.Add(splasher);
            }
             * */

            if (actionType == null)
            {
                //if user is loggedin, default to most popular UI

                if (item != null)
                { //handle ITEM VIEW

                    //if a param is provided, proceed to do ITEM VIEW
                    showItemUI(Convert.ToInt32(item));

                }
                else
                {
                    if (currentUser==null)
                    {
                        //SINCE NOT LOGIN, add the splash
                        splash_carousel splasher = (splash_carousel)LoadControl("~/splash_carousel.ascx");
                        mainBody.Controls.Add(splasher);
                    }
                    else
                    {
                        showListUI(0);
                    }
                }

            }

            else
            {
                actionType = actionType.ToLower();
                //determine which UI to show base on action type
                if (actionType == "popular")
                {
                    showListUI(0);
                }
                if (actionType == "book")
                {
                    showListUI(4, null, 0);
                }
                if (actionType == "music")
                {
                    showListUI(2, null, Convert.ToInt32(param));
                }
                if (actionType == "movie")
                {
                    showListUI(3, null, Convert.ToInt32(param));
                }
                if (actionType == "search")
                { //handle search action
                    if (param != null)
                    {
                        //if a keyword is provided, trigger show search UI
                        showListUI(1, param, 0);
                    }
                    else
                    {
                        //no keyword provided, default the most popular UI
                        showListUI(0);
                    }
                }

            }
        }
コード例 #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     utility = new Utility();
     utility.loadClient();
     currentUser = getUser();
 }
コード例 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //load webservice client
            utility = new Utility();
            utility.loadClient();

            currentUser = getUser();

            media_list = utility.getAllMedia();
            music_category_list = utility.getMusicCategories();
            movie_category_list = utility.getMovieCategories();
        }
コード例 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //load webservice client
            utility = new Utility();
            utility.loadClient();

            switch (listType)
            {
                case 0:
                    headerText = "Most Popular Media";
                    //DO THE CODE TO GRAB MOST POPULAR LISTING
                    media_list = utility.getPopularList().Item1;
                    break;
                case 1:
                    headerText = "Search Result for \""+ keyword +"\"";
                    //DO THE CODE TO GRAB SEARCH RESULT LISTING HERE
                    media_list = utility.searchMediaFromTitle(keyword);
                    break;
                case 2:
                    //deals with music categories
                    RentItServices.MusicCategory thisCat = utility.getMusicCatFromID(categoryId);//get the entire category object for this category id
                    headerText="Browsing "+thisCat.Title+ " Category";
                    media_list = utility.searchMusicFromCategory(thisCat.Title);
                    break;
                case 3:
                    //deals with movie categories
                    RentItServices.MovieCategory thisCat2 = utility.getMovieCatFromID(categoryId);//get the entire category object for this category id
                    headerText = "Browsing " + thisCat2.Title + " Category";
                    media_list = utility.searchMovieFromCategory(thisCat2.Title);
                    break;
                case 4:
                    //deals with book categories
                    Team01Rentit.ISMURentItService team01_ws = new Team01Rentit.SMURentItServiceClient();
                    book_list= team01_ws.GetAllBooks();
                    headerText = "Browsing books from Team 01";
                    foreignItems = true;
                    //media_list.add = null;//utility.searchMovieFromCategory(thisCat2.Title);
                    break;

                default:
                    Response.Redirect("?msg=Error figuring out which category you are trying to view!");
                    break;

            }

            bool emptyBook = true;
            bool emptyMedia = true;
            if ((media_list != null) && (media_list.Length > 0))
            {
                emptyMedia = false;
            }
            if ((book_list != null) && (book_list.Length > 0))
            {
                emptyBook = false;
            }

            if ((emptyMedia)&&(emptyBook))

            {
                noContent = true;
            }
        }
コード例 #11
0
ファイル: admin.aspx.cs プロジェクト: eugenechong/RentIt
        protected void Page_Load(object sender, EventArgs e)
        {
            //GET params that determine what UI to show
            String actionType = Request.QueryString["type"];
            String param = Request.QueryString["param"];
            String item = Request.QueryString["item"];

            //GET params that determine if a msg need to be displayed
            String msgTitle = Request.QueryString["msgTitle"];
            String msg = Request.QueryString["msg"];

            //load webservice client
            utility = new Utility();
            utility.loadClient();

            //PREPARE THE NAV BAR WITH INFO
            admin_header thisHeader = (admin_header)LoadControl("~/admin_header.ascx");
            currentUser = getUser();

            if ((currentUser != null)&&(currentUser.IsAdmin))
            {

                //login = true;
                //login = utility.isLoggedIn(currentUser);
                login = true;
                thisHeader.login = login;

                thisHeader.userid = currentUser.UserId;
                thisHeader.username = currentUser.Username;
                thisHeader.email = currentUser.Email;

            }

            headerBar.Controls.Add(thisHeader);

            //PREPARE MSG BAR
            if (msg != null)
            {
                showMsg(msgTitle, msg);
            }

            if (login)
            {
                if (actionType == "user_analytics")
                {
                    showUserAnalytics();
                }
                if (actionType == "media_analytics")
                {
                    showMediaAnalytics();
                }
                if (actionType == "user")
                {
                    showUserUI();
                }
                if (actionType == "media")
                {
                    showListMediaUI();
                }

                if (item != null)
                { //handle ITEM VIEW

                    //if a param is provided, proceed to do ITEM VIEW
                    showMediaItemUI(Convert.ToInt32(item));
                }

            }
            else
            {

            }
        }