コード例 #1
0
ファイル: State.cs プロジェクト: MbProg/TestApolloAndroid
        public void  BtnNewClick()
        {
            try
            {
                // Test if the controls are filled 
                if (GetControlReferences () == false)
                    return ;

                var dlg = new TransactionDialog(this._mainActivity,this._stateClass._person,BusinessLayer.Bestellung.Create(), permission.Create );
                dlg.Show();
                dlg.DismissEvent+= async  (object sen, EventArgs e) => {

                    // look if in transaction Dialog any changes has been made
                    if (dlg.bChanged)
                    {
                        // update the main listview of Bestellungen to reflect the changes (project and sum of the transactions)                    
                        this._bestellungen = await BusinessLayer.Bestellung.GetBestellungenAsync(_stateClass._person.ID, Utilities.GetCurrentLanguage(this._mainActivity),MainActivity.User);
                        _list = _mainActivity.FindViewById<ListView> (Resource.Id.AuftraegeListview);
                        _adapter = new BestellungViewAdapter (_mainActivity, _bestellungen);
                        _list.Adapter = _adapter;
                    }
                };


                // Configure the buttons
                if (MainActivity.User.NetworkStatus == DataAccessLayer.NetworkState.Disconnected)
                    ConfigureButtons(false, false, false, false, false);
                else
                    ConfigureButtons(permission.Create, false, false, false, permission.UpDownload);

                return ;
            }
            catch(Exception ex)
            {
                DataAccessLayer.ExceptionWriter.WriteLogFile(ex);
            }

        }
コード例 #2
0
        void ListItemClick(object sender, AdapterView.ItemClickEventArgs args)
        {
            // disable the list outside, so that not another dlg is opend
            _list.Enabled = false;
            _list.Clickable = false;

            // show the transaction with all the positions 
            var dlg = new TransactionDialog(_activity,_stateFragment._stateClass._person,_stateFragment._bestellungen[args.Position], permission.Update);
            dlg.Show();
            dlg.DismissEvent+= async  (object sen, EventArgs e) => {
                try
                {
                    // look if in transaction Dialog any changes has been made
                    if (dlg.bChanged)
                    {
                        // update the main listview of Bestellung to reflect the changes (project and sum of the transactions)                    
                        this._stateFragment._bestellungen = await BusinessLayer.Bestellung.GetBestellungenAsync(_stateFragment._stateClass._person.ID, Utilities.GetCurrentLanguage(_activity),MainActivity.User);
                        _list = _activity.FindViewById<ListView> (Resource.Id.AuftraegeListview);
                        _adapter = new BestellungViewAdapter (_activity, this._stateFragment._bestellungen);
                        _list.Adapter = _adapter;
                    }
                    // enable again the list
                    _list.Clickable = true;
                    _list.Enabled = true;
                }
                catch(Exception ex)
                {
                    DataAccessLayer.ExceptionWriter.WriteLogFile(ex);
                }
            };


        }