Example #1
0
        private async void BtnAddCase_Click(object sender, RoutedEventArgs e)
        {
            string Message = "", caseId = "";

            CasesViewModel casesViewModel = new CasesViewModel();

            casesViewModel.CreateNewCase(ref Message, ref casesModel);

            if (Message != string.Empty)
            {
                var newCaseResultDialog = new NewCaseResultDialog(Message, "");
                await newCaseResultDialog.ShowAsync();
            }
            else
            {
                Message = "El caso se creó de manera exitosa";
                caseId  = "Número de caso: " + casesModel.InternalCaseNumber;

                var newRecordResultDialog = new NewRecordResultDialog(Message, caseId);
                await newRecordResultDialog.ShowAsync();

                this.Frame.Content = null;
                this.DataContext   = null;
            }
        }
        private async void TxtRecord_EditRecord_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string Message = string.Empty;

            RecordsViewModel recordsViewModel = new RecordsViewModel();

            recordsViewModel.SearchSpecificCustomerRecords(ref editRecord, ref Message);

            if (Message != string.Empty)
            {
                var newRecordResultDialog = new NewRecordResultDialog(Message, "");
                await newRecordResultDialog.ShowAsync();
            }
            else
            {
                editRecord.IsEditRecordBtnEnabled = true;
            }
        }
        private async void ASBAllRecords_EditRecord_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            string Message = string.Empty;

            RecordsViewModel recordsViewModel = new RecordsViewModel();

            recordsViewModel.SearchAllCustomerRecords(ref editRecord, ref Message);

            if (Message != string.Empty)
            {
                var newRecordResultDialog = new NewRecordResultDialog(Message, "");
                await newRecordResultDialog.ShowAsync();
            }
            else if (editRecord.RecordsList.Count == 0 || editRecord.RecordsList is null)
            {
                Message = "No se encontró ningún expediente con el criterio dado";

                var newRecordResultDialog = new NewRecordResultDialog(Message, "");
                await newRecordResultDialog.ShowAsync();
            }
        }
        private async void BtnAddRecord_Click(object sender, RoutedEventArgs e)
        {
            string Message      = string.Empty;
            string recordNumber = string.Empty;

            RecordsViewModel recordsViewModel = new RecordsViewModel();

            recordsViewModel.CreateNewCustomerRecord(ref Message, ref newRecord);

            if (Message == string.Empty)
            {
                Message      = "El expediente se ha creado de manera exitosa";
                recordNumber = "Número de expediente: " + newRecord.RecordId;

                var newRecordResultDialog = new NewRecordResultDialog(Message, recordNumber);
                await newRecordResultDialog.ShowAsync();

                var recordsDialog = new RecordsDialog();
                await recordsDialog.ShowAsync();

                if (recordsDialog.BResult == 1)
                {
                    checkRecord.CustomerSearchCriteria = newRecord.CustomerIdNumber;
                    Pivot_Records.SelectedItem         = PI_CheckRecords;

                    ASBAllRecords.Focus(FocusState.Programmatic);
                }
                else
                {
                    this.Frame.Navigate(typeof(HomePage), null, new DrillInNavigationTransitionInfo());
                }
            }
            else
            {
                var newRecordResultDialog = new NewRecordResultDialog(Message, recordNumber);
                await newRecordResultDialog.ShowAsync();
            }
        }
        private async void BtnEditRecord_Click(object sender, RoutedEventArgs e)
        {
            string Message = string.Empty;

            RecordsViewModel recordsViewModel = new RecordsViewModel();

            recordsViewModel.EditCustomerRecord(ref Message, ref editRecord);

            if (Message != string.Empty)
            {
                var newRecordResultDialog = new NewRecordResultDialog(Message, "");
                await newRecordResultDialog.ShowAsync();
            }
            else
            {
                Message = "El expediente se modificó de manera exitosa";

                var newRecordResultDialog = new NewRecordResultDialog(Message, "");
                await newRecordResultDialog.ShowAsync();

                Frame.Navigate(typeof(HomePage), null, new DrillInNavigationTransitionInfo());
            }
        }