Beispiel #1
0
        public async void SetModelData()
        {
            try
            {
                int LastpersonId = 0;
                if (CurrentPerson.Id == 0)
                {
                    LastpersonId = await HealthCenterService.CreateProfile(CurrentPerson);
                }


                var consultation = new Consultation()
                {
                    PersonId            = (LastpersonId != 0) ? LastpersonId : CurrentPerson.Id,
                    AilmentGroupId      = (int)ailmentCb.SelectedValue,
                    Diagnosis           = DiagnosisTxt.Text,
                    Remarks             = RemarksTxt.Text,
                    ExpectedChildGender = (PersonGender)Enum.Parse(typeof(PersonGender), cbgender.Text),
                    PregnancyDueDate    = dueDateDtp.Value,
                    Weight        = WeightTxt.Text,
                    Height        = HeightTxt.Text,
                    BloodPressure = BpTxt.Text
                };


                var lastConsultationId = await HealthCenterService.CreateMedicalConsultation(consultation);

                if (lastConsultationId != 0)
                {
                    Data = new EventLogs()
                    {
                        PersonId       = (LastpersonId != 0) ? LastpersonId : CurrentPerson.Id,
                        ConsultationId = lastConsultationId,
                    };
                }
            }
            catch
            {
            }
        }
        public async Task <bool> ModifyMedicalConsultation(Consultation consultation)
        {
            var data = await DataConnection.UpdateAsync(consultation);

            return(data);
        }
        public async Task <int> CreateMedicalConsultation(Consultation consultation)
        {
            var data = await DataConnection.InsertAsync(consultation);

            return(data);
        }