Beispiel #1
0
 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);
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 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);
 }
Beispiel #4
0
        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);
        }