protected void Page_Load(object sender, EventArgs e)
        {
            offServ      = new OfficerServicesClient();
            OfficerId    = Request.QueryString["OffID"].ToString();
            AccoId       = Convert.ToInt32(Request.QueryString["AccommID"]);
            assgnOfficer = offServ.getOffficerById(OfficerId);
            AccommoServicesClient accServ = new AccommoServicesClient();
            Accommodation         acc     = accServ.getAccommoFullInfoById(AccoId.ToString());


            //Accommodation
            lblAccName.Text    = acc.AccommoName;
            lblAccAddress.Text = acc.AccommoAddress.Street + " " + acc.AccommoAddress.Town + " " + acc.AccommoAddress.Town;


            //Officer
            lblNameSurname.Text = assgnOfficer.Surname + " " + assgnOfficer.Name;
            lblTele.Text        = assgnOfficer.ContactNumber;
            lblEmail.Text       = assgnOfficer.Email;
            if (assgnOfficer.CampusId == 2)
            {
                lblCampus.Text = "APK";
            }
            else if (assgnOfficer.CampusId == 3)
            {
                lblCampus.Text = "APB";
            }
            else if (assgnOfficer.CampusId == 4)
            {
                lblCampus.Text = "DFC";
            }
            else if (assgnOfficer.CampusId == 5)
            {
                lblCampus.Text = "SWC";
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OwnrID = Session["ID"].ToString();

            BookingsServicesClient bookservClnt = new BookingsServicesClient();

            OwnerServicesClient OwnerServClnt = new OwnerServicesClient();

            string AccommodationsList = "";

            AccommoServicesClient accServClnt = new AccommoServicesClient();

            List <Accommodation> MyAccommoList = new List <Accommodation>();

            MyAccommoList = accServClnt.getAccommoByOwnerId(OwnrID.ToString());


            AccommodationsList += "<table class='table table-striped'>";
            //AccommodationsList += "<caption>Accommodations</caption>";
            AccommodationsList += "<tr>";

            AccommodationsList += "<th>" + "Accommodation Name";
            AccommodationsList += "</th>";

            //AccommodationsList += "<th >" + "Address";
            //AccommodationsList += "</th>";

            AccommodationsList += "<th >" + "Capacity ";
            AccommodationsList += "</th>";

            AccommodationsList += "<th >" + "Number of Bookings";
            AccommodationsList += "</th>";

            AccommodationsList += "<th >" + "Remaining Space";
            AccommodationsList += "</th>";

            AccommodationsList += "<th >" + " View Move In Requests";
            AccommodationsList += "</th>";

            AccommodationsList += "<th >" + " View All Bookings";
            AccommodationsList += "</th>";


            AccommodationsList += "</tr>";


            foreach (Accommodation myAccommmo in MyAccommoList)
            {
                int NumBookings = bookservClnt.getNumBookingsByAccommo(myAccommmo.AccommoID.ToString());
                int Remaining   = myAccommmo.Capacity - NumBookings;

                AccommodationsList += "<tr>";

                AccommodationsList += "<th>" + myAccommmo.AccommoName;
                AccommodationsList += "</th>";

                //AccommodationsList += "<td>" + myAccommmo.AccommoAddress.Street + " " + myAccommmo.AccommoAddress.Town + " " + myAccommmo.AccommoAddress.City;
                //AccommodationsList += "</td>";

                AccommodationsList += "<td>" + myAccommmo.Capacity;
                AccommodationsList += "</td>";

                AccommodationsList += "<td>" + NumBookings;
                AccommodationsList += "</td>";

                AccommodationsList += "<td>" + Remaining;
                AccommodationsList += "</td>";

                AccommodationsList += "<td>";
                AccommodationsList += "<a class='btn btn-info' style='color: #000;width:80%;' href='Acc_ViewIndiviAccMoveInReq.aspx?AccommID=" + myAccommmo.AccommoID + "'>View</a>";
                AccommodationsList += "</td>";

                AccommodationsList += "<td>";
                AccommodationsList += "<a class='btn btn-info' style='color: #000;width:80%;' href='Acc_ViewIndiviAccommoBookings.aspx?AccommID=" + myAccommmo.AccommoID + "'>View</a>";
                AccommodationsList += "</td>";

                AccommodationsList += "</tr>";
            }
            AccommodationsList += "</Table>";

            AccommoBookingsDiv.InnerHtml = AccommodationsList;
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string AccommoId = Request.QueryString["AccommID"];

            Session.Add("AccommodationId", AccommoId);
            AccommoServicesClient     accServClnt = new AccommoServicesClient();
            FileUploadsServicesClient imagesClnt  = new FileUploadsServicesClient();
            Accommodation             accommo     = new Accommodation();
            ImageFile imageMain = new ImageFile();

            imageMain = imagesClnt.getMainImageByAccommoId(AccommoId);
            accommo   = accServClnt.getAccommoFullInfoById(AccommoId);

            //View Accommo as student
            String strRef = null;

            strRef            += "<a class='btn btn-info' style='color: #000' href='ViewIndividualAccommodation.aspx?AccommID=" + accommo.AccommoID + "'>View As Student</a>";
            ahrefdiv.InnerHtml = strRef;


            txtNumBathrooms.Text = (accommo.AccommoDetails.NumBathrooms).ToString();
            txtNumSharing.Text   = (accommo.AccommoDetails.NumTwoSharingRooms + accommo.AccommoDetails.NumSharingEnsuite).ToString();
            txtNumSingles.Text   = (accommo.AccommoDetails.NumSingleRooms + accommo.AccommoDetails.NumSingleEnsuite).ToString();
            //txtNumSinglEnS.Text = accommo.AccommoDetails.NumSingleEnsuite.ToString();
            //txtNumSharEnS.Text = accommo.AccommoDetails.NumSharingEnsuite.ToString();
            CalcTotalCapacity();
            txtCapacity.Text = total.ToString();

            txtPricSharing.Text         = accommo.AccommoDetails.RentSharing.ToString();
            txtPricSingle.Text          = accommo.AccommoDetails.RentSingle.ToString();
            drpGender.SelectedItem.Text = accommo.AccommoDetails.GenderAllowed;

            //ProfileImage
            if (imageMain == null)
            {
            }
            if (imageMain != null)
            {
                imgMainPic.ImageUrl = "Accommodations/" + AccommoId + "/Accomm_Images/" + imageMain.ImageName;
            }

            //Features
            if (accommo.AccommoDetails.Gym == 1)
            {
                Gym.Checked = true;
            }
            else
            {
                Gym.Checked = false;
            }
            if (accommo.AccommoDetails.CleaningService == 1)
            {
                Cleaning.Checked = true;
            }
            else
            {
                Cleaning.Checked = false;
            }
            if (accommo.AccommoDetails.WashingMachine == 1)
            {
                Laundry.Checked = true;
            }
            else
            {
                Laundry.Checked = false;
            }
            if (accommo.AccommoDetails.ParkingPort == 1)
            {
                Parking.Checked = true;
            }
            else
            {
                Parking.Checked = false;
            }
            if (accommo.AccommoDetails.WiFi == 1)
            {
                Wifi.Checked = true;
            }
            else
            {
                Wifi.Checked = false;
            }
            if (accommo.AccommoDetails.DSTV == 1)
            {
                TvArea.Checked = true;
            }
            else
            {
                TvArea.Checked = false;
            }
            if (accommo.AccommoDetails.EntertainmentArea == 1)
            {
                EntArea.Checked = true;
            }
            else
            {
                EntArea.Checked = false;
            }
            if (accommo.AccommoDetails.DedicatedStudyArea == 1)
            {
                StudyArea.Checked = true;
            }
            else
            {
                StudyArea.Checked = false;
            }
            if (accommo.AccommoDetails.TransportShuttle == 1)
            {
                TransServ.Checked = true;
            }
            else
            {
                TransServ.Checked = false;
            }
        }
Beispiel #4
0
        protected void btnSaveChanges_Click(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(2000);

            AccommoServicesClient   accServ    = new AccommoServicesClient();
            AccommodationAddDetails addDetails = new AccommodationAddDetails();

            //AddDetails
            addDetails.NumSingleRooms     = Convert.ToInt32(txtNumSingles.Text);
            addDetails.NumTwoSharingRooms = Convert.ToInt32(txtNumSharing.Text);
            addDetails.NumBathrooms       = Convert.ToInt32(txtNumBathrooms.Text);
            addDetails.RentSingle         = Convert.ToDouble(txtPricSingle.Text);
            addDetails.RentSharing        = Convert.ToDouble(txtPricSharing.Text);
            addDetails.GenderAllowed      = drpGender.SelectedItem.Text;

            //Features
            if (Gym.Checked)
            {
                addDetails.Gym = 1;
            }
            else
            {
                addDetails.Gym = 0;
            }
            if (Cleaning.Checked)
            {
                addDetails.CleaningService = 1;
            }
            else
            {
                addDetails.CleaningService = 0;
            }
            if (Laundry.Checked)
            {
                addDetails.WashingMachine = 1;
            }
            else
            {
                addDetails.WashingMachine = 0;
            }
            if (Parking.Checked)
            {
                addDetails.ParkingPort = 1;
            }
            else
            {
                addDetails.ParkingPort = 0;
            }
            if (Wifi.Checked)
            {
                addDetails.WiFi = 1;
            }
            else
            {
                addDetails.WiFi = 0;
            }
            if (TvArea.Checked)
            {
                addDetails.DSTV = 1;
            }
            else
            {
                addDetails.DSTV = 0;
            }
            if (EntArea.Checked)
            {
                addDetails.EntertainmentArea = 1;
            }
            else
            {
                addDetails.EntertainmentArea = 0;
            }
            if (StudyArea.Checked)
            {
                addDetails.DedicatedStudyArea = 1;
            }
            else
            {
                addDetails.DedicatedStudyArea = 0;
            }
            if (TransServ.Checked)
            {
                addDetails.TransportShuttle = 1;
            }
            else
            {
                addDetails.TransportShuttle = 0;
            }
            AccommodationAddDetails outcome = new AccommodationAddDetails();

            outcome = accServ.updateAccommoAddDetails(Request.QueryString["AccommID"], addDetails);
            if (outcome != null)
            {
                ModalPopupExtenderSuccess.Show();
                System.Threading.Thread.Sleep(2000);
            }
            else if (outcome == null)
            {
                ModalPopupExtenderFailed.Show();
                System.Threading.Thread.Sleep(2000);
            }
        }