/// <summary>
 /// Create a new facility object.
 /// </summary>
 /// <param name="facilityId">Initial value of the FacilityId property.</param>
 /// <param name="facilityName">Initial value of the FacilityName property.</param>
 public static facility Createfacility(global::System.Int32 facilityId, global::System.String facilityName)
 {
     facility facility = new facility();
     facility.FacilityId = facilityId;
     facility.FacilityName = facilityName;
     return facility;
 }
Beispiel #2
0
        private void ViewFacilities_Load(object sender, EventArgs e)
        {
            sports = new SportsAllEntities();
            fac    = new facility();
            var selectAll = from x in sports.facilities orderby x.FacilityId select x;

            FacilityGrid.DataSource = selectAll.ToList();
        }
        public void display()
        {
            var      selectId = from x in sports.facilities orderby x.FacilityId descending select x;
            facility f        = selectId.First <facility>();

            txtFacilityId.Text = (f.FacilityId + 1).ToString();
            txtFacName.Text    = "";
        }
Beispiel #4
0
 private void frmBookingFacility_Load(object sender, EventArgs e)
 {
     sports = new SportsAllEntities();
     book   = new booking();
     fac    = new facility();
     svf    = new slotvsFacility();
     dateOfUseddtp.Value = DateTime.Now.AddDays(1);
 }
        public string getFacilityName(int facID)
        {
            sports = new SportsAllEntities();
            fac    = new facility();
            var SelfacilityName = from x in sports.facilities
                                  where x.FacilityId == facID
                                  select x;

            fac = SelfacilityName.First <facility>();
            return(fac.FacilityName.ToString());
        }
        private void SlotLookUpForm_Load(object sender, EventArgs e)
        {
            sports = new SportsAllEntities();
            fac    = new facility();

            var selectAll = from f in sports.facilities
                            join svsf in sports.slotvsFacilities on f.FacilityId equals svsf.FacilityId
                            where svsf.Available == "Y" && svsf.FacilityId == SelFac
                            join s in sports.slots on svsf.SlotId equals s.SlotId
                            select new { s.SlotId, s.StartTime, s.EndTime };

            SlotGrid.DataSource = selectAll.ToList();
        }
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            sports = new SportsAllEntities();
            int facId = Convert.ToInt32(txtFacilityId.Text);

            fac = new facility();
            var facilityUpdate = from x in sports.facilities
                                 where x.FacilityId == facId
                                 select x;

            fac = facilityUpdate.First <facility>();
            fac.FacilityName = txtFacName.Text;
            sports.SaveChanges();
            display();
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the facilities EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTofacilities(facility facility)
 {
     base.AddObject("facilities", facility);
 }
 private void frmFacility_Load(object sender, EventArgs e)
 {
     sports = new SportsAllEntities();
     fac    = new facility();
     svfDel = new slotvsFacility();
 }