Ejemplo n.º 1
0
        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/>";
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string s = Request.Params.Get("BookingId");

            ViewState.Add("Id", s);
            s = Request.Params.Get("EquipmentCode");
            s = "Not able to book " + s + " as is already booked for this period. ";
            string         s1 = Request.Params.Get("ClashedBookingId");
            PhysicsBooking b  = new PhysicsBooking(); b.Load(s1);
            Utility        u  = new Utility();

            s += "Booked by :" + u.Get_StaffCodefromStaffID(b.StaffId);
            ServerContent.InnerHtml = s;
        }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         PhysicsBooking phb1 = new PhysicsBooking();
         string         s    = Request.Params.Get("BookingId");
         if (s != null)
         {
             phb1.Load(s);
         }
         else
         {
             Utility u = new Utility();
             phb1.DayId    = System.Convert.ToInt16(Request.Params.Get("Day"));
             phb1.StaffId  = new Guid(u.Get_StaffID(Request.Params.Get("Staff")));
             phb1.Date     = System.Convert.ToDateTime(Request.Params.Get("Date"));//this is week beginning...
             phb1.Date     = phb1.Date.AddDays(phb1.DayId);
             phb1.PeriodId = u.Get_PeriodId_fromcode(Request.Params.Get("Period"));
             phb1.RoomId   = u.Get_RoomId_fromCode(Request.Params.Get("Room"));
             Group g1 = new Group(); g1.Load(Request.Params.Get("Group"), phb1.Date);
             phb1.GroupId = g1._GroupID;
             s            = Request.Params.Get("Group");
             if (s.StartsWith("10") || s.StartsWith("11"))
             {
                 RadioButtonList1.SelectedIndex = 1;
             }
             if (s.StartsWith("12") || s.StartsWith("13"))
             {
                 RadioButtonList1.SelectedIndex = 2;
             }
             if (s.StartsWith("7") || s.StartsWith("8") || s.StartsWith("9"))
             {
                 RadioButtonList1.SelectedIndex = 0;
             }
         }
         DayList dlist1 = new DayList();
         s = dlist1.FindDayName_fromId(phb1.DayId);
         servercontent.InnerHtml = "<h3>Booking for " + s + " Period " + Request.Params.Get("Period") + " for Group " + Request.Params.Get("Group") + " and Room " + Request.Params.Get("Room") + "</h3>";
         if (phb1.FindBooking())
         {
             Add_Controls(phb1); TextBox_Notes.Text = phb1.Notes;
         }
         ViewState.Add("PhysicsBooking", phb1);
         PhysicsEquipmentItemList list1 = new PhysicsEquipmentItemList();
         list1.LoadList_All();
         foreach (PhysicsEquipmentItem p in list1.m_list)
         {
             ListItem l = new ListItem(p.EquipmentItemCode, p.EquipmentItemId.ToString());
             DropDownList_Items.Items.Add(l);
         }
         UpdateExptList();
         //find previous booking???
         Label2.Visible = false; TextBox_last.Visible = false; Button_AddLast.Visible = false;
         PhysicsBooking     phb2  = new PhysicsBooking(); //for last booking for this group
         PhysicsBookingList list2 = new PhysicsBookingList();
         list2.LoadList_Group(phb1.GroupId);              //these are ordered with lates first...
         foreach (PhysicsBooking b in list2.m_list)
         {
             if (b.Date < phb1.Date)
             {
                 Label2.Visible = true; TextBox_last.Visible = true; Button_AddLast.Visible = true;
                 PhysicsEquipmentItemList list3 = new PhysicsEquipmentItemList();
                 list3.LoadList(b); TextBox_last.Text = "";
                 foreach (PhysicsEquipmentItem i in list3.m_list)
                 {
                     TextBox_last.Text += i.EquipmentItemCode + Environment.NewLine;
                 }
                 ViewState.Add("LastBooking", b);
                 break;
             }
         }
     }
     else
     {
         PhysicsBooking b2 = (PhysicsBooking)ViewState["PhysicsBooking"];
         Add_Controls(b2);
     }
 }