protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { PhysicsBooking pb1 = new PhysicsBooking(); string s = Request.UrlReferrer.OriginalString; ViewState.Add("booking", pb1); ViewState.Add("ref", s); pb1.Load(Request.Params.Get("Id")); SimpleStaff staff1 = new SimpleStaff(pb1.StaffId); SimpleRoom room1 = new SimpleRoom(pb1.RoomId); Period p1 = new Period(pb1.PeriodId); s = "<h3>Booking for " + pb1.Date.ToShortDateString() + " " + p1.m_periodname; s += "<br/>Staff: " + staff1.m_StaffCode + " Room: " + room1.m_roomcode + "</br>"; s += "<p align=\"center\"><TABLE BORDER class= \"ResultsTbl\" ><TR><TD>Item</TD><TD>Location</TD></tr> "; PhysicsEquipmentItemList list1 = new PhysicsEquipmentItemList(); list1.LoadList(pb1); foreach (PhysicsEquipmentItem i in list1.m_list) { s += "<tr><td>" + i.EquipmentItemCode + "</td><td>" + i.EquipmentItemLocation + "</td></tr>"; } s += "</table>"; servercontent.InnerHtml = s + "<br/>Notes:<br/>" + pb1.Notes + "<br/>"; } }
private void Display() { if (NameList.SelectedItem == null) { return; } string Name = NameList.SelectedItem.Text; string Id = NameList.SelectedItem.Value; GroupIncidentControl1.GroupCode = ""; GroupIncidentControl1.StaffCode = Id; TimetableControl1.BaseId = new Guid(NameList.SelectedValue); if (Type == "staff") { TimetableControl1.type = TT_writer.TimetableType.Staff; } if (Type == "room") { TimetableControl1.type = TT_writer.TimetableType.Room; } TimetableControl1.Visible = Display_List.Items.FindByValue("Timetable").Selected; GroupIncidentControl1.Visible = Display_List.Items.FindByValue("Incidents Authored by").Selected; if (Display_List.Items.FindByValue("Details").Selected) { bool See_Private = false; Utility u = new Utility(); if (u.CheckStaffInConfigGroup(Context, "StaffDetailsAccess")) { See_Private = true; } SimpleStaff s1 = new SimpleStaff(TimetableControl1.BaseId); string s = s1.m_PersonId.ToString(); PersonDetails p1 = new PersonDetails(s); s = "<H2>" + p1.m_Title + " " + p1.m_GivenName + " " + p1.m_Surname + "</h2>"; ContactList cl1 = new ContactList(); cl1.LoadList(s1.m_PersonId.ToString()); foreach (Contact c in cl1.m_contactlist) { if ((!c.m_Contact_Private) || (See_Private)) { s += "<h3>" + c.m_ContactType + " : " + c.m_Contact_Value + "<br></h3>"; } } if (See_Private) { s += "<p>Address : " + p1.m_address + "</p>"; s += "<p>doB: " + p1.m_dob.ToShortDateString() + "</p>"; } content0.InnerHtml = s; } else { content0.InnerHtml = ""; } }
private void UpdateDisplay() { string[, ,] grid = new string[6, 30, 2]; int j1; for (int i = 0; i < 6; i++) { for (int j = 0; j < 30; j++) { grid[i, j, 0] = ""; } } //setup for 5 P labs.... grid[0, 0, 0] = "P1"; grid[0, 1, 0] = "P2"; grid[0, 2, 0] = "P3"; grid[0, 3, 0] = "P4"; grid[0, 4, 0] = "P5"; int n_rows = 5; string s = ""; s = "<div><h3>Bookings for " + Calendar1.SelectedDate.ToShortDateString() + "</h3></div>"; s += "<p align=\"center\"><TABLE BORDER class= \"ResultsTbl\" ><TR><TD>Room</TD> "; s += "<TD>Period 1</TD><TD>Period 2</TD><TD>Period 3</TD><TD>Period 4</TD><TD>Period 5</TD></tr>"; PhysicsBookingList pblist1 = new PhysicsBookingList(); pblist1.LoadList_Date(Calendar1.SelectedDate); if (pblist1.m_list.Count > 0) { foreach (PhysicsBooking p in pblist1.m_list) { SimpleRoom room1 = new SimpleRoom(p.RoomId); Period p1 = new Period(p.PeriodId); int p2 = System.Convert.ToInt32(p1.m_periodcode); SimpleStaff s1 = new SimpleStaff(p.StaffId); j1 = -1; for (int j = 0; j < n_rows; j++) { if (grid[0, j, 0] == room1.m_roomcode.Trim()) { j1 = j; break; } } if (j1 == -1) { grid[0, n_rows, 0] = room1.m_roomcode.Trim(); j1 = n_rows; n_rows++; } grid[p2, j1, 0] = s1.m_StaffCode + ":<br/>"; grid[p2, j1, 1] = p.BookingId.ToString(); PhysicsEquipmentItemList ff = new PhysicsEquipmentItemList(); ff.LoadList(p); foreach (PhysicsEquipmentItem i in ff.m_list) { grid[p2, j1, 0] += i.EquipmentItemCode + ", "; } } for (int j = 0; j < n_rows; j++) { s += "<tr>"; for (int i = 0; i < 6; i++) { s += "<td>"; if (grid[i, j, 0] == "") { } else { if (i != 0) { s += "<A HREF=\"DisplayBooking.aspx?Id=" + grid[i, j, 1] + " \">Booking</A>"; s += "<br/>staff: "; } s += grid[i, j, 0] + "<br/>"; } s += "</td>"; } s += "</tr>"; } s += "</table><br/>"; } else { s += "</table><br/>No Bookings on this date<br/>"; } s += "</table>"; servercontent.InnerHtml = s; }