예제 #1
0
        private async void MessageAdd(Prescription p)
        {
            if(TostringSource(_photo)!= null)
                _userData.Documents.Prescriptions.Add(p);
            else
                await DisplayAlert("Envoi", "Le message à été envoyé", "OK");

        }
예제 #2
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;
        }
예제 #3
0
		private void PrescriptionAdd( Prescription p )
		{
			_userData.Documents.Prescriptions.Add(p);
			_userData.DocumentsAdded.Prescriptions.Add (p);
		}
예제 #4
0
 private PrescriptionXML CreatePrescription(Prescription mJson)
 {
     UserXML p = CreateUser(mJson.Sender.UserId, mJson.Sender.FirstName, mJson.Sender.LastName, mJson.Sender.Birthdate, mJson.Sender.Adress, mJson.Sender.City, mJson.Sender.Postcode, mJson.Sender.Pseudo, mJson.Sender.Password, mJson.Sender.PhoneNumber, mJson.Sender.Photo);
     PatientXML pa = CreatePatient(mJson.Patient.UserId, mJson.Patient.FirstName, mJson.Patient.LastName, mJson.Patient.Birthdate, mJson.Patient.Adress, mJson.Patient.City, mJson.Patient.Postcode, mJson.Patient.Pseudo, mJson.Patient.Password, mJson.Patient.PhoneNumber, mJson.Patient.Photo);
     List<ProfessionalXML> pro = CreateListPro(mJson.Recievers);
     PrescriptionXML m = new PrescriptionXML();
     m.DocPath = mJson.DocPath;
     m.Doc = DependencyService.Get<IBytesSaveAndLoad>().LoadByteArray(mJson.DocPath);
     m.Data = mJson.Date;
     m.Patient = pa;
     m.Recievers = pro;
     m.Sender = p;
     m.Title = mJson.Title;
     return m;
 }