Exemple #1
0
        private void CreateDynamicCanvas()
        {
            Rectangle = new ObservableCollection <Rectangles>();
            Rectangle = DinamiclyDrawingRepository.GetInstance().GetAllRectangles();
            Storage   = StorageRepository.GetInstance().GetAllStorage();
            RoomsInfo = new ObservableCollection <PatientsRoomVieW>(PatientsRoomConverter.ConvertRoomToPatientsRoomView(
                                                                        Backend.App.Instance().RoomService.GetAllEntitiesByType(3).ToList()));
            WorkTime = new ObservableCollection <RoomWorkTime>(WorkTimeRoomConverter.ConvertRoomToRoomWorkTime(
                                                                   Backend.App.Instance().RoomService.GetAllEntitiesByType(4).ToList()));

            foreach (Rectangles r in Rectangle)
            {
                Rectangle rect = new Rectangle()
                {
                    Fill   = r.Paint,
                    Height = r.Height,
                    Width  = r.Width,
                    Name   = r.Id
                };

                TextBlock txtb = new TextBlock()
                {
                    Width      = r.WidthText,
                    Height     = r.HeightText,
                    Text       = r.Text,
                    Background = r.Background
                };
                canvas.Children.Add(txtb);
                foreach (PatientsRoomVieW room in RoomsInfo)
                {
                    if (r.Id.Equals(room.IdOfRoom))
                    {
                        rect.MouseDown += RoomInformation;
                    }
                }

                foreach (StorageModel s in Storage)
                {
                    if (r.Id.Equals(s.IdS))
                    {
                        rect.MouseDown += StorageInfo;
                    }
                }

                foreach (RoomWorkTime s in WorkTime)
                {
                    if (r.Id.Equals(s.IdOfRoom))
                    {
                        rect.MouseDown += WorkTimeInfo;
                    }
                }

                Canvas.SetLeft(txtb, r.LeftText);
                Canvas.SetTop(txtb, r.TopText);
                Canvas.SetLeft(rect, r.Left);
                Canvas.SetTop(rect, r.Top);
                canvas.Children.Add(rect);
            }
        }
Exemple #2
0
 public DinamiclyDrawingService()
 {
     Rectangle    = new ObservableCollection <Rectangles>();
     Rectangle    = DinamiclyDrawingRepository.GetInstance().GetAllRectangles();
     GroundFloor1 = new ObservableCollection <Rectangles>();
     GroundFloor1 = GroundFloor1Repository.GetInstance().GetAllRectangles();
     GroundFloor2 = new ObservableCollection <Rectangles>();
     GroundFloor2 = GroundFloor2Repository.GetInstance().GetAllRectangles();
     FirstFloor   = new ObservableCollection <Rectangles>();
     FirstFloor   = FirstFloorRepository.GetInstance().GetAllRectangles();
 }
Exemple #3
0
        public MainWindow()
        {
            InitializeComponent();
            CreateDynamicCanvas();
            DinamiclyDrawingRepository.GetInstance();
            StorageRepository.GetInstance();
            RoomWorkTimeRepository.GetInstance();

            Login login = new Login();

            login.Show();
            this.Close();
        }
Exemple #4
0
        public MainWindow(int broj)
        {
            InitializeComponent();
            CreateDynamicCanvas();
            DinamiclyDrawingRepository.GetInstance();
            InformationEditRepository.GetInstance();
            StorageRepository.GetInstance();
            RoomWorkTimeRepository.GetInstance();
            DoctorsRoomRepository.GetInstance();

            SearchedPatientsRooms = new ObservableCollection <PatientsRoomVieW>();
            SearchedDoctorsRooms  = new ObservableCollection <DoctorRoomView>();
            SearchedAnotherRooms  = new ObservableCollection <RoomWorkTime>();

            if (Login.role == 2)
            {
                EquipmnetRadioButon.Visibility = Visibility.Hidden;
            }

            if (Login.role != 4)
            {
                Appointment.Visibility = Visibility.Hidden;
            }
        }