async void OnDestinazioneTapped(object sender, System.EventArgs e)
        {
            //
            // Verifichiamo che ci destinazioni per il cliente
            //
            var recTotal_ = 0;

            if (_cli != null)
            {
                string sql = "SELECT COUNT(*) FROM destina1 WHERE dst_rel = 0 AND dst_cli_for = " + _cli.cli_codice;
                recTotal_ = await _dbcon.ExecuteScalarAsync <int>(sql);
            }
            if (recTotal_ == 0)
            {
                await DisplayAlert("Attenzione!", "Non ci sono destinazioni per il Cliente selezionato", "OK");

                return;
            }
            var page = new DestinazioniSearch(_cli != null ? _cli.cli_codice : 0);

            page.DstList.ItemDoubleTapped += (source, args) =>
            {
                _dst = (Destinazioni)args.ItemData;
                SetField();
                Navigation.PopAsync();
            };
            await Navigation.PushAsync(page);
        }
Beispiel #2
0
        async void OnDestinazioniClicked(object sender, System.EventArgs e)
        {
            if ((_cli == null) || (_cli.cli_codice == 0))
            {
                return;
            }

            var    recTotal_ = 0;
            string sql       = "SELECT COUNT(*) FROM destina1 WHERE dst_rel = 0 AND dst_cli_for = " + _cli.cli_codice;

            recTotal_ = await _dbcon.ExecuteScalarAsync <int>(sql);

            if (recTotal_ == 0)
            {
                await DisplayAlert("Attenzione!", "Non ci sono destinazioni per il Cliente selezionato", "OK");

                return;
            }
            var page = new DestinazioniSearch(_cli != null ? _cli.cli_codice : 0);

            page.DstList.ItemDoubleTapped += async(source, args) =>
            {
                var dst = (Destinazioni)args.ItemData;
                m_dst_cod.Text = dst.dst_codice.ToString();
                m_dst_des.Text = dst.dst_desc;
                await Navigation.PopAsync();

                if ((_dst == null) || (_dst.dst_codice != dst.dst_codice))
                {
                    _dst            = dst;
                    dataGrid.IsBusy = true;
                    sql             = String.Format("SELECT sca_id, sca_data, sca_importo, (sca_importo * 0) AS sca_incasso, sca_fattura, sca_tot_fat, sca_desc, sca_locked FROM scadenze WHERE sca_relaz = 0 AND sca_pagato = 0 AND sca_cli_for = {0} AND sca_dst = {1} ORDER BY sca_data, sca_num", _cli.cli_codice, _dst.dst_codice);
                    var scaList = await _dbcon.QueryAsync <IncassiInfo>(sql);

                    var scaCollection = new ObservableCollection <IncassiInfo>(scaList);
                    dataGrid.ItemsSource = scaCollection;
                    dataGrid.IsBusy      = false;
                }
                _cli_changed = false;
                _dst_changed = false;
            };
            await Navigation.PushAsync(page);
        }