コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["STUDENT"] == null)
            {
                Response.Redirect("~/Web/Account/tempLogin.aspx?page=Users/Student/students-profile.aspx");
            }

            Qaelo.Models.StudentModel.Student student = (Qaelo.Models.StudentModel.Student)Session["STUDENT"];

            string html = "";

            if (Request.QueryString["page"] != null)
            {
                if (Request.QueryString["page"] == "sellbooks")
                {
                    lblSuccess.Text = "You have successfully Posted your used textbook";
                }
                else if (Request.QueryString["page"] == "freelancer")
                {
                    lblSuccess.Text = "You have successfully registered yourself as a freelancer";
                }
                else if (Request.QueryString["page"] == "profile")
                {
                    lblSuccess.Text = "You have successfully updated your profile";
                }
                else if (Request.QueryString["page"] == "editbook")
                {
                    lblSuccess.Text = "You have successfully updated your book";
                }
                else if (Request.QueryString["page"].Equals("previousWork"))
                {
                    lblSuccess.Text = "Successfully added your previous work";
                }
            }
            //Make Profile Public or private
            if (Request.QueryString["disable"] != null)
            {
                //Delete Profile From Societies table
                connection.deleteStudentProfile(Convert.ToInt32(Request.QueryString["disable"].ToString()));
                lblSuccess.Text      = lblSuccess.Text = "";
                lblErrorMessage.Text = "Your Profile is now Private";
            }
            else if (Request.QueryString["enable"] != null)
            {
                //Insert Profile into Societies table
                if (!connection.isProfilePublic(Convert.ToInt32(Request.QueryString["enable"])))
                {
                    connection.uploadStudentProfile(student);
                }

                lblSuccess.Text      = lblSuccess.Text = "Your Profile is now Public";
                lblErrorMessage.Text = "";
            }

            //removeAd
            if (Request.QueryString["removeAd"] != null)
            {
                int id = Convert.ToInt32(Request.QueryString["removeAd"]);
                //delete
                new AccommodationConnection().deleteRoomAd(id, student);
                lblSuccess.Text = "Successfully deleted room advert";
            }

            //delete book
            if (Request.QueryString["remove"] != null)
            {
                int id = Convert.ToInt32(Request.QueryString["remove"]);
                //delete
                connection.deleteBook(id, student);
                lblSuccess.Text = "Successfully deleted book";
            }
            else if (Request.QueryString["edit"] != null)
            {
                //Edit book
                Response.Redirect("students-edit-books.aspx?id=" + Convert.ToInt32(Request.QueryString["edit"]));
            }

            if (connection.isProfilePublic(student.Id))
            {
                //if a student is a freelancer then include it here
                Qaelo.Models.StudentModel.Freelancer fl = connection.Freelancer(student.Id);
                string freelancer = "";

                if (fl != null)
                {
                    freelancer = "<h6>Freelancer :</h6><small style='font-size:12px'>" + fl.Work.Replace(';', '\n') + "</small>";
                }

                string proficePic = "../../../Images/Users/Students/" + student.ProfileImage;

                if (student.ProfileImage.Contains("http"))
                {
                    proficePic = student.ProfileImage;
                }

                html += string.Format(@"
                <div class='thumbnail'>
                  <div class='w3-card-12'>
                                <figure >
                                  <img src='{0}' style='height:245px;width:245px' />
                          <figcaption style = 'background-image: url('')'>
                                {1}                  
                          </figcaption>
                           </figure>
                    <div class='w3-container' style='margin:10px'>
                        <h6 style='margin-bottom:10px'><b>{2}- <small style='font-size:12px'>{3}</small></b></h6>
                        <h6 style='margin-bottom:10px'>Course Enrolled:<small style='font-size:12px'>{4}</small></h6>
                        <h6 style='margin-bottom:10px'>Year Of Study : <small style='font-size:12px'>{5}</small></h6>
                        <h6 style='margin-bottom:10px'>Email :<small style='font-size:12px'>{6}</small></h6>
                        {7}<br/><br/>
                      <a href='students-profile.aspx?disable={8}' class='btn btn-danger pull-right form-control'>Go Private!</a>
                        <br /><br/>
                    </div>
                  </div>
                </div>
                    
            ", proficePic, student.Description, student.FirstName + " " + student.LastName, student.Institution, student.QualificationEnrolled, student.YearOfStudy, student.Email, freelancer, student.Id);
            }
            else
            {
                Qaelo.Models.StudentModel.Freelancer fl = connection.Freelancer(student.Id);
                string freelancer = "";

                if (fl != null)
                {
                    freelancer = "<h6>Freelancer :</h6><small style='font-size:12px'>" + fl.Work.Replace(';', '\n') + "</small>";
                }


                string proficePic = "../../../Images/Users/Students/" + student.ProfileImage;

                if (student.ProfileImage.Contains("http"))
                {
                    proficePic = student.ProfileImage;
                }

                html += string.Format(@"
                <div class='thumbnail'>
                  <div class='w3-card-12'>
                                <figure >
                                  <img src='{0}' style='height:245px;width:245px' />
                          <figcaption style = 'background-image: url('')'>
                                {1}                  
                          </figcaption>
                           </figure>
                    <div class='w3-container' style='margin:10px'>
                        <h6 style='margin-bottom:10px'><b>{2}- <small style='font-size:12px'>{3}</small></b></h6>
                        <h6 style='margin-bottom:10px'>Course Enrolled:<small style='font-size:12px'>{4}</small></h6>
                        <h6 style='margin-bottom:10px'>Year Of Study : <small style='font-size:12px'>{5}</small></h6>
                        <h6 style='margin-bottom:10px'>Email :<small style='font-size:12px'>{6}</small></h6>
                        {7}<br/><br/>
                      <a href='students-profile.aspx?enable={8}' class='btn btn-success pull-right form-control'>Go Public!</a>
                        <br /><br/>
                    </div>
                  </div>
                </div>
                   
            ", proficePic, student.Description, student.FirstName + " " + student.LastName, student.Institution, student.QualificationEnrolled, student.YearOfStudy, student.Email, freelancer, student.Id);
            }
            lblProfileView.Text = html;

            //Become a freelancer
            //if(!connection.isAllowedToPost(student.Id))
            //{
            //    lblFreelance.Text = "<a href='#cannotBecomeFreelancer'data-toggle='modal' class='btn btn-submit' >Freelancing</a>";
            //}
            //else
            //    lblFreelance.Text = "<a href='Freelancer.aspx' class='btn btn-submit' >Freelancing</a>";
            /*** load rooms ads ***/


            List <RoomAd> ads = new AccommodationConnection().getRoomAds(student.Id);

            //set what to appear on advertise on landlords
            if (ads.Count > 0)
            {
                //Fill in
                lblRoomAds.Text = "";
                foreach (RoomAd item in ads)
                {
                    lblRoomAds.Text += string.Format(@"<tr>
                                                <td>{0}</td>
                                                <td>{1}</td>
                                                <td>{2}</td>
                                                <td>{3}</td>
                                                <td>{4}</td>
                                                <td><a href='students-profile.aspx?removeAd={5}' class='btn btn-danger'>remove</a></td>
                                            </tr>", General.getDateString(item.DatePosted), item.Arrangement, item.Gender, item.PaymentType, item.RentAmount, item.Id);
                }
                lblNumAdds.Text = ads.Count.ToString();
                //Set view to be current ads
                setView.HRef = "#viewAdd";
            }
            else
            {
                //Fill some fields
                txtPhone.Text = student.Number;

                setView.HRef = "#share";
            }

            //Check if the student has already some books sold
            List <Book> books = new StudentConnection().getAllStudentBoks(student.Id);

            lblPublished.Text = "";
            if (books.Count > 0)
            {
                if (books.Count >= 8)
                {
                    addNew.Visible = false;
                }

                foreach (Book book in books)
                {
                    string desc = "";

                    if (book.Description.Length > 65)
                    {
                        desc = book.Description.Substring(0, 65);
                    }
                    else
                    {
                        desc = book.Description;
                    }

                    lblPublished.Text += string.Format(@"<div class='col-sm-4' style='margin:30px'>
                                        <div class='col-sm-6'>
                                            <img src='../../../Images/Book/{0}' class='img-thumbnail' style='height:150px;width:100%' id='image1'/>
                                        </div>
                                        <div class='col-sm-6'>
                                            <label><strong>Title: {1}</strong></label><br/>
                                            <label><strong>Price:R{2}.00</strong></label><br/>
                                            <label><strong><a href='students-profile.aspx?remove={3}' class='btn btn-danger'>Delete</a></strong> <a href='students-profile.aspx?edit={3}' class='btn btn-finish btn-fill btn-warning btn-wd'>Edit</a></strong></label>
                                        </div>
                                    </div>
                                ", book.Image, book.Name, book.Price, book.Id);
                }

                lblsellbooks.Text = "<a href='#sellbooks'  data-toggle='modal'>My Store</a>";
            }
            else
            {
                //Check if the student is allowed to post
                if (!connection.isAllowedToPost(student.Id))
                {
                    lblsellbooks.Text = "<a href='#cannotsellbooks'data-toggle='modal'> My Store</a>";
                }
                else
                {
                    lblsellbooks.Text = "<a href='students-sell-textbooks.aspx'> My Store</a>";
                }
            }

            lblSuccess.Text = "";

            /******** Specials view **********/
            foreach (Qaelo.Models.ShopOwnerModel.ShopAds shop in new ShopConnection().getAllSpecials())
            {
                //create card view for specials
                lblSpecialLinks.Text += string.Format(@"<div class='col-sm-3'>
                    <div class='thumbnail'>
                      <div class='w3-card-12'>
                          <figure class=''>
                          <img src='../../../Images/Shops/Specials/{0}' class='' style='height:220px;width:100%'/>
                              <figcaption style = 'background-image: url('')'>{1}
                                   </figcaption>
                               </figure>
                        <div class='w3-container' style='margin:10px'>
                            <h6><b>{2} - <small>{3}</small></b></h6>
                            <strong>Shop No:<small>{4}</small></strong><br />
                           <strong> Open: <small>{5}</small></strong><br />
                            <strong>Call:<small>{6}</small>
                                <a href='#shopSpecial{7}' data-toggle='modal' class='btn btn-default pull-right'>View Special</a>
                            </strong><br />
                        </div><br />
                      </div>
                    </div>
                </div>", shop.Image, "", shop.Name, shop.University, shop.ShopNo, shop.TradingHours, new ShopConnection().getShopOwner(shop.ShopOwnerId).Number, shop.Id);


                //Generate links for individual Special
                //lblSpecialLinks.Text += string.Format("<a href='#shopSpecial{0}' data-toggle='modal'>View Special</a>",shop.Id);
                lblSpecials.Text += string.Format(@"<div class='modal fade' id='shopSpecial{4}' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
                        <div class='modal-dialog modal-lg'>
                        <div class='modal-content'>
                                    <div class='modal-body'>
                                        <div class='col-md-12' style='margin:20px'>
                                        <div class='col-md-6'>
                                            <img src='../../../Images/Shops/Specials/{0}' class='img-thumbnail' />
                                        </div>
                                        <div class='col-md-6'>
                                            <h4>Special Name</h4>
                                            <p>{1}</p>
                                            <br/><h4>Description</h4>
                                            <p>{2}</p>
                                            <br/><h4>Price:</h4>{3}
                                        </div>
                                    
                                        </div>
                                    <div class='modal-footer'>
                                        <button  class='btn btn-danger pull-right' data-dismiss='modal'>Back</button>
                                    </div>
                                    </div>
                                </div>
                            </div>
                            </div>", shop.Image, shop.Name, shop.Description.Replace(char.ConvertFromUtf32(13), "<br/>"), shop.Campus, shop.Id);
            }
        }
コード例 #2
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            //load
            StudentConnection connection = new StudentConnection();

            //Get all students from selected varsity
            string query = " Institution = " + "'" + txtText.Text + "'";
            List <Qaelo.Models.StudentModel.Student> students = connection.getAllStudents(query);

            // Get the books made by these students
            List <Book> books = new List <Book>();

            foreach (Qaelo.Models.StudentModel.Student student in students)
            {
                //check if they have books and add to list

                List <Book> studentBooks = connection.getAllStudentBoks(student.Id);

                foreach (Book book in studentBooks)
                {
                    // check whether the books match the search filter

                    if (book.Field == ddlField.SelectedItem.Value && book.YearOfStudy == ddlYear.SelectedItem.Value)
                    {
                        books.Add(book);
                    }
                }
            }

            //List<Book> books = connection.getAllBooks();

            lblBooks.Text = "";
            int count = 0;

            foreach (Book book in books)
            {
                if (connection.isProfilePublic(book.StudentId))
                {
                    count++;
                    string desc = "";

                    if (book.Description.Length > 65)
                    {
                        desc = book.Description.Substring(0, 65);
                    }
                    else
                    {
                        desc = book.Description;
                    }

                    lblBooks.Text += string.Format(@"<div class='col-sm-6' style='margin-bottom:20px'>
                                                  <div class='col-sm-6'>
                                                    <img src = '../../../Images/Book/{0}' class='img-thumbnail' style='height:150px;width:100%' id='image1'/>
                                                  <br/><br/>
                                                </div>
                                                <div class='col-sm-6'>
                                                    <p style='font-size:smaller;font-style:normal'><strong>Title: <strong style='color:red'>{1}</strong></strong></p>
                                                    <p style='font-size:smaller;font-style:normal'><strong>Study Field: <strong style='color:dimgrey'>{2}</strong></strong></p>
                                                    <p style='font-size:smaller;font-style:normal'><strong>Year of Study: <strong style='color:dimgrey'>{3}</strong></strong></p>
                                                    <p style='font-size:smaller;font-style:normal'><strong>Price: R<strong style='color:dimgrey'>{4}.00</strong></strong></p>
                                                    <a href='#book{5}' class='btn btn-default btn-md' data-toggle='modal' style='background:#d89b4e'>More info</a>
                                                </div>
                                            </div>", book.Image, book.Name, book.Field, book.YearOfStudy, book.Price, book.Id);

                    //Modal

                    //get student
                    Qaelo.Models.StudentModel.Student student = connection.getStudent(book.StudentId);
                    lblBooks.Text += string.Format(@"<div class='modal fade' id='book{7}' tabindex='-1' role='dialog' aria-labelledby='myModalLabel{1}' aria-hidden='true'>
                    <div class='modal-dialog modal-lg'>
                        <div class='modal-content'>
                                    <div class='modal-body'>
                                        <div class='container'>
                                            <div class='col-sm-10'>
                                                <div class='col-sm-4'>
                                                    <h2>Book Image</h2>
                                                    <img src = '../../../Images/Book/{0}' class='img-thumbnail' style='height:350px;width:100%' id='image1'/><br/><br/>
                                                </div>
                                                <div class='col-sm-4'>
                                                    <h2>About the book</h2>
                                                    <label><strong>Title:</strong></label>{1}<br />
                                                    <label><strong>Description:</strong></label>{2}<br/><br />
                                                    <label><strong>Price:</strong> {3}</label><br/><br />
                                                </div>
                                                <div class='col-sm-3'>
                                                    <h2>Seller info</h2>
                                                    <label><strong>Seller Name:</strong></label>{4}<br/>
                                                    <label><strong>Seller Number:</strong></label>{5}<br/>
                                                    <label><strong>University:</strong></label>{6}<br/>
                                                </div>
                                             </div>
                                            </div>
                                        </div>
                                    <div class='modal-footer'>
                                        <button  class='btn btn-default pull-left' data-dismiss='modal'>Cancel</button>
                                    </div>
                                    </div>
                                </div>
                            </div>", book.Image, book.Name, book.Description, book.Price, student.FirstName, student.Number, student.Institution, book.Id);
                }
            }
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["ADMIN"] == null)
            {
                Response.Redirect("~/Web/Account/tempLogin.aspx?");
            }

            //Remove users from the system
            if (Request.QueryString["student"] != null)
            {
                new StudentConnection().deleteStudent(Convert.ToInt32(Request.QueryString["student"]));
            }
            else if (Request.QueryString["shop"] != null)
            {
                new ShopConnection().deleteShoProfile(Convert.ToInt32(Request.QueryString["shop"]));
            }
            else if (Request.QueryString["accommodation"] != null)
            {
                new ManagerConnection().deletedManager(Convert.ToInt32(Request.QueryString["accommodation"]));
            }
            else if (Request.QueryString["society"] != null)
            {
                new SocietyConnection().deleteProfile(Convert.ToInt32(Request.QueryString["society"]));
            }
            else if (Request.QueryString["event"] != null)
            {
                new EventConnection().deleteEventPoster(Convert.ToInt32(Request.QueryString["event"]));
            }

            /** Students **/

            List <Qaelo.Models.StudentModel.Student> students = new StudentConnection().getAllStudents();

            lblNumOfStudents.Text = students.Count.ToString();
            //Load students
            foreach (Qaelo.Models.StudentModel.Student item in students)
            {
                if (item != null)
                {
                    lblStudents.Text += string.Format(@"<tr>
                                                    <td>{0}</td>
                                                    <td>{1}</td>
                                                    <td>{2}</td>
                                                    <td>{3}</td>
                                                    <td>{4}</td>
                                                    <td><a href='ListOfUsers.aspx?student={5}' class='btn btn-danger'>Remove</a></td>
                                                    ", item.FirstName + " " + item.LastName, item.Email, item.Number, item.Institution, General.getDateString(item.RegistrationDate), item.Id);
                }
            }

            /** Shop Owners **/

            List <Qaelo.Models.ShopOwnerModel.ShopOwner> shops = new ShopConnection().getAllShopOwners();

            lblNumOfShopOwner.Text = shops.Count.ToString();

            foreach (Qaelo.Models.ShopOwnerModel.ShopOwner item in shops)
            {
                if (item == null)
                {
                    lblShops.Text += string.Format(@"<tr>
                                                    <td>{0}</td>
                                                    <td>{1}</td>
                                                    <td>{2}</td>
                                                    <td>{3}</td>
                                                    <td><a href='ListOfUsers.aspx?shop={4}' class='btn btn-danger'>Remove</a></td>
                                                    ", item.FullName, item.Email, item.Number, General.getDateString(item.RegistrationDate), item.Id);
                }
            }

            /**Event Posters **/
            List <Qaelo.Models.EventPosterModel.EventPoster> posters = new EventConnection().getAllPosters();

            lblNumOfEventPosters.Text = posters.Count.ToString();

            foreach (Qaelo.Models.EventPosterModel.EventPoster item in posters)
            {
                if (item != null)
                {
                    lblEventPosters.Text += string.Format(@"<tr>
                                                    <td>{0}</td>
                                                    <td>{1}</td>
                                                    <td>{2}</td>
                                                    <td>{3}</td>
                                                    <td><a href='ListOfUsers.aspx?event={4}' class='btn btn-danger'>Remove</a></td>
                                                    ", item.FullName, item.Email, item.Number, General.getDateString(item.RegistrationDate), item.Id);
                }
            }

            /*** Porperty Owner **/
            List <Qaelo.Models.AccommodationModel.Manager> managers = new ManagerConnection().getAllManagers();

            lblNumOfPorpertyOwners.Text = managers.Count.ToString();



            foreach (Qaelo.Models.AccommodationModel.Manager item in managers)
            {
                if (item != null)
                {
                    lblAccommodations.Text += string.Format(@"<tr>
                                                    <td>{0}</td>
                                                    <td>{1}</td>
                                                    <td>{2}</td>
                                                    <td>{3}</td>
                                                    <td><a href='ListOfUsers.aspx?accommodation={4}' class='btn btn-danger'>Remove</a></td>
                                                     ", item.firstName + " " + item.lastName, item.email, item.number, General.getDateString(item.registrationDate), item.id);
                }
            }
        }
コード例 #4
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            //load
            StudentConnection connection = new StudentConnection();

            //Get all students from selected varsity
            string query = " Institution = " + "'" + txtText.Text + "'";
            List <Qaelo.Models.StudentModel.Student> students = connection.getAllStudents(query);

            List <Qaelo.Models.StudentModel.Freelancer> freelancers = new List <Models.StudentModel.Freelancer>();

            //add each profile to freelance list
            foreach (Qaelo.Models.StudentModel.Freelancer freelancer in connection.getAllFreelancers())
            {
                //add student as freelance
                if (connection.getStudent(freelancer.StudentId) != null)
                {
                    if (connection.getStudent(freelancer.StudentId).Institution.Equals(txtText.Text))
                    {
                        if (freelancer.Work.Contains(txtFreelancers.Text))
                        {
                            freelancers.Add(freelancer);
                        }
                    }
                }
            }
            string html   = "";
            int    length = General.getLengthOfLongestFreelancer(freelancers);

            foreach (Models.StudentModel.Freelancer freelancer in freelancers)
            {
                if (connection.isProfilePublic(freelancer.StudentId))
                {
                    //if a student is a freelancer then include it here
                    string[] abilities = freelancer.Work.Split(';');
                    string   work      = "";

                    for (int i = 0; i < abilities.Count(); i++)
                    {
                        if (abilities[i].Count() > 0)
                        {
                            if ((i + 1) == abilities.Count())
                            {
                                work += abilities[i];
                            }
                            else
                            {
                                if (abilities[i].Count() > 4)
                                {
                                    work += "<li>" + abilities[i] + "</li>";
                                }
                                //work += "." + abilities[i] + "." + "<br/>";
                            }
                        }
                    }

                    string fr = "<h6 style='margin-top:10px'>I freelance as a : <br/><ul></h6><small style='font-size:12px'>" + work + "</b></small><ul/>";
                    Qaelo.Models.StudentModel.Student student = connection.getStudent(freelancer.StudentId);
                    string[] images = freelancer.Image.Split(';');

                    html += string.Format(@"
                        <div class='col-md-3 thumbnail'>
                          <div class='w3-card-12'>
                                        <figure >
                                          <img src='../../../Images/Users/Students/{0}' style='height:220px;width:100%' />
                                  <figcaption style = 'background-image: url('')'>
                                        {1}                  
                                  </figcaption>
                                   </figure>
                            <div class='w3-container' style='margin:10px'>
                                <h6><b>{2} - <small style='font-size:12px'>{3}</small></b></h6>
                                {4}<br/>
                              <a href='#freelancer{5}'  data-toggle='modal' class='btn pull-right form-control' style='background:#d89b4e'>View profile</a>
                                <br/><br/>
                            </div>
                          </div>
                        </div>

                       
                    ", student.ProfileImage, student.Description, student.FirstName + student.LastName, student.Institution, fr, student.Id);

                    //Modal pop up

                    //Get freelance portfolio
                    PreviousWork portfolio = connection.getPortfolio(student.Id);

                    string image1 = "default.jpg";
                    string image2 = "default.jpg";
                    string image3 = "default.jpg";

                    string video1 = "videoDefault.mp4";
                    string video2 = "videoDefault.mp4";
                    string video3 = "videoDefault.mp4";

                    string cvDescription = "";

                    if (portfolio != null)
                    {
                        //Test for images
                        string[] pictures = portfolio.Pictures.Split(';');

                        if (pictures[0] != string.Empty)
                        {
                            image1 = pictures[0];
                        }

                        if (pictures[1] != string.Empty)
                        {
                            image2 = pictures[1];
                        }

                        if (pictures[2] != string.Empty)
                        {
                            image3 = pictures[2];
                        }

                        //Test for videos
                        string[] videos = portfolio.Videos.Split(';');

                        if (videos[0] != string.Empty)
                        {
                            video1 = videos[0];
                        }

                        if (videos[1] != string.Empty)
                        {
                            video2 = videos[1];
                        }

                        if (videos[2] != string.Empty)
                        {
                            video3 = videos[2];
                        }

                        cvDescription = portfolio.Links;
                    }

                    lblSingleProfile.Text += string.Format(@"<div class='modal fade' id='freelancer{11}' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
                            <div class='modal-dialog modal-lg'>
                            <div class='modal-content'>
                                        <div class='modal-body'>
                                            <div class='container'>
                                                <div class='col-sm-9'>
                                                    <div class='col-sm-5'>
                                                        <h2>Education</h2>
                                                        <hr />            
                                                        <strong>University:</strong><p>{0}</p>
                                                        <strong>Course Enrolled:</strong><p>{1}</p>
                                                        <strong>Freelance:</strong><p>{2}</p>
                                                        <strong>Freelancing Description:</strong><p>{3}</p>
                                                        <strong>Price:</strong><p>{4}</p>
                                                    </div>
                                                    <div class='col-sm-5'>
                                                        <h2>Contact Info</h2>
                                                         <hr />   
                                                        <strong>Full Name :</strong><p>{5}</p>
                                                        <strong>Email:</strong><p>{6}</p>
                                                        <strong>Phone No:</strong><p>{7}</p>
                                                    </div>
                                                 </div>

                                                 <div class='col-sm-9' style='margin-top:50px'> </div>

 <!-- Portfolio-->
<div class='col-sm-9'>                                       
         <div class='panel-group' id='accordion{11}'>
                                                      
             <div class='panel panel-warning'>
                                                        
                 <div class='panel-heading'>
                                                          <h4 class='panel-title'>
                                                            <a data-toggle='collapse' data-parent='#accordion{11}' href='#collapse1{11}'>
                                                           View My Portfolio Pictures</a>
                                                          </h4>
                                                        </div>
                                                        
                 <div id='collapse1{11}' class='panel-collapse collapse in'>
                                                          <div class='panel-body'>
                                                              <div class='col-sm-12'>
                                                    
                                                                  
                                                                                                        <div class='col-sm-4'>
                                                                                                            <a id='popover1{11}' class='btn' rel='popover1{11}' data-content=''  >
                                                                                                                <img src='../../../Images/Freelancer/{12}' class='img-thumbnail' />
                                                                                                            </a>
                                                                                                             
                                                                                                        </div>
                                                                                                       
                                                                                                         <div class='col-sm-4'>
                                                                                                             <a id='popover2{11}' class='btn' rel='popover2{11}' data-content=''  >
                                                                                                             <img src='../../../Images/Freelancer/{13}' class='img-thumbnail' />
                                                                                                                 </a>
                                                                                                        </div>
                                                                                                       
                                                                                                         <div class='col-sm-4'>
                                                                                                             <a id='popover3{11}' class='btn' rel='popover3{11}' data-content=''  >
                                                                                                             <img src='../../../Images/Freelancer/{14}' class='img-thumbnail' />
                                                                                                                 </a>
                                                                                                        </div>
                                                                                                     </div>
                                                          </div>
                                                        </div>
                                                      
             </div>
         </div>
         <!-- Next conetent here-->


                                                      <div class='panel panel-warning'>
                                                        <div class='panel-heading'>
                                                          <h4 class='panel-title'>
                                                            <a data-toggle='collapse' data-parent='#accordion{11}' href='#collapse2{11}'>
                                                            View My Portfolio Videos</a>
                                                          </h4>
                                                        </div>
                                                        <div id='collapse2{11}' class='panel-collapse collapse'>
                                                          <div class='panel-body'>
                                                              <div class='col-sm-12'>
                                                                <div class='col-sm-4'>
                                                                    <video src='../../../Images/Freelancer/{15}' class='img-thumbnail' style='height:150px;' controls='controls' />
                                                                </div>
                                                                                                       
                                                                 <div class='col-sm-4'>
                                                                     <video src='../../../Images/Freelancer/{16}' class='img-thumbnail' style='height:150px;' controls='controls' />
                                                                </div>
                                                                                                        
                                                                <div class='col-sm-4'>
                                                                    <video src='../../../Images/Freelancer/{17}' class='img-thumbnail' style='height:150px;' controls='controls' />
                                                                </div>
                                                                                                     
                                                              </div>

                                                          </div>
                                                        </div>
                                                      </div>
    <!-- Next content here-->
                                                <div class='panel panel-warning'>
                                                        <div class='panel-heading'>
                                                          <h4 class='panel-title'>
                                                            <a data-toggle='collapse' data-parent='#accordion{11}' href='#collapse3{11}'>
                                                            View My Portfolio CV</a>
                                                          </h4>
                                                        </div>
                                                        <div id='collapse3{11}' class='panel-collapse collapse'>
                                                          <div class='panel-body'>
                                                              <div class='col-sm-12'>
                                                    
                                                                                                        <p>
                                                                                                           {18}
                                                                                                        </p>
                                                                                                     </div>

                                                          </div>
                                                        </div>
                                                      </div>
     </div>

                                               
                                                 </div>
                                        <div class='modal-footer'>
                                            <button  class='btn btn-default pull-left' data-dismiss='modal'>Cancel</button>
                                        </div>
                                        </div>
                                    </div>
                                </div>
</div>", student.Institution, student.QualificationEnrolled, freelancer.Work, freelancer.Description, freelancer.Price, student.FirstName + " " + student.LastName, student.Email, student.Number, images[0], images[1], images[2], student.Id, image1, image2, image3, video1, video2, video3, cvDescription);
                }
            }

            if (html.Length > 0)
            {
                lblProfileView.Text = html;
            }
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["STUDENT"] == null)
            {
                Response.Redirect("~/Web/Account/tempLogin.aspx?page=Users/Student/student-edit-profile.aspx");
            }

            if (IsPostBack)
            {
            }
            else
            {
                Qaelo.Models.StudentModel.Student student = (Qaelo.Models.StudentModel.Student)Session["STUDENT"];

                txtDescription.Text   = student.Description;
                txtEmail.Text         = student.Email;
                txtName.Text          = student.FirstName;
                txtLastName.Text      = student.LastName;
                txtNumber.Text        = student.Number;
                txtQualification.Text = student.QualificationEnrolled;
                if (student.YearOfStudy != string.Empty)
                {
                    ddlYear.SelectedIndex = ddlYear.Items.IndexOf(ddlYear.Items.FindByValue(student.YearOfStudy));
                }

                txtText.Text = student.Institution;

                string proficePic = "~/Images/Users/Students/" + student.ProfileImage;

                if (student.ProfileImage.Contains("http"))
                {
                    proficePic = student.ProfileImage;
                }

                wizardPicturePreview.Src = proficePic;

                //Freelancing autofill
                Qaelo.Models.StudentModel.Freelancer freelancer = new StudentConnection().Freelancer(student.Id);

                if (freelancer != null)
                {
                    ddlWork1.Text       = freelancer.Work;
                    txtPrice.Text       = freelancer.Price;
                    txtDescription.Text = freelancer.Description;

                    string terms = "";

                    if (freelancer.Price.Contains("Once-off"))
                    {
                        terms         = "Once-off";
                        txtPrice.Text = freelancer.Price.Split(' ')[0];
                    }
                    else if (freelancer.Price.Contains("Per/Hour"))
                    {
                        terms         = "Per/Hour";
                        txtPrice.Text = freelancer.Price.Split(' ')[0];
                    }
                    else if (freelancer.Price.Contains("Negotiable"))
                    {
                        terms = "Negotiable";
                    }
                    else
                    {
                        terms = "";
                    }


                    ddlPriceTerms.SelectedIndex = ddlPriceTerms.Items.IndexOf(ddlPriceTerms.Items.FindByValue(terms));
                }
            }
        }