コード例 #1
0
        async Task SearchClickAsync(object sender, EventArgs args)
        {
            var searchCashHeaders = SearchCashHeaderViewModel.GetInstance();

            searchCashHeaders.Search();

            if (searchCashHeaders.CashHeaders != null && searchCashHeaders.CashHeaders.Count > 0)
            {
                var cashheaderlist = new CashHeadersListPage();
                await Navigation.PushModalAsync(cashheaderlist);
            }
        }
コード例 #2
0
        async void SelectRecord()
        {
            var mainviewmodel = MainViewModel.GetInstance();

            switch (mainviewmodel.EjecutadoDesde)
            {
            case "SearchInvoicesViewModel":
                try
                {
                    var searchinvoice = SearchInvoicesViewModel.GetInstance();
                    searchinvoice.Calendar = null;
                    searchinvoice.Customer = this;
                    searchinvoice.InvoiceHeaders.Clear();
                    searchinvoice.TotalLineas           = 0;
                    searchinvoice.IsEnabled             = true;
                    searchinvoice.FiltroFechasIsEnabled = true;
                    await navigationService.Back();
                }
                catch (System.Exception ex)
                {
                    await dialogService.ShowMessage("Error", ex.Message);
                }

                break;

            case "NewOrderViewModel":
                try
                {
                    if (CreditHold == true)
                    {
                        var answer = await dialogService.ShowConfirm("Informacion",
                                                                     "El cliente tiene credito retenido. ¿Desea continuar?");

                        if (!answer)
                        {
                            return;
                        }
                    }
                    var newOrderViewModel = NewOrderViewModel.GetInstance();
                    newOrderViewModel.Customer = this;
                    newOrderViewModel.LoadPriceLists();
                    await navigationService.Back();
                }
                catch (System.Exception ex)
                {
                    await dialogService.ShowMessage("Error", ex.Message);
                }

                break;

            case "SearchCashHeaderPage":
                try
                {
                    var searchvashheaderviewmodel = SearchCashHeaderViewModel.GetInstance();
                    searchvashheaderviewmodel.Calendar    = null;
                    searchvashheaderviewmodel.Customer    = this;
                    searchvashheaderviewmodel.TotalLineas = 0;
                    searchvashheaderviewmodel.CashHeaders.Clear();
                    searchvashheaderviewmodel.IsEnabled = true;
                    await navigationService.Back();
                }

                catch (System.Exception ex)
                {
                    await dialogService.ShowMessage("Error", ex.Message);
                }

                break;
            }
        }