public string GetRoomType() { using (HISDBEntities hs = new HISDBEntities()) { var data = (from pra in hs.RoomTypes where pra.RoomTypeID == this.RoomTypeID select pra.RoomType1).FirstOrDefault(); if (data != "" && data != null) { this.RoomTypeDisplay = data; } } return(this.RoomTypeDisplay != null ? this.RoomTypeDisplay : string.Empty); }
public string GetBedStatus() { var status = "Available"; using (HISDBEntities hs = new HISDBEntities()) { var data = (from pra in hs.PatientRoomAllocations where pra.RoomNo == this.RoomNo && pra.BedNo == this.BedNo select pra.AllocationID).Count(); if (data != 0) { status = "Occupied"; } } return(status); }
public string NextAvailbilityDateFormat() { using (HISDBEntities hs = new HISDBEntities()) { var data = (from pra in hs.PatientRoomAllocations where pra.RoomNo == this.RoomNo && pra.BedNo == this.BedNo select pra.EndDate).FirstOrDefault(); if (data.HasValue) { if (data.Value != null) { this.NextAvailbility = data.Value.AddDays(1); } } } return(this.NextAvailbility != null?this.NextAvailbility.Value.ToString("MM/dd/yyyy") : string.Empty); }
public string GetRoomStatus() { var status = "Available"; using (HISDBEntities hs = new HISDBEntities()) { var rooms = (from pra in hs.Rooms where pra.RoomNo == this.RoomNo select pra.RoomBedCapacity).FirstOrDefault(); var beds = (from pra in hs.PatientRoomAllocations where pra.RoomNo == this.RoomNo select pra.BedNo).Count(); if (rooms == beds) { status = "Occupied"; } } return(status); }