Пример #1
0
 public Room(TypeOfUsage typeOfUsage, int capacity, int occupation, bool renovation)
 {
     Usage      = typeOfUsage;
     Capacity   = capacity;
     Occupation = occupation;
     Renovation = renovation;
 }
        public static MergeRenovation MergeRenovationDTOToMergeRenovation(MergeRenovationDTO mergeRenovationDTO)
        {
            TypeOfUsage roomType = new TypeOfUsage();

            switch (mergeRenovationDTO.RoomType)
            {
            case TypeOfMapObject.EXAMINATION_ROOM:
                roomType = TypeOfUsage.CONSULTING_ROOM;
                break;

            case TypeOfMapObject.HOSPITALIZATION_ROOM:
                roomType = TypeOfUsage.SICKROOM;
                break;

            case TypeOfMapObject.OPERATION_ROOM:
                roomType = TypeOfUsage.OPERATION_ROOM;
                break;

            default:
                break;
            }
            return(new MergeRenovation(new RenovationPeriod(mergeRenovationDTO.baseRenovation.StartTime, mergeRenovationDTO.baseRenovation.EndTime),
                                       mergeRenovationDTO.baseRenovation.Description,
                                       mergeRenovationDTO.baseRenovation.TypeOfRenovation,
                                       mergeRenovationDTO.baseRenovation.RoomId,
                                       mergeRenovationDTO.SecondRoomId,
                                       mergeRenovationDTO.NewRoomDescription,
                                       roomType));
        }
Пример #3
0
 public Room(int number, TypeOfUsage typeOfUsage, int capacity, int occupation, bool renovation)
 {
     Number     = number;
     Usage      = typeOfUsage;
     Capacity   = capacity;
     Occupation = occupation;
     Renovation = renovation;
 }
Пример #4
0
 public MergeRenovation(RenovationPeriod renovationPeriod, string description, TypeOfRenovation typeOfRenovation,
                        int firstRoomId, int secondRoomId, string newRoomDescription, TypeOfUsage roomType)
     : base(firstRoomId, renovationPeriod, description, typeOfRenovation)
 {
     SecondRoomId       = secondRoomId;
     NewRoomDescription = newRoomDescription;
     RoomType           = roomType;
 }
Пример #5
0
 public Room(int number, TypeOfUsage typeOfUsage, int capacity, int occupation, bool renovation)
 {
     this.Number     = number;
     this.Usage      = typeOfUsage;
     this.Capacity   = capacity;
     this.Occupation = occupation;
     this.Renovation = renovation;
 }
 public DivideRenovation(RenovationPeriod renovationPeriod, string description, TypeOfRenovation typeOfRenovation,
                         int divideRoomId, string firstRoomDescription, string secondRoomDescription, TypeOfUsage firstRoomType, TypeOfUsage secondRoomType)
     : base(divideRoomId, renovationPeriod, description, typeOfRenovation)
 {
     FirstRoomDescription  = firstRoomDescription;
     SecondRoomDescription = secondRoomDescription;
     FirstRoomType         = firstRoomType;
     SecondRoomType        = secondRoomType;
 }
        public List <Room> GetRoomsByUsage(TypeOfUsage usage)
        {
            List <Room> roomList = ReadFromFile();
            List <Room> result   = new List <Room>();

            foreach (Room r in roomList)
            {
                if (r.Usage.Equals(usage))
                {
                    result.Add(r);
                }
            }
            return(result);
        }
        public static DivideRenovation DivideRenovationDTOToDivideRenovation(DivideRenovationDTO divideRenovationDTO)
        {
            TypeOfUsage firstRoomType  = new TypeOfUsage();
            TypeOfUsage secondRoomType = new TypeOfUsage();

            switch (divideRenovationDTO.FirstRoomType)
            {
            case TypeOfMapObject.EXAMINATION_ROOM:
                firstRoomType = TypeOfUsage.CONSULTING_ROOM;
                break;

            case TypeOfMapObject.HOSPITALIZATION_ROOM:
                firstRoomType = TypeOfUsage.SICKROOM;
                break;

            case TypeOfMapObject.OPERATION_ROOM:
                firstRoomType = TypeOfUsage.OPERATION_ROOM;
                break;

            default:
                break;
            }

            switch (divideRenovationDTO.SecondRoomType)
            {
            case TypeOfMapObject.EXAMINATION_ROOM:
                secondRoomType = TypeOfUsage.CONSULTING_ROOM;
                break;

            case TypeOfMapObject.HOSPITALIZATION_ROOM:
                secondRoomType = TypeOfUsage.SICKROOM;
                break;

            case TypeOfMapObject.OPERATION_ROOM:
                secondRoomType = TypeOfUsage.OPERATION_ROOM;
                break;

            default:
                break;
            }
            return(new DivideRenovation(new RenovationPeriod(divideRenovationDTO.baseRenovation.StartTime, divideRenovationDTO.baseRenovation.EndTime),
                                        divideRenovationDTO.baseRenovation.Description,
                                        divideRenovationDTO.baseRenovation.TypeOfRenovation,
                                        divideRenovationDTO.baseRenovation.RoomId,
                                        divideRenovationDTO.FirstRoomDescription,
                                        divideRenovationDTO.SecondRoomDescription,
                                        firstRoomType,
                                        secondRoomType));
        }
Пример #9
0
        private void dataDo_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            TypeOfUsage t      = TypeOfUsage.Soba_za_lezanje;
            DateTime    odDate = (DateTime)dataOd.SelectedDate;
            DateTime    doDate = (DateTime)dataDo.SelectedDate;

            List <Room> rooms       = rc.ViewRoomByUsage(t, odDate, doDate);
            List <int>  roomNumbers = new List <int>();

            foreach (Room r in rooms)
            {
                roomNumbers.Add(r.Number);
            }
            comboSoba.DataContext = roomNumbers;
        }
Пример #10
0
        public ICollection <Room> GetRoomsByUsageAndEquipment(TypeOfUsage usage, ICollection <int> requiredEquipmentTypeIds)
        {
            List <Room> allRooms = _roomRepository.GetAllRooms();

            allRooms = allRooms.FindAll(r => r.Usage == usage);

            ICollection <Room> validRooms = new List <Room>();

            foreach (Room room in allRooms)
            {
                if (CheckIfRoomHasRequiredEquipment(room.Id, requiredEquipmentTypeIds))
                {
                    validRooms.Add(room);
                }
            }

            return(validRooms);
        }
Пример #11
0
        private void txtVrsta_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            TypeOfUsage t = TypeOfUsage.Soba_za_pregled;

            if (txtVrsta.SelectedItem.ToString().Equals("Operacija"))
            {
                t = TypeOfUsage.Operaciona_sala;
            }
            else if (txtVrsta.SelectedItem.ToString().Equals("Specijalisticki"))
            {
                t = TypeOfUsage.Soba_za_pregled;
            }

            List <Room> rooms       = rc.ViewRoomByUsage(t, dt, dt);
            List <int>  roomNumbers = new List <int>();

            foreach (Room r in rooms)
            {
                roomNumbers.Add(r.Number);
            }
            txtSoba.DataContext = roomNumbers;
        }
Пример #12
0
        public List <Room> ViewRoomByUsage(TypeOfUsage usage, DateTime date)
        {
            List <Room> roomsByUsage = roomRepository.GetRoomsByUsage(usage);
            List <Room> result       = new List <Room>();

            foreach (Room r in roomsByUsage)
            {
                if (!r.Renovation)
                {
                    result.Add(r);
                }
                else
                {
                    RenovationPeriod renovationPeriod = renovationPeriodRepository.GetRenovationPeriodByRoomNumber(r.Number);
                    if (renovationPeriod != null && DateTime.Compare(date, renovationPeriod.EndDate) >= 0)
                    {
                        result.Add(r);
                    }
                }
            }
            return(result);
        }
Пример #13
0
        public List <Room> ViewRoomByUsage(TypeOfUsage usage, DateTime beginDate, DateTime endDate)
        {
            List <Room> roomsByUsage = _roomRepository.GetRoomsByUsage(usage);
            List <Room> result       = new List <Room>();

            foreach (Room r in roomsByUsage)
            {
                if (!r.Renovation)
                {
                    result.Add(r);
                }
                else
                {
                    RenovationPeriod renovationPeriod = _renovationPeriodRepository.GetRenovationPeriodByRoomNumber(r.Id);
                    int beginDateCompare = DateTime.Compare(beginDate, renovationPeriod.BeginDate);
                    int endDateCompare   = DateTime.Compare(endDate, renovationPeriod.EndDate);
                    if (renovationPeriod != null && (beginDateCompare <= 0 && endDateCompare <= 0 || beginDateCompare >= 0 && endDateCompare >= 0))
                    {
                        result.Add(r);
                    }
                }
            }
            return(result);
        }
 private ICollection <Room> GenerateRooms(TypeOfUsage typeOfUsage, ICollection <int> equipmentTypeIds)
 {
     return(_roomService.GetRoomsByUsageAndEquipment(typeOfUsage, equipmentTypeIds));
 }
Пример #15
0
 public List <Room> ViewRoomByUsage(TypeOfUsage usage, DateTime date)
 {
     return(roomService.ViewRoomByUsage(usage, date));
 }
Пример #16
0
 public List <Room> ViewRoomByUsage(TypeOfUsage usage, DateTime beginDate, DateTime endDate)
 {
     return(roomService.ViewRoomByUsage(usage, beginDate, endDate));
 }
 public List <Room> GetRoomsByUsage(TypeOfUsage usage)
 {
     return(_context.Rooms.Where(d => d.Usage == usage && !d.Renovation).ToList());
 }