Пример #1
0
        public CreateMessage(Data userData, Patient patient, List<Professional> recievers, string title, string content)
        {
            _userData = userData;
            _patient = patient;

            MultibleButtonView button = new MultibleButtonView(_userData);

            button.DocumentsIsDisable();
            button.FollowButton.Clicked += FollowButtonClicked;
            button.ProfilButton.Clicked += ProfilButtonClicked;

            Label message = new Label
            {
                Text = "Creation de message",
                FontSize = 50,
                VerticalOptions = LayoutOptions.Start,
                TextColor = Color.Gray
            };
            
            _title = new Entry
            {
                Placeholder = "Titre du message",
                FontSize = 40,
                HorizontalTextAlignment = TextAlignment.Center,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.Center,
            };
            _title.TextChanged += EntryTextChanged;

            _content = new Editor
            {
                FontSize = 20,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand,
            };
            _content.TextChanged += Content_TextChanged;
			Initiliaze(title, content, recievers);
			Label recivers = new Label
			{
				Text = "À : " + _recievers.Count.ToString() + " personnes",
				FontSize = 40,
				VerticalOptions = LayoutOptions.Start,
				TextColor = Color.Gray
			};
			Button add = new Button
			{
				Text = "+",
				FontSize = 40,
				BackgroundColor = Color.FromHex("439DFE"),
			};
			add.Clicked += Add_Clicked;
			StackLayout addRecieverStack = new StackLayout
			{

				Children = {
					recivers,
					add,
				},
				Orientation = StackOrientation.Horizontal,
				HorizontalOptions = LayoutOptions.Start

			};
            Button create = new Button
            {
                Text = "Envoyer",
                FontSize = 40,
                BackgroundColor = Color.FromHex("439DFE"),
                VerticalOptions = LayoutOptions.End
            };
            create.Clicked += Create_Clicked;

            Button back = new Button
            {
                Text = "retour au message",
                FontSize = 40,
                BackgroundColor = Color.FromHex("439DFE"),
                VerticalOptions = LayoutOptions.End
            };
            back.Clicked += Back_Clicked;

            Content = new StackLayout
            {

                Children = {
                    button.Content,
                    message,
                    _title,
                    addRecieverStack,
                    _content,
                    create,
                    back
                },
            };
            this.BackgroundColor = Color.White;
        }
Пример #2
0
        public CreatePrescription(Data userData, Patient patient, List<Professional> recievers, string title, string docPath)
        {
            _userData = userData;
            _patient = patient;
			if (recievers != null)
				_recievers = recievers;
			else
				_recievers = new List<Professional>();
            _docpath = docPath;
            _cameraview = new CameraViewModel();
            MultibleButtonView button = new MultibleButtonView(_userData);

            button.DocumentsIsDisable();
            button.FollowButton.Clicked += FollowButtonClicked;
            button.ProfilButton.Clicked += ProfilButtonClicked;

            Label prescription = new Label
            {
                Text = "Creation de Prescription",
                FontSize = 50,
                VerticalOptions = LayoutOptions.Start,
                TextColor = Color.Gray
            };
            Label recivers = new Label
            {
                Text = "À : " + _recievers.Count.ToString() + " personnes",
                FontSize = 40,
                VerticalOptions = LayoutOptions.Start,
                TextColor = Color.Gray
            };
            Button add = new Button
            {
                Text = "+",
                FontSize = 40,
                BackgroundColor = Color.FromHex("439DFE"),
            };
            add.Clicked += Add_Clicked;
            StackLayout addRecieverStack = new StackLayout
            {

                Children = {
                    recivers,
                    add,
                },
                Orientation = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.Start

            };
            _title = new Entry
            {
                Placeholder = "Titre de la prescription",
                FontSize = 40,
                HorizontalTextAlignment = TextAlignment.Center,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.Center,
            };
            _title.TextChanged += EntryTextChanged;

            _takePhoto = new Button
            {
                Text = "Prendre une photo",
				BackgroundColor = Color.FromHex("439DFE"),
                FontSize = 25,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand,
            };
            _takePhoto.Clicked += Content_Clicked;
            _choosePhoto = new Button
            {
                Text = "Choisir une image éxistante",
				BackgroundColor = Color.FromHex("439DFE"),
                FontSize = 25,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand,
            };
            _choosePhoto.Clicked += _choosePhoto_Clicked;
            StackLayout takePhotoStack = new StackLayout
            {

                Children = {
                    _takePhoto,
                    _choosePhoto,
                },
                Orientation = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.Start

            };

            Button create = new Button
            {
                Text = "Envoyer",
                FontSize = 40,
                BackgroundColor = Color.FromHex("439DFE"),
                VerticalOptions = LayoutOptions.End
            };
            create.Clicked += Create_Clicked;

            Button back = new Button
            {
                Text = "Retour aux prescriptions",
                FontSize = 40,
                BackgroundColor = Color.FromHex("439DFE"),
                VerticalOptions = LayoutOptions.End
            };
            back.Clicked += Back_Clicked;
			Initiliaze(title, docPath);

            Content = new StackLayout
            {

                Children = {
                    button.Content,
                    prescription,
                    _title,
                    addRecieverStack,
                    takePhotoStack,
                    _photo,
                    create,
                    back
                },
            };
            this.BackgroundColor = Color.White;
        }
Пример #3
0
        public MessagePage(Data userData, Message message)
        {
            _userData = userData;
            _message = message;

            MultibleButtonView button = new MultibleButtonView(_userData);

            button.DocumentsIsDisable();
            button.FollowButton.Clicked += FollowButtonClicked;
            button.ProfilButton.Clicked += ProfilButtonClicked;

            Label messageLabel = new Label()
            {
                Text = "Message",
                FontSize = 40,
                TextColor = Color.Gray,
				HorizontalOptions = LayoutOptions.Center,
            };

            Label titleLabel = new Label()
            {
                Text = "Titre : " + _message.Title,
                FontSize = 40,
                TextColor = Color.Gray,
				HorizontalOptions = LayoutOptions.StartAndExpand,
            };

            Label senderLabel = new Label()
            {
                Text = "De : " + _message.SenderName,
                FontSize = 40,
                TextColor = Color.Gray,
				HorizontalOptions = LayoutOptions.StartAndExpand,
            };

            Label ContentLabel = new Label()
            {
                Text = _message.Contents,
                FontSize = 30,
                TextColor = Color.Gray,
                VerticalOptions = LayoutOptions.CenterAndExpand,
				HorizontalOptions = LayoutOptions.CenterAndExpand
            };

            Label recieversLabel = new Label()
            {
                Text = "À : " + _message.Recievers.Count + " personne(s)",
                FontSize = 40,
                TextColor = Color.Gray,
				HorizontalOptions = LayoutOptions.StartAndExpand,
            };

			Label patientLabel = new Label () {
				Text = "À propos de : " + _message.PatientFullName,
				FontSize = 40,
				TextColor = Color.Gray,
				HorizontalOptions = LayoutOptions.StartAndExpand,
			};

            Label dateLabel = new Label()
            {
                Text = "Date : " + _message.Date.ToString(),
                FontSize = 40,
                TextColor = Color.Gray,
				HorizontalOptions = LayoutOptions.StartAndExpand,
            };

            Button returnButton = new Button()
            {
                Text = "Retour à mes messages",
                FontSize = 40,
                BackgroundColor = Color.FromHex("439DFE"),
                VerticalOptions = LayoutOptions.End
            };
            returnButton.Clicked += ReturnButton_Clicked;

            Content = new StackLayout
            {
                Children =
                {
                    button.Content,
                    messageLabel,
                    titleLabel,
                    senderLabel,
                    recieversLabel,
					patientLabel,
                    dateLabel,
                    ContentLabel,
                    returnButton
                }
            };
            this.BackgroundColor = Color.White;
        }
Пример #4
0
        public AddReciverPage(Data userData, Patient patient, List<Professional> recievers, string title, string content, bool message)
        {
            _userData = userData;
            _patient = patient;
            _message = message;
            Initiliaze(title, content, recievers);
            imageTapped.Tapped += Image_Taped;
            AbsoluteLayout photoLayout = new AbsoluteLayout
            {
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            MultibleButtonView button = new MultibleButtonView(_userData);

            button.DocumentsIsDisable();
            button.FollowButton.Clicked += FollowButtonClicked;
            button.ProfilButton.Clicked += ProfilButtonClicked;

            Image patientImage = new Image
            {
                Source = patient.Photo,
                Scale = 0.75
            };
            AbsoluteLayout.SetLayoutFlags(patientImage, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(patientImage, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            photoLayout.Children.Add(patientImage);

            Button backMessage = new Button
            {
                Text = "Retour aux messages",
                FontSize = 23,
                BackgroundColor = Color.FromHex("439DFE"),
            };
            if (!_message)
            {
                backMessage.Text = "Retour à la prescription";
            }
            backMessage.Clicked += BackMessage_Clicked;

            AbsoluteLayout.SetLayoutFlags(backMessage, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(backMessage, new Rectangle(0, 1, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            photoLayout.Children.Add(backMessage);

            Image[] proImage = new Image[10];
            professionals = ProfessionalArray();
            double X = 0.5;
            double Y = 0.0;
            for (int i = 0; i < 3; i++)
            {
                proImage[i] = new Image();
                if (professionals[i] != null)
                {
                    Stream s = new MemoryStream(DependencyService.Get<IBytesSaveAndLoad>().LoadByteArray(professionals[i].Photo), true);
                    proImage[i].Scale = 0.75;
                    proImage[i] = InitializePhoto(proImage[i], i, professionals);
                    proImage[i].Source = ImageSource.FromStream(() => s);
                    _imageId.SetValue(proImage[i].Id, i);
                }
                else
                {
                    proImage[i].Source = "http://3.bp.blogspot.com/_9Q_36sq8aPo/S0D4__i1w1I/AAAAAAAAACo/cgLl5IYQtjA/s400/croix.png";
                    proImage[i].Scale = 0.75;
                }
                AbsoluteLayout.SetLayoutFlags(proImage[i], AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(proImage[i], new Rectangle(X, Y, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
                photoLayout.Children.Add(proImage[i]);
                X = X - 0.2;
                Y = Y + 0.2;

            }
            for (int i = 3; i < 6; i++)
            {
                X = X + 0.2;
                proImage[i] = new Image();
                if (professionals[i] != null)
                {
                    Stream s = new MemoryStream(DependencyService.Get<IBytesSaveAndLoad>().LoadByteArray(professionals[i].Photo), true);
                    proImage[i].Scale = 0.75;
                    proImage[i] = InitializePhoto(proImage[i], i, professionals);
                    proImage[i].Source = ImageSource.FromStream(() => s);
                    _imageId.SetValue(proImage[i].Id, i);
                }
                else
                {
                    proImage[i].Source = "http://3.bp.blogspot.com/_9Q_36sq8aPo/S0D4__i1w1I/AAAAAAAAACo/cgLl5IYQtjA/s400/croix.png";
                    proImage[i].Scale = 0.75;
                }
                AbsoluteLayout.SetLayoutFlags(proImage[i], AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(proImage[i], new Rectangle(X, Y, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
                photoLayout.Children.Add(proImage[i]);
                if (i != 5) Y = Y + 0.2;
            }
            for (int i = 6; i < 8; i++)
            {
                X = X + 0.2;
                Y = Y - 0.2;
                proImage[i] = new Image();
                if (professionals[i] != null)
                {
                    Stream s = new MemoryStream(DependencyService.Get<IBytesSaveAndLoad>().LoadByteArray(professionals[i].Photo), true);
                    proImage[i].Scale = 0.75;
                    proImage[i] = InitializePhoto(proImage[i], i, professionals);
                    proImage[i].Source = ImageSource.FromStream(() => s);
                    _imageId.SetValue(proImage[i].Id, i);
                }
                else
                {
                    proImage[i].Source = "http://3.bp.blogspot.com/_9Q_36sq8aPo/S0D4__i1w1I/AAAAAAAAACo/cgLl5IYQtjA/s400/croix.png";
                    proImage[i].Scale = 0.75;
                }
                AbsoluteLayout.SetLayoutFlags(proImage[i], AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(proImage[i], new Rectangle(X, Y, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
                photoLayout.Children.Add(proImage[i]);
            }
            for (int i = 8; i < 10; i++)
            {
                Y = Y - 0.2;
                proImage[i] = new Image();
                if (professionals[i] != null)
                {
                    Stream s = new MemoryStream(DependencyService.Get<IBytesSaveAndLoad>().LoadByteArray(professionals[i].Photo),true);
                    proImage[i].Scale = 0.75;
					proImage[i] = InitializePhoto(proImage[i], i, professionals);
                    proImage[i].Source = ImageSource.FromStream(() => s);
                    _imageId.SetValue(proImage[i].Id, i);
                }
                else
                {
                    proImage[i].Source = "http://3.bp.blogspot.com/_9Q_36sq8aPo/S0D4__i1w1I/AAAAAAAAACo/cgLl5IYQtjA/s400/croix.png";
                    proImage[i].Scale = 0.75;
                }
                AbsoluteLayout.SetLayoutFlags(proImage[i], AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(proImage[i], new Rectangle(X, Y, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
                photoLayout.Children.Add(proImage[i]);
                X = X - 0.2;
            }
            Content = new StackLayout
            {

                Children = {
                    button.Content,
                    photoLayout
                },
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            this.BackgroundColor = Color.White;
        }
Пример #5
0
        public PrescriptionListPage(Data userData)
        {
            _userData = userData;

            MultibleButtonView button = new MultibleButtonView(_userData);

            button.DocumentsIsDisable();
            button.FollowButton.Clicked += FollowButtonClicked;
            button.ProfilButton.Clicked += ProfilButtonClicked;

            Label myFollow = new Label
            {
                Text = "Mes Prescriptions",
                FontSize = 50,
                HorizontalOptions = LayoutOptions.Center,
                TextColor = Color.Gray
            };
            CreateMyPrescriptions();
            ListView prescriptionListView = new ListView
            {
                ItemsSource = _prescriptions,
                SeparatorColor = Color.Black,
                RowHeight = 150,
                ItemTemplate = new DataTemplate(() =>
                {
                    Label title = new Label();
                    title.SetBinding(Label.TextProperty, "Title");
                    title.FontSize = 20;
                    title.TextColor = Color.Gray;


                    Label senderName = new Label();
                    senderName.SetBinding(Label.TextProperty, "SenderName");
                    senderName.FontSize = 20;
                    senderName.TextColor = Color.Gray;


                    Label patientName = new Label();
                    patientName.SetBinding(Label.TextProperty, "PatientFullName");
                    patientName.FontSize = 20;
                    patientName.TextColor = Color.Gray;


                    Label patient = new Label();
                    patient.Text = "Patient : ";
                    patient.FontSize = 20;
                    patient.TextColor = Color.Gray;

                    Label spaceLabel = new Label();
                    spaceLabel.Text = "  ";
                    spaceLabel.FontSize = 20;
                    spaceLabel.TextColor = Color.Gray;

                    Label pro = new Label();
                    pro.Text = " De : ";
                    pro.FontSize = 20;
                    pro.TextColor = Color.Gray;


                    return new ViewCell
                    {
                        View = new StackLayout
                        {
                            Orientation = StackOrientation.Horizontal,
                            HorizontalOptions = LayoutOptions.Center,
                            VerticalOptions = LayoutOptions.Center,
                            Children =
                            {

                                new StackLayout
                                {
                                    Spacing = 0,
                                    Children =
                                    {
                                        patient,
                                        patientName,
                                        spaceLabel,
                                        title,
                                        pro,
                                        senderName
                                    },
                                    Orientation = StackOrientation.Horizontal,
                                    VerticalOptions = LayoutOptions.Center,
                                    HorizontalOptions = LayoutOptions.Center,
                                }

                            }
                        }
                    };
                })

            };
            Button document = new Button
            {
                Text = "Voir mes documents",
                FontSize = 40,
                BackgroundColor = Color.FromHex("439DFE"),
                VerticalOptions = LayoutOptions.End
            };
            document.Clicked += Document_Clicked;
            this.BackgroundColor = Color.White;
            this.Content = new StackLayout
            {
                Children =
                {
                    button.Content,
                    myFollow,
                    prescriptionListView
                }
            };
            prescriptionListView.ItemTapped += MessageListView_ItemTapped;
        }
Пример #6
0
        public PrescriptionPage(Data userData, Prescription prescription)
        {
            _userData = userData;
            _prescription = prescription;

            MultibleButtonView button = new MultibleButtonView(_userData);

            button.DocumentsIsDisable();
            button.FollowButton.Clicked += FollowButtonClicked;
            button.ProfilButton.Clicked += ProfilButtonClicked;

            Label messageLabel = new Label()
            {
                Text = "Prescription",
                FontSize = 40,
                TextColor = Color.Gray,
                HorizontalOptions = LayoutOptions.Center,
            };

            Label titleLabel = new Label()
            {
                Text = "Titre : " + _prescription.Title,
                FontSize = 40,
                TextColor = Color.Gray,
                HorizontalOptions = LayoutOptions.StartAndExpand,
            };

            Label senderLabel = new Label()
            {
                Text = "De : " + _prescription.SenderName,
                FontSize = 40,
                TextColor = Color.Gray,
                HorizontalOptions = LayoutOptions.StartAndExpand,
            };
            Stream s = new MemoryStream(DependencyService.Get<IBytesSaveAndLoad>().LoadByteArray(_prescription.DocPath));

            Image ContentLabel = new Image()
            {
                Source = ImageSource.FromStream(() => s),
                HeightRequest = 200,
                WidthRequest = 200,
                VerticalOptions = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand
            };

            Label recieversLabel = new Label()
            {
                Text = "À : " + _prescription.Recievers.Count + " personne(s)",
                FontSize = 40,
                TextColor = Color.Gray,
                HorizontalOptions = LayoutOptions.StartAndExpand,
            };

            Label patientLabel = new Label()
            {
                Text = "À propos de : " + _prescription.PatientFullName,
                FontSize = 40,
                TextColor = Color.Gray,
                HorizontalOptions = LayoutOptions.StartAndExpand,
            };

            Label dateLabel = new Label()
            {
                Text = "Date : " + _prescription.Date.ToString(),
                FontSize = 40,
                TextColor = Color.Gray,
                HorizontalOptions = LayoutOptions.StartAndExpand,
            };

            Button returnButton = new Button()
            {
                Text = "Retour à mes prescriptions",
                FontSize = 40,
                BackgroundColor = Color.FromHex("439DFE"),
                VerticalOptions = LayoutOptions.End
            };
            returnButton.Clicked += ReturnButton_Clicked;

            Content = new StackLayout
            {
                Children =
                {
                    button.Content,
                    messageLabel,
                    titleLabel,
                    senderLabel,
                    recieversLabel,
                    patientLabel,
                    dateLabel,
                    ContentLabel,
                    returnButton
                }
            };
            this.BackgroundColor = Color.White;
        }