Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["id"] == null)
            {
                Response.Redirect("./Film.aspx?id=1");
            }
            int id = int.Parse(Request.QueryString["id"]);

            film = filmsService.GetFilmInfo(id);
            if (film == null)
            {
                Response.Redirect("./Film.aspx?id=1");
            }
            dir = dirService.GetDirIntroduction(id);

            StringBuilder sb = new StringBuilder();
            List <ActorsService.actorIntroduction> actorsList;

            actorsList = actorsService.GetActorIntroductions(id);
            foreach (var actor in actorsList)
            {
                sb.Append("<li class='celebrity'>");
                sb.Append("<img src='" + actor.actorPic + "' onclick=\"window.open('./Celebrity.aspx?actor=" + actor.actorId + "','_self')\" />");
                sb.Append("<div>");
                sb.Append("<a href='./Celebrity.aspx?actor=" + actor.actorId + "'>" + actor.actorName + "</a>");
                if (actor.actorRole != null)
                {
                    sb.Append("<br />");
                    sb.Append("<span>饰:" + actor.actorRole + "</span>");
                }
                sb.Append("</div></li>");
            }
            ActorsList = sb.ToString();
            sb.Clear();
            List <CommentsService.Comment> commentList;

            commentList = commentsService.GetFilmComments(id);
            foreach (var comment in commentList)
            {
                sb.Append("<li class='comment-container'>");
                sb.Append("<div class='comment-container-img'>");
                sb.Append("<img src='" + comment.userPic + "' />");
                sb.Append("</div>");
                sb.Append("<div class='comment-container-body'>");
                sb.Append("<p>" + comment.userComment.userName + "</p>");
                sb.Append("<span>" + comment.userComment.commentDate + "</span>");
                sb.Append("<div class='comment-container-body-rate' id='" + comment.userComment.userName + "'></div>");
                sb.Append("<br />");
                sb.Append("<p>" + comment.userComment.filmComment + "</p>");
                sb.Append("</div></li>");
            }
            CommentList = sb.ToString();
            sb.Clear();
            foreach (var comment in commentList)
            {
                sb.Append("var " + comment.userComment.userName + "=rate.render({elem:'#" + comment.userComment.userName + "',value:" + (float)comment.userComment.userRate / 2 + ",half: true,readonly: true});");
            }
            ScriptList = sb.ToString();
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["kw"] == null)
            {
                Response.Redirect("./Movie.aspx");
            }
            string              kw            = Request.QueryString["kw"];
            List <actorInfo>    actorInfos    = actorServices.Query(kw);
            List <directorInfo> directorInfos = dirService.Query(kw);
            List <filmInfo>     filmInfos     = filmsService.Query(kw);
            StringBuilder       sb            = new StringBuilder();

            if (filmInfos != null || actorInfos != null || directorInfos != null)
            {
                List <int> filmList = new List <int>();
                if (filmInfos != null)
                {
                    foreach (var i in filmInfos)
                    {
                        if (filmList.IndexOf(i.filmId) == -1)
                        {
                            filmList.Add(i.filmId);
                        }
                        else
                        {
                            continue;
                        }
                        sb.Append("<div class='item-body'>");
                        sb.Append("<img src='" + i.filmPic + "' onclick=\"window.open('./Film.aspx?id=" + i.filmId + "','_self')\"/>");
                        sb.Append("<div class='item-body-container'>");
                        sb.Append("<a href='./Film.aspx?id=" + i.filmId + "'><h1>" + i.filmName + "</h1></a>");
                        sb.Append("<div class='item-ename'>" + i.filmEName + "</div>");
                        sb.Append("<div class='item-info'>");
                        sb.Append("<i>" + i.filmRating + "</i>");
                        sb.Append("<div>" + i.filmMode + "</div>");
                        sb.Append("<div>" + i.filmReleaseDate + "上映</div>");
                        sb.Append("</div></div></div>");
                    }
                }
                if (directorInfos != null)
                {
                    foreach (var d in directorInfos)
                    {
                        List <DirService.classicFilm> classics = dirService.GetClassicFilms(d.dirId);
                        foreach (var i in classics)
                        {
                            if (filmList.IndexOf(i.filmId) == -1)
                            {
                                filmList.Add(i.filmId);
                            }
                            else
                            {
                                continue;
                            }
                            sb.Append("<div class='item-body'>");
                            sb.Append("<img src='" + i.filmPic + "' onclick=\"window.open('./Film.aspx?id=" + i.filmId + "','_self')\"/>");
                            sb.Append("<div class='item-body-container'>");
                            sb.Append("<a href='./Film.aspx?id=" + i.filmId + "'><h1>" + i.filmName + "</h1></a>");
                            sb.Append("<div class='item-ename'>" + i.filmEName + "</div>");
                            sb.Append("<div class='item-info'>");
                            sb.Append("<i>" + i.filmRating + "</i>");
                            sb.Append("<div>" + i.filmMode + "</div>");
                            sb.Append("<div>" + i.filmReleaseDate + "上映</div>");
                            sb.Append("</div></div></div>");
                        }
                    }
                }
                if (actorInfos != null)
                {
                    foreach (var a in actorInfos)
                    {
                        List <ActorsService.classicFilm> classics = actorServices.GetClassicFilms(a.actorId);
                        if (classics == null)
                        {
                            break;
                        }
                        foreach (var i in classics)
                        {
                            if (filmList.IndexOf(i.filmId) == -1)
                            {
                                filmList.Add(i.filmId);
                            }
                            else
                            {
                                continue;
                            }
                            sb.Append("<div class='item-body'>");
                            sb.Append("<img src='" + i.filmPic + "' onclick=\"window.open('./Film.aspx?id=" + i.filmId + "','_self')\"/>");
                            sb.Append("<div class='item-body-container'>");
                            sb.Append("<a href='./Film.aspx?id=" + i.filmId + "'><h1>" + i.filmName + "</h1></a>");
                            sb.Append("<div class='item-ename'>" + i.filmEName + "</div>");
                            sb.Append("<div class='item-info'>");
                            sb.Append("<i>" + i.filmRating + "</i>");
                            sb.Append("<div>" + i.filmMode + "</div>");
                            sb.Append("<div>" + i.filmReleaseDate + "上映</div>");
                            sb.Append("</div></div></div>");
                        }
                    }
                }
            }
            else
            {
                sb.Append("<div class='query-error'>");
                sb.Append("<h1>很抱歉,没找到相关的电影</h1>");
                sb.Append("</div>");
            }
            filmList = sb.ToString();
            sb.Clear();
            if (actorInfos != null || filmInfos != null)
            {
                if (actorInfos != null)
                {
                    foreach (var i in actorInfos)
                    {
                        List <ActorsService.classicFilm> classics = actorServices.GetClassicFilms(i.actorId);
                        sb.Append("<div class='item-body'>");
                        sb.Append("<img src='" + i.actorPic + "' onclick=\"window.open('./Celebrity.aspx?actor=" + i.actorId + "','_self')\"/>");
                        sb.Append("<div class='item-body-container'>");
                        sb.Append("<a href='./Celebrity.aspx?actor=" + i.actorId + "'><h1>" + i.actorName + "</h1></a>");
                        sb.Append("<div class='item-ename'>" + i.actorEName + "</div>");
                        sb.Append("<div class='celebrity-info'>代表作:");
                        if (classics != null)
                        {
                            foreach (var c in classics)
                            {
                                sb.Append("《" + c.filmName + "》 ");
                            }
                        }
                        sb.Append("</div></div></div>");
                    }
                }
                if (filmInfos != null)
                {
                    foreach (var f in filmInfos)
                    {
                        List <ActorsService.actorIntroduction> actors = actorServices.GetActorIntroductions(f.filmId);
                        foreach (var i in actors)
                        {
                            List <ActorsService.classicFilm> classics = actorServices.GetClassicFilms(i.actorId);
                            sb.Append("<div class='item-body'>");
                            sb.Append("<img src='" + i.actorPic + "' onclick=\"window.open('./Celebrity.aspx?actor=" + i.actorId + "','_self')\"/>");
                            sb.Append("<div class='item-body-container'>");
                            sb.Append("<a href='./Celebrity.aspx?actor=" + i.actorId + "'><h1>" + i.actorName + "</h1></a>");
                            sb.Append("<div class='item-ename'>" + i.actorEName + "</div>");
                            sb.Append("<div class='celebrity-info'>代表作:");
                            if (classics != null)
                            {
                                foreach (var c in classics)
                                {
                                    sb.Append("《" + c.filmName + "》 ");
                                }
                            }
                            sb.Append("</div></div></div>");
                        }
                    }
                }
            }
            else
            {
                sb.Append("<div class='query-error'>");
                sb.Append("<h1>很抱歉,没找到相关的演员</h1>");
                sb.Append("</div>");
            }
            actorList = sb.ToString();
            sb.Clear();
            if (directorInfos != null || filmInfos != null)
            {
                if (directorInfos != null)
                {
                    foreach (var i in directorInfos)
                    {
                        List <DirService.classicFilm> classics = dirService.GetClassicFilms(i.dirId);
                        sb.Append("<div class='item-body'>");
                        sb.Append("<img src='" + i.dirPic + "' onclick=\"window.open('./Celebrity.aspx?director=" + i.dirId + "','_self')\"/>");
                        sb.Append("<div class='item-body-container'>");
                        sb.Append("<a href='./Celebrity.aspx?director=" + i.dirId + "'><h1>" + i.dirName + "</h1></a>");
                        sb.Append("<div class='item-ename'>" + i.dirEName + "</div>");
                        sb.Append("<div class='celebrity-info'>代表作:");
                        if (classics != null)
                        {
                            foreach (var c in classics)
                            {
                                sb.Append("《" + c.filmName + "》 ");
                            }
                        }
                        sb.Append("</div></div></div>");
                    }
                }
                if (filmInfos != null)
                {
                    foreach (var f in filmInfos)
                    {
                        DirService.dirIntroduction       i        = dirService.GetDirIntroduction(f.filmId);
                        List <ActorsService.classicFilm> classics = actorServices.GetClassicFilms(i.dirId);
                        sb.Append("<div class='item-body'>");
                        sb.Append("<img src='" + i.dirPic + "' onclick=\"window.open('./Celebrity.aspx?director=" + i.dirId + "','_self')\"/>");
                        sb.Append("<div class='item-body-container'>");
                        sb.Append("<a href='./Celebrity.aspx?director=" + i.dirId + "'><h1>" + i.dirName + "</h1></a>");
                        sb.Append("<div class='item-ename'>" + i.dirEName + "</div>");
                        sb.Append("<div class='celebrity-info'>代表作:");
                        if (classics != null)
                        {
                            foreach (var c in classics)
                            {
                                sb.Append("《" + c.filmName + "》 ");
                            }
                        }
                        sb.Append("</div></div></div>");
                    }
                }
            }
            else
            {
                sb.Append("<div class='query-error'>");
                sb.Append("<h1>很抱歉,没找到相关的导演</h1>");
                sb.Append("</div>");
            }
            dirList = sb.ToString();
        }