Example #1
0
 public static void UpdateFacility(User user, string venue, Faculties faculty, string loc,
     string bookingCon, string techCon, int cap, RoomType rtype, bool hasWebcast, bool hasFlexiSeat,
     bool hasVidConf, bool hasMIC, bool hasProjector, bool hasVisualizer)
 {
     if (!user.isFacilityAdmin)
     {
         throw new FaultException<SException>(new SException(),
            new FaultReason("Invalid User, User Does Not Have Rights To Remove Facility!"));
     }
     DAL dalDataContext = new DAL();
     Facility f = (from faci in dalDataContext.Facilities
                   where faci.FacilityID == venue && faci.Faculty == faculty
                   select faci).FirstOrDefault();
     if (f == null)
     {
         Table<Facility> facs = dalDataContext.Facilities;
         Facility fac = new Facility(venue, faculty, loc, bookingCon, techCon, cap, rtype,
             hasWebcast, hasFlexiSeat, hasVidConf, hasMIC, hasProjector, hasVisualizer);
         facs.InsertOnSubmit(fac);
         facs.Context.SubmitChanges();
     }
     else
     {
         f.Capacity = cap;
         f.BookingContact = bookingCon;
         f.Location = loc;
         f.TechContact = techCon;
         //V0.3 Additional Fields
         f.HasflexibleSeating = hasFlexiSeat;
         f.HasMicrophone = hasMIC;
         f.HasProjector = hasProjector;
         f.HasVideoConferencing = hasVidConf;
         f.HasVisualizer = hasVisualizer;
         f.HasWebCast = hasWebcast;
         f.RoomType = rtype;
         dalDataContext.SubmitChanges();
     }
 }
 public frmViewFacilityDetail(Window w, Facility fac)
     : this()
 {
     this.fac = fac;
     this.mainFrame = w;
 }