protected void btnSubmit_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(2000); OwnerServicesClient oServ = new OwnerServicesClient(); OwnersCompany comp = new OwnersCompany() { OwnerId = Convert.ToInt32(Session["ID"]), CompanyName = txtCompName.Text, ContactNum = txtTeleNo.Text, Email = txtEmail.Text, RegNum = txtCompRegNo.Text }; string outcome = oServ.insertCompany(comp); if (outcome.Contains("Success")) { ModalPopupExtenderSuccess.Show(); System.Threading.Thread.Sleep(2000); } else if (outcome.Contains("Failed")) { ModalPopupExtenderFailed.Show(); System.Threading.Thread.Sleep(2000); } }
protected void Page_Load(object sender, EventArgs e) { string OwnrID = Session["ID"].ToString(); OwnerServicesClient ownrServClnt = new OwnerServicesClient(); List <OwnersCompany> ownrCompList = new List <OwnersCompany>(); ownrCompList = ownrServClnt.getCompByOwnerId(OwnrID); string CompanyList = ""; CompanyList += "<table class='table table-striped'>"; //CompanyList += "<caption>Accommodations</caption>"; CompanyList += "<tr>"; CompanyList += "<th>" + "Company Name"; CompanyList += "</th>"; CompanyList += "<th >" + "Company Registration Number "; CompanyList += "</th>"; CompanyList += "<th >" + "Telephone number"; CompanyList += "</th>"; CompanyList += "<th >" + "Email"; CompanyList += "</th>"; CompanyList += "<th >" + " Edit Company Details"; CompanyList += "</th>"; CompanyList += "</tr>"; foreach (OwnersCompany myCompany in ownrCompList) { CompanyList += "<tr>"; CompanyList += "<th>" + myCompany.CompanyName; CompanyList += "</th>"; CompanyList += "<td>" + myCompany.RegNum; CompanyList += "</td>"; CompanyList += "<td>" + myCompany.ContactNum; CompanyList += "</td>"; CompanyList += "<td>" + myCompany.Email; CompanyList += "</td>"; CompanyList += "<td>"; CompanyList += "<a class='btn btn-info' style='color: #000;width:80%;' href='Acc_EditCompanyDet.aspx?CompID=" + myCompany.CompId + "'>Update</a>"; CompanyList += "</td>"; CompanyList += "</tr>"; } CompanyList += "</Table>"; MyCompListDiv.InnerHtml = CompanyList; }
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; }