예제 #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 ProfilPage(Data userData, User user)
        {
			_userData = userData;
            _user = user;

            MultibleButtonView button = new MultibleButtonView(_userData);

			button.ProfilIsDisable ();
            button.FollowButton.Clicked += FollowButtonClicked;
            button.DocumentButton.Clicked += Document_Clicked;   

			Label title = new Label {
				Text = "Profil",
				FontSize = 40,
				HorizontalOptions = LayoutOptions.Center
			};

			Label name = new Label {
				Text = _user.FirstName + "  " + _user.LastName,
				FontSize = 30,
				HorizontalOptions = LayoutOptions.Center	
			};

			Label phonenumber = new Label
			{
				Text = "Numero : " + _user.PhoneNumber ,
				FontSize = 30,
				HorizontalOptions = LayoutOptions.Center

            };

			Label adresse = new Label
			{
				Text = "Adresse : "+ _user.Adress,
                FontSize = 30,
                HorizontalOptions = LayoutOptions.Center
			};

			Label postCode = new Label
			{
				Text = _user.Postcode.ToString(),
				FontSize = 30,
				HorizontalOptions = LayoutOptions.Center
			};

			Label city = new Label
			{
				Text = _user.City,
				FontSize = 30,
				HorizontalOptions = LayoutOptions.Center
			};
            Stream s = new MemoryStream(DependencyService.Get<IBytesSaveAndLoad>().LoadByteArray(_user.Photo));
			Image logo = new Image
			{
				Source = ImageSource.FromStream(() => s),
                HorizontalOptions = LayoutOptions.FillAndExpand,
			};

            Button Suivis = new Button
            {
                Text = "Voir mes Suivis",
                FontSize = 40,
                BackgroundColor = Color.FromHex("439DFE"),
                VerticalOptions = LayoutOptions.EndAndExpand
            };

            Suivis.Clicked += FollowButtonClicked;

            if (!UserAccount())
                Suivis.Text = "Retour à mon suivi";
            else if(PageForPatient())
                Suivis.Text = "Voir mon Suivi";
            

            Button document = new Button
			{
				Text = "Voir mes documents",
				FontSize = 40,
				BackgroundColor = Color.FromHex("439DFE"),
				VerticalOptions = LayoutOptions.EndAndExpand
			};
            document.Clicked += Document_Clicked;

            if (!UserAccount())
                document.IsVisible = false;

            Button modify = new Button
            {
                Text = "Modifier mes infos",
                FontSize = 40,
                BackgroundColor = Color.FromHex("439DFE"),
				VerticalOptions = LayoutOptions.EndAndExpand
            };
            modify.Clicked += async (sender, e) =>
            {
                await Navigation.PushAsync(new ModifyProfil(_userData));
            };
            if (!UserAccount()) modify.IsVisible = false;
            Button deconnection = new Button
            {
                Text = "Se déconnecter",
                FontSize = 40,
                BackgroundColor = Color.FromHex("439DFE"),
                VerticalOptions = LayoutOptions.EndAndExpand
            };
            deconnection.Clicked += Deconnection_Clicked;

            Content = new StackLayout
            {

                Children = {
					button.Content,
					title,
					name,
					phonenumber,
					adresse,
					postCode,
					city,
					logo,
                    Suivis,
					document,
                    modify,
                    deconnection
                },
            };
            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 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;
        }
예제 #6
0
		public ModifyProfil (Data userData)
		{
			_userData = userData;
            _cameraview = new CameraViewModel();
            var tappedGesture = new TapGestureRecognizer();
            tappedGesture.Tapped += TappedGesture_Tapped;

            MultibleButtonView button = new MultibleButtonView(_userData);

            button.ProfilIsDisable();
            button.FollowButton.Clicked += FollowButtonClicked;
            button.DocumentButton.Clicked += DocumentButton_Clicked;

            Entry firstName = new Entry
			{
				Text = _userData.User.FirstName,
				FontSize = 40,
				HorizontalTextAlignment = TextAlignment.Center,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.CenterAndExpand,
				TextColor = Color.Gray
			};
			firstName.TextChanged += EntryTextChanged;
			Entry lastName = new Entry
			{
				Text = _userData.User.LastName,
				FontSize = 40,
				HorizontalTextAlignment = TextAlignment.Center,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.CenterAndExpand,
				TextColor = Color.Gray
			};
			Entry adress = new Entry
			{
				Text = _userData.User.Adress,
				FontSize = 40,
				HorizontalTextAlignment = TextAlignment.Center,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.CenterAndExpand,
				TextColor = Color.Gray
			};
			Entry postCode = new Entry
			{
				Text = _userData.User.Postcode.ToString(),
				FontSize = 40,
				Keyboard = Keyboard.Numeric,
				HorizontalTextAlignment = TextAlignment.Center,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.CenterAndExpand,
				TextColor = Color.Gray
			};

			Entry city = new Entry
			{
				Text = _userData.User.City,
				FontSize = 40,
				HorizontalTextAlignment = TextAlignment.Center,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.CenterAndExpand,
				TextColor = Color.Gray
			};
			Entry phoneNumber = new Entry
			{
				Text = _userData.User.PhoneNumber.ToString(),
				FontSize = 40,
				Keyboard = Keyboard.Telephone,
				HorizontalTextAlignment = TextAlignment.Center,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.CenterAndExpand,
				TextColor = Color.Gray
			};
            Stream s = new MemoryStream(DependencyService.Get<IBytesSaveAndLoad>().LoadByteArray(_userData.User.Photo));
            _profilPhoto = new Image {
                Source = ImageSource.FromStream(() => s),
            };
			_profilPhoto.GestureRecognizers.Add (tappedGesture);

			Button modify = new Button
			{
				Text = "Sauvegarder",
				FontSize = 40,
				BackgroundColor = Color.FromHex("439DFE"),
				VerticalOptions = LayoutOptions.EndAndExpand,
                
			};
            Button photo = new Button
            {
                Text = "Prendre une photo",
                FontSize = 40,
                BackgroundColor = Color.FromHex("439DFE"),
                VerticalOptions = LayoutOptions.EndAndExpand,
        	};
			photo.Clicked += Photo_Clicked;
            modify.Clicked += async (sender, e) => 
			{
				_userData.User.Adress = adress.Text;
				_userData.User.City = city.Text;
				_userData.User.FirstName = firstName.Text;
				_userData.User.LastName = lastName.Text;
				_userData.User.PhoneNumber = Int32.Parse(phoneNumber.Text);
				_userData.User.Postcode = Int32.Parse(postCode.Text);
				_userData.NeedUpdate = true;
                DataXML json = _xml.DataToDataJsonForSave(_userData);
                DependencyService.Get<ISaveLoadAndDelete>().SaveData("user.txt", json);
                UpdateAll();
				await Navigation.PushAsync(new ProfilPage(_userData, _userData.User));
			};
			Content = new StackLayout
			{

				Children = {
					button,
					firstName,
					lastName,
					adress,
					postCode,
					city,
					phoneNumber,
					_profilPhoto,
                    photo,
					modify
				},
			};
			this.BackgroundColor = Color.White;
		}
예제 #7
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;
        }
예제 #8
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;
        }
예제 #9
0
        public FollowPatientPage (Data userData, Patient patient)
		{
			_userData = userData;
			_patient = patient;
            var tappedGesture = new TapGestureRecognizer();
            tappedGesture.Tapped += TappedGesture_Tapped;
            AbsoluteLayout photoLayout = new AbsoluteLayout
            {
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            MultibleButtonView button = new MultibleButtonView(_userData);

            button.FollowIsDisable();
            button.DocumentButton.Clicked += DocumentsButton_Clicked;
            button.ProfilButton.Clicked += ProfilButtonClicked;

            Button messageButton = new Button
            {
                Text = "Messages",
                FontSize = 30,
                BackgroundColor = Color.FromHex("439DFE"),
            };

            AbsoluteLayout.SetLayoutFlags(messageButton, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(messageButton, new Rectangle(0, 1, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            photoLayout.Children.Add(messageButton);
            messageButton.Clicked += MessageButton_Clicked;

            Button createMessageButtton = new Button
            {
                Text = "Ajouter un message",
                FontSize = 20,
                BackgroundColor = Color.FromHex("439DFE"),
            };

            AbsoluteLayout.SetLayoutFlags(createMessageButtton, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(createMessageButtton, new Rectangle(0, 0.9, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            photoLayout.Children.Add(createMessageButtton);
            createMessageButtton.Clicked += CreateMessageButtton_Clicked;

            Button createPrescriptionButtton = new Button
            {
                Text = "Ajouter une prescription",
                FontSize = 20,
                BackgroundColor = Color.FromHex("439DFE"),
            };

            AbsoluteLayout.SetLayoutFlags(createPrescriptionButtton, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(createPrescriptionButtton, new Rectangle(1, 0.9, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            photoLayout.Children.Add(createPrescriptionButtton);
            createPrescriptionButtton.Clicked += CreatePrescriptionButtton_Clicked;

            Button prescriptionButton = new Button
            {
                Text = "Prescriptions",
                FontSize = 30,
                BackgroundColor = Color.FromHex("439DFE"),
            };

            AbsoluteLayout.SetLayoutFlags(prescriptionButton, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(prescriptionButton, new Rectangle(1, 1, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            photoLayout.Children.Add(prescriptionButton);
            prescriptionButton.Clicked += PrescriptionButton_Clicked;
            Stream str = new MemoryStream(DependencyService.Get<IBytesSaveAndLoad>().LoadByteArray(patient.Photo), true);
            Image patientImage = new Image
            {
                Source = ImageSource.FromStream(() => str),
				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);

            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].GestureRecognizers.Add (tappedGesture);
                    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].GestureRecognizers.Add (tappedGesture);
                    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].GestureRecognizers.Add (tappedGesture);
                    _imageId.SetValue(proImage[i].Id, i);
                    proImage[i].Source = ImageSource.FromStream(() => s);
                }
                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].GestureRecognizers.Add (tappedGesture);
                    _imageId.SetValue(proImage[i].Id, i);
                    proImage[i].Source = ImageSource.FromStream(() => s);
                }
                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;
        }
예제 #10
0
        public PatientListPage(Data userData)
        {
            _userData = userData;
            MultibleButtonView button = new MultibleButtonView(_userData);

            button.FollowIsDisable();
            button.DocumentButton.Clicked += DocumentsButton_Clicked;
            button.ProfilButton.Clicked += ProfilButtonClicked;

            Label myFollow = new Label {
				Text = "Mes Suivis",
				FontSize = 50,
				HorizontalOptions = LayoutOptions.Center
			};
            CreateMyPatient();
            ListView patientListView = new ListView
            {
                ItemsSource = _myPatient,
				SeparatorColor = Color.Black,
				RowHeight = 150,
                ItemTemplate = new DataTemplate(() =>
                {
                    Label firstName = new Label();
                    firstName.SetBinding(Label.TextProperty, "FirstName");
					firstName.FontSize = 40;

                    Label spaceLabel = new Label();
                    spaceLabel.Text = "  ";

                    Label lastName = new Label();
                    lastName.SetBinding(Label.TextProperty, "LastName");
                    lastName.FontSize = 40;

                    Image patientImage = new Image();
                    return new ViewCell
                    {
                        View = new StackLayout
                        {
							Orientation = StackOrientation.Horizontal,
							HorizontalOptions = LayoutOptions.Center,
							VerticalOptions = LayoutOptions.Center,
                            Children =
                            {
                                
                                new StackLayout
                                {
                                    Spacing = 0,
                                    Children =
                                    {
										patientImage,
                                        firstName,
                                        spaceLabel,
                                        lastName
                                    },
									Orientation = StackOrientation.Horizontal,
									VerticalOptions = LayoutOptions.Center,
									HorizontalOptions = LayoutOptions.Center,
                                }
								
                            }
                        }
                    };
                })
                
            };
			this.BackgroundColor = Color.White;
			this.Content = new StackLayout
			{
				Children = 
				{
					button.Content,
					myFollow,
					patientListView
				}
			};
            patientListView.ItemTapped += PatientListView_ItemTapped;
        }