예제 #1
0
파일: Room.cs 프로젝트: girishrebba/his
 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);
 }
예제 #2
0
파일: Bed.cs 프로젝트: girishrebba/his
        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);
        }
예제 #3
0
파일: Bed.cs 프로젝트: girishrebba/his
 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);
 }
예제 #4
0
파일: Room.cs 프로젝트: girishrebba/his
        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);
        }