Exemple #1
0
    protected void submitFeedback(object sender, EventArgs e)
    {
        Tour_Guide tg = new Tour_Guide(Session["username"].ToString());

        tg.setInfo();
        Tour   t    = new Tour();
        String tgid = tg.getTGID();

        // tgid, bookingid, rating, feedback
        String TID     = Session["TID"].ToString();
        String tour_id = Session["tourID"].ToString();

        Booking b      = new Booking();
        String  reader = b.getBookingIDByTID_tourID(TID, tour_id);

        String[] readerArr = reader.Split(';');
        Array.Resize(ref readerArr, readerArr.Length - 1);
        String booking_id = readerArr[0];

        String ratings = "";

        if (rating1.Checked)
        {
            ratings = rating1.Text;
        }
        else if (rating2.Checked)
        {
            ratings = rating2.Text;
        }
        else if (rating3.Checked)
        {
            ratings = rating3.Text;
        }
        else if (rating4.Checked)
        {
            ratings = rating4.Text;
        }
        else
        {
            ratings = rating5.Text;
        }

        String feedback = TRFB.Text;

        TR_Ratings trr = new TR_Ratings();

        trr.sendRatingsAndFeedback(tgid, booking_id, ratings, feedback);

        Response.Redirect("~/viewTRofT.aspx");
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Tour_Guide tg = new Tour_Guide(Session["username"].ToString());

        tg.setInfo();
        String tgid = tg.getTGID();

        TR_Ratings trr = new TR_Ratings();
        Booking    b   = new Booking();

        String reader = trr.getBookingID(tgid); // booking_id

        String[] readerArr = reader.Split(';');
        Array.Resize(ref readerArr, readerArr.Length - 1);

        if (readerArr.Length != 0)
        {
            int count = 0;
            for (int i = 0; i < readerArr.Length; i++)
            {
                String   booking_id     = readerArr[i];
                String   tid_tour_id    = b.getTourID_TID(booking_id);
                String[] tid_tour_idArr = tid_tour_id.Split(';'); // tid & tour_id
                Array.Resize(ref tid_tour_idArr, tid_tour_idArr.Length - 1);

                TableRow  detailsRow = new TableRow();
                TableCell tourIDCell = new TableCell();
                tourIDCell.Text = tid_tour_idArr[1].ToString(); // tour_id
                detailsRow.Cells.Add(tourIDCell);

                TableCell tidCell = new TableCell();
                tidCell.Text = tid_tour_idArr[0].ToString(); // tid
                detailsRow.Cells.Add(tidCell);

                String   feedback    = trr.getFeedback(tgid, booking_id);
                String[] feedbackArr = feedback.Split(';');
                Array.Resize(ref feedbackArr, feedbackArr.Length - 1);
                TableCell countCell = new TableCell();
                countCell.Text = feedbackArr[count];
                detailsRow.Cells.Add(countCell);

                viewFB2TRTable.Rows.Add(detailsRow);
                count += 1;
            }
        }
    }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Tour_Guide tg = new Tour_Guide(Session["username"].ToString());

        tg.setInfo();
        String tgid = tg.getTGID();

        // tourID, touristID, ratings
        // select booking_id, rating FROM TR_Ratings where TGID = tgid AND rating IS NOT NULL
        TR_Ratings trr    = new TR_Ratings();
        String     reader = trr.getBookingID_rating(tgid); // booking_id, rating

        String[] readerArr = reader.Split(';');
        Array.Resize(ref readerArr, readerArr.Length - 1);

        int loops        = readerArr.Length / 2;
        int bookingCount = 0;

        for (int i = 0; i < loops; i++)
        {
            String booking_id = readerArr[bookingCount];     // 2
            String rating     = readerArr[bookingCount + 1]; // 3

            Booking  b             = new Booking();
            String   tourID_TID    = b.getTourID_TID(booking_id); // tour_id, TID
            String[] tourID_TIDArr = tourID_TID.Split(';');
            Array.Resize(ref tourID_TIDArr, tourID_TIDArr.Length - 1);
            TableRow  detailsRow = new TableRow();
            TableCell tourIDCell = new TableCell();
            tourIDCell.Text = tourID_TIDArr[0]; // tour_id
            detailsRow.Cells.Add(tourIDCell);

            TableCell tidCell = new TableCell();
            tidCell.Text = tourID_TIDArr[1]; // tourist id
            detailsRow.Cells.Add(tidCell);

            TableCell countCell = new TableCell();
            countCell.Text = rating;
            detailsRow.Cells.Add(countCell);

            viewR2TRTable.Rows.Add(detailsRow);
            bookingCount += 2;
        }
    }