Example #1
0
        public void  BtnNewClick()
        {
            try
            {
                // Test if the controls are filled 
                if (GetControlReferences () == false)
                    return ;

                var dlg = new TransactionDialog(this._mainActivity,this._stateClass._person,BusinessLayer.Auftrag.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 Auftraege to reflect the changes (project and sum of the transactions)                    
                        this._auftraege = await BusinessLayer.Auftrag.GetAuftraegeAsync(_stateClass._person.ID, Utilities.GetCurrentLanguage(this._mainActivity),MainActivity.User);
                        _list = _mainActivity.FindViewById<ListView> (Resource.Id.AuftraegeListview);
                        _adapter = new AuftragViewAdapter (_mainActivity, _auftraege);
                        _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);
            }

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

            // show the transaction with all the positions 
            var dlg = new TransactionDialog(_activity,_stateFragment._stateClass._person,_stateFragment._auftraege[args.Position],permission.Update);
            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 Auftrag to reflect the changes (project and sum of the transactions)                    
                    this._stateFragment._auftraege = await BusinessLayer.Auftrag.GetAuftraegeAsync(_stateFragment._stateClass._person.ID, Utilities.GetCurrentLanguage(_activity),MainActivity.User);
                    _list = _activity.FindViewById<ListView>(Resource.Id.AuftraegeListview);
                    _adapter = new AuftragViewAdapter(_activity, this._stateFragment._auftraege);
                    _list.Adapter = _adapter;
                }
                // enable again the list
                _list.Clickable = true;
                _list.Enabled = true;
            };


        }
Example #3
0
        async public Task ListViewClickAsync()
        {

            // Test if the controls are filled 
            if (GetControlReferences () == false)
                return ;

            // Disable the controls 
            DisableControls ();

            // Specific Controls
            // Test if the controls are filled 
            if (GetControlReferences () == false)
                return ;
            
            // Refill the List 
            // Build an adapter
            // Connect it to the lovely Listview
            _auftraege = await BusinessLayer.Auftrag.GetAuftraegeAsync ( _stateClass._person.ID,Utilities.GetCurrentLanguage(_mainActivity ),MainActivity.User );
            _list = _mainActivity.FindViewById<ListView> (Resource.Id.AuftraegeListview);
            _adapter = new AuftragViewAdapter (_mainActivity, _auftraege);
            _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 ;

        }
Example #4
0
        public override void OnStart ()
        {
            base.OnStart ();

            _list = _activity.FindViewById<ListView> (Resource.Id.AuftraegeListview);
            _activity.FindViewById<TextView>(Resource.Id.tvAuftrag).Text = _activity.Resources.GetString(Resource.String.Auftraege);
            _adapter = new AuftragViewAdapter (_activity, _stateFragment._auftraege);
            _list.Adapter = _adapter;

            _list.ItemClick += ListItemClick;
        }