Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Message m = new Mesage();
        // String tgid, String TID, String booking_id
        //reply.Text = m.getCorrespondence();
        Tour_Guide tg = new Tour_Guide(Session["username"].ToString());

        tg.setInfo();
        String  tgid       = tg.getTGID();
        String  TID        = Session["TID"].ToString();
        String  tour_id    = Session["tourID"].ToString();
        Booking b          = new Booking();
        String  booking_id = b.getBookingIDByTID_tourID(TID, tour_id);

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

        System.Diagnostics.Debug.WriteLine("booking results " + booking_id);
        System.Diagnostics.Debug.WriteLine("TID " + TID);
        System.Diagnostics.Debug.WriteLine("tour_id " + tour_id);
        System.Diagnostics.Debug.WriteLine("booking_id " + bk_id);



        Session["booking_id"] = bk_id;

        Message m     = new Message();
        int     maxID = -1;

        //(String sender_id, String receiver_id, String booking_id, String sender_type, String receiver_type)
        maxID = m.getLatestMessageID(TID, tgid, bk_id, "TR", "TG");

        //String highestMessageID = "";
        //if (maxID.Length != 0)
        //{
        //    String[] maxIDArr = maxID.Split(';');
        //    Array.Resize(ref maxIDArr, maxIDArr.Length - 1);
        //    highestMessageID = maxIDArr[0];
        //}
        if (maxID == -1)
        {
            reply.Text = "WRONG INDEX";
        }
        else
        {
            String msg = m.getCorrespondence(maxID);
            reply.Text = msg;
            if (msg.Length != 0)
            {
                String[] msgArr = msg.Split(';');
                Array.Resize(ref msgArr, msgArr.Length - 1);
                reply.Text = msgArr[0];
            }
        }


        //reply.Text = m.getCorrespondence(tgid, TID, booking_id);
        //reply.Text = " HLELO";
    }
Esempio n. 2
0
    protected void submitMessage(object sender, EventArgs e)
    {
        Tour_Guide tg = new Tour_Guide(Session["username"].ToString());

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

        Message m   = new Message();
        String  TID = Session["TID"].ToString();

        System.Diagnostics.Debug.WriteLine(TID);
        String tour_id = Session["tourID"].ToString();

        System.Diagnostics.Debug.WriteLine(tour_id);
        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];

        DateTime dt   = DateTime.Now;
        String   date = dt.ToString("dd/MM/yyyy");
        String   msg  = TGmsg.Text;

        m.sendMessageToTR(booking_id, tour_id, tgid, TID, date, msg);
        Response.Redirect("~/viewTRList.aspx");
    }
Esempio n. 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();


        Booking b = new Booking();

        // tourID, touristID, ratings
        Tour   t        = new Tour();
        String tour_ids = t.getTourID_completed(tgid); // tourIDs under this tg

        if (tour_ids != "")
        {
            String[] tour_idsArr = tour_ids.Split(';');
            Array.Resize(ref tour_idsArr, tour_idsArr.Length - 1);

            for (int i = 0; i < tour_idsArr.Length; i++)
            {
                String tourID = tour_idsArr[i];
                String reader = b.getTourID_TID_rating(tourID); // tourid, tid, rating
                if (reader != "")
                {
                    String[] readerArr = reader.Split(';');
                    Array.Resize(ref readerArr, readerArr.Length - 1);
                    int loops = readerArr.Length / 3;
                    int count = 0;

                    for (int j = 0; j < loops; j++)
                    {
                        TableRow  detailsRow = new TableRow();
                        TableCell tourIDCell = new TableCell();
                        tourIDCell.Text = readerArr[count]; // tour_id
                        detailsRow.Cells.Add(tourIDCell);

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

                        count += 1;
                        TableCell countCell = new TableCell();
                        countCell.Text = readerArr[count]; // rating
                        detailsRow.Cells.Add(countCell);

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

        tg.setInfo();

        Tour   t      = new Tour();
        String tgid   = tg.getTGID();
        String reader = t.viewTourHistoryList(tgid); // tour id and tour name

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

        // int touristCount = tg.countTourists(readerArr[0].ToString());
        //testing1.Text = readerArr[0].ToString();
        //testing2.Text = readerArr[1].ToString();
        //testing3.Text = readerArr[2].ToString();
        //testing4.Text = readerArr[3].ToString();
        //tourtotalTR.Text = touristCount.ToString();

        Booking b                 = new Booking();
        int     loops             = readerArr.Length / 2;
        int     count             = 0;
        int     touristArrCounter = 0;

        for (int i = 0; i < loops; i++)
        {
            LinkButton s = new LinkButton();
            s.Text   = readerArr[count].ToString();
            s.Click += new EventHandler(setTourId);

            TableRow  detailsRow = new TableRow();
            TableCell tgidCell   = new TableCell();
            //tgidCell.Controls.Add(link);
            tgidCell.Controls.Add(s);

            //tgidCell.Text = readerArr[count].ToString();
            detailsRow.Cells.Add(tgidCell);

            count += 1;
            TableCell tidCell = new TableCell();
            tidCell.Text = readerArr[count].ToString();
            detailsRow.Cells.Add(tidCell);

            TableCell countCell = new TableCell();
            countCell.Text = b.countTourists(readerArr[touristArrCounter].ToString()).ToString();
            detailsRow.Cells.Add(countCell);

            TGTHistListTable.Rows.Add(detailsRow);
            count             += 1;
            touristArrCounter += 2;
        }
    }
Esempio n. 5
0
    protected void submitTour(object sender, EventArgs e)
    {
        Tour_Guide tg = new Tour_Guide(Session["username"].ToString());

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

        t.create_Tour(tgid, tourName.Text, tourCat.Text, tourCityCountry.Text, tourStartDate.Text, tourEndDate.Text, tourDesc.Text, tourPrice.Text, "Upcoming");

        Response.Redirect("~/homeTG.aspx");
    }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Tour_Guide tg = new Tour_Guide(Session["username"].ToString());

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

        // select tourid from tour where tgid = tgid and status = completed --TOUR TABLE
        Tour   t      = new Tour();
        String reader = t.getTourID_completed(tgid);

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

        Booking b = new Booking();

        for (int i = 0; i < readerArr.Length; i++)
        {
            int    count  = 0;
            String tourID = readerArr[i];
            String tourID_TID_feedback = b.getTourID_TID_feedback(tourID); // tourid, touristid, feedback --BOOKING TABLE
            if (tourID_TID_feedback != "")
            {
                String[] tourID_TID_feedbackArr = tourID_TID_feedback.Split(';');
                Array.Resize(ref tourID_TID_feedbackArr, tourID_TID_feedbackArr.Length - 1);

                int loops = tourID_TID_feedbackArr.Length / 3;
                for (int j = 0; j < loops; j++)
                {
                    TableRow  detailsRow = new TableRow();
                    TableCell tourIDCell = new TableCell();
                    tourIDCell.Text = tourID_TID_feedbackArr[count].ToString();
                    detailsRow.Cells.Add(tourIDCell);

                    count += 1;

                    TableCell tidCell = new TableCell();
                    tidCell.Text = tourID_TID_feedbackArr[count].ToString();
                    detailsRow.Cells.Add(tidCell);

                    count += 1;

                    TableCell countCell = new TableCell();
                    countCell.Text = tourID_TID_feedbackArr[count].ToString();
                    detailsRow.Cells.Add(countCell);

                    viewFBFTRTable.Rows.Add(detailsRow);
                    count += 1;
                }
            }
        }
    }
Esempio n. 7
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");
    }
Esempio n. 8
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;
            }
        }
    }
Esempio n. 9
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;
        }
    }
Esempio n. 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Tour_Guide tg = new Tour_Guide(Session["username"].ToString());

        tg.setInfo();

        tourID.Text = Session["tourID"].ToString();
        String tgid = tg.getTGID();

        String TID = Session["tourID"].ToString();

        Tour   t      = new Tour();
        String reader = t.ViewTourInfo(TID);

        String[] readerArr = reader.Split(';');

        var startDate = Convert.ToDateTime(readerArr[0].ToString()).Date;

        tourStartDate.Text = startDate.ToString("dd/MM/yyyy");

        var endDate = Convert.ToDateTime(readerArr[1].ToString()).Date;

        tourEndDate.Text = endDate.ToString("dd/MM/yyyy");


        int days = (int)(endDate - startDate).TotalDays;

        tourDuration.Text = days.ToString();
        tourStatus.Text   = readerArr[2].ToString();

        tourName.Text = readerArr[3].ToString();

        tourDesc.Text = readerArr[4].ToString();

        categoryText.Text = readerArr[5].ToString();

        tourCityCountry.Text = readerArr[6].ToString();
    }
Esempio n. 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Tour_Guide tg = new Tour_Guide(Session["username"].ToString());

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

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


        int tuple_length = readerArr.Length + 1;
        int loops        = tuple_length / 3;

        int count = 0;

        for (int i = 0; i < loops; i++)
        {
            //HyperLink link = new HyperLink();
            //String hyperlink = "~/viewUpTourList.aspx";
            //link.NavigateUrl = hyperlink;
            //link.Text = readerArr[count].ToString();
            //link.Attributes.Add("onclick", "setTourId");
            LinkButton s = new LinkButton();
            s.Text   = readerArr[count].ToString();
            s.Click += new EventHandler(setTourId);

            TableRow  detailsRow = new TableRow();
            TableCell tgidCell   = new TableCell();
            //tgidCell.Controls.Add(link);
            tgidCell.Controls.Add(s);

            //tgidCell.Text = readerArr[count].ToString();
            detailsRow.Cells.Add(tgidCell);

            count += 1;
            TableCell tidCell = new TableCell();
            tidCell.Text = readerArr[count].ToString();
            detailsRow.Cells.Add(tidCell);

            count += 1;
            TableCell userCell = new TableCell();
            userCell.Text = readerArr[count].ToString();
            detailsRow.Cells.Add(userCell);

            TGUpTourListTable.Rows.Add(detailsRow);
            count += 1;
        }

        /*
         * for (int i = 0; i < 3; i++)
         * {
         *  TableRow detailsRow = new TableRow();
         *  TableCell tgidCell = new TableCell();
         *  tgidCell.Text = readerArr[i].ToString();
         *  detailsRow.Cells.Add(tgidCell);
         *
         *  //count += 1;
         *  TableCell tidCell = new TableCell();
         *  tidCell.Text = readerArr[i].ToString();
         *  detailsRow.Cells.Add(tidCell);
         *
         *  //count += 1;
         *  TableCell userCell = new TableCell();
         *  userCell.Text = readerArr[i].ToString();
         *  detailsRow.Cells.Add(userCell);
         *
         *  TGUpTourListTable.Rows.Add(detailsRow);
         *  //count = 0;
         * }*/
    }