public ListViewXamlMet()
        {
            #region ListViewSetup_Met_XAML
            InitializeComponent();
            LstViewMet.ItemsSource = MetSurvey;
            #endregion
            #region PopulateFromqGetSurvey_Met_XAML
            var qSurvey = UtilDal.GetSurvey("Met");

            if (qSurvey.Any())
            {
                foreach (var que in qSurvey)
                {
                    MetSurvey.Add(new SurveyModel()
                    {
                        SurQuestion = que.Question, TextData = string.Empty
                    });
                }
            }
            else
            {
                throw new Exception("Survey list is empty for Met");
            }
            #endregion
        }
示例#2
0
	    public ListViewCodeCnt()
		{
            #region ListViewSetup_Cnt
            var lstViewMet = new ListView
		    {
		        ItemsSource = CntSurvey,
		        ItemTemplate = new DataTemplate(typeof(EntryCell))
		    };
		    // Bind inputs
            lstViewMet.ItemTemplate.SetBinding(EntryCell.LabelProperty, "SurQuestion");
		    lstViewMet.ItemTemplate.SetBinding(EntryCell.TextProperty, "TextData");
		    // Set content value
            Content = lstViewMet;
            #endregion
            #region PopulateFromqGetSurvey_Cnt
            var qSurvey = UtilDal.GetSurvey("Cnt");
            
		    if (qSurvey.Any())
		        foreach (var que in qSurvey)
		        {
		            CntSurvey.Add(new SurveyModel {SurQuestion = que.Question, TextData = string.Empty});
		        }
		    else
		        throw new Exception("Survey list is empty for Cnt");
            #endregion
		}
示例#3
0
        private async void Button_Clicked_CNT_save(object sender, EventArgs e)
        {
            // Add on-screen values to a lst
            var list = new List <string>();

            foreach (var item in CntSurvey)
            {
                list.Add(item.TextData);
            }
            // Put list items into model
            var answerCnt = new PatientInfoModel {
                Name = list[0], Surname = list[1], Said = list[2]
            };

            // Send the ID number over to the DAL Utility to check the database
            if (UtilDal.QueryClient(answerCnt) == true)
            {
                // This means that the creation was a success
                await Navigation.PushModalAsync(new SelectionPage(answerCnt));

                // success page needs creation
            }
            else
            {
                // This means a patient with that ID already exists
                var error = @"This patient already exists:";
                // Error page needs creation
            }
        }
示例#4
0
        public ListViewCodeVad()
        {
            #region ListViewSetup_Vad
            var lstViewVad = new ListView
            {
                ItemsSource  = VadSurvey,
                ItemTemplate = new DataTemplate(typeof(SwitchCell))
            };
            // Bind inputs
            lstViewVad.ItemTemplate.SetBinding(SwitchCell.TextProperty, "SurQuestion");
            lstViewVad.ItemTemplate.SetBinding(SwitchCell.OnProperty, "IsTrue");
            // Set content value
            Content = lstViewVad;
            #endregion
            #region PopulateFromqGetSurvey_Vad
            var qSurvey = UtilDal.GetSurvey("Vad");

            if (qSurvey.Any())
            {
                foreach (var que in qSurvey)
                {
                    VadSurvey.Add(new SurveyModel {
                        SurQuestion = que.Question, IsTrue = false
                    });
                }
            }
            else
            {
                throw new Exception("Survey list is empty for Vad");
            }
            #endregion
        }
示例#5
0
        public ListViewXamlVad(PatientInfoModel patient)
        {
            curPatient = patient;
            #region ListViewSetup_Vad_XAML
            InitializeComponent();
            LstViewVad.ItemsSource = VadSurvey;
            #endregion
            #region PopulateFromqGetSurvey_Vad_XAML
            var qSurvey = UtilDal.GetSurvey("Vad");

            if (qSurvey.Any())
            {
                foreach (var que in qSurvey)
                {
                    VadSurvey.Add(new SurveyModel()
                    {
                        SurQuestion = que.Question, IsTrue = false
                    });
                }
            }
            else
            {
                throw new Exception("Survey list is empty for Vad");
            }
            #endregion
        }
        private void Button_Clicked_MET_save(object sender, EventArgs e)
        {
            var list = new List <string>();

            foreach (var ans in MetSurvey)
            {
                list.Add(ans.TextData);
            }
            // fix this age from datetime.
            var answerMet = new AnswerModel {
                Waist = list[0], Systolic = list[1], Age = "2"
            };

            UtilDal.PostAnswer(answerMet);
            Navigation.PopModalAsync();
        }
示例#7
0
        private void Button_Clicked_VAD_save(object sender, EventArgs e)
        {
            var list = new List <string>();

            foreach (var ans in VadSurvey)
            {
                list.Add(ConversionHelper.Bool2Bin(ans.IsTrue));
            }

            var answerVad = new AnswerModel
            {
                ParametersVad = list,
                CurDateTime   = DateTime.Today,
                Said          = curPatient.Said,
                Age           = ConversionHelper.GetAge(curPatient)
            };

            UtilDal.PostAnswer(answerVad);
            Navigation.PopModalAsync();
        }