public override bool BtnDeleteClick() { // Test if the controls are filled if (GetControlReferences () == false) return false; // No Item is selected if (_edMainName.Text == "") return false; if (this._fragmentState.BtnDeleteClick ( ) != null) { if (this._fragmentState.GetType ().ToString () == "UI.StateFragmentAnsprechpartner") { // If it is deleting the Ansprechpartner, get out of this sub return true; } if (this._fragmentState.GetType().ToString() == "UI.StateFragmentTask") { // If it is deleting the Ansprechpartner, get out of this sub return true; } _person = BusinessLayer.Interessent.Create(); Android.Widget.Toast.MakeText (_mainActivity, _mainActivity.Resources.GetString(Resource.String.DeletedSuccessfully), Android.Widget.ToastLength.Short).Show (); _interessenten.RemoveAt (_selectedIndex); _adapter = new InteressentViewAdapter (_mainActivity,_interessenten); _list.Adapter = _adapter; this.ResetControls(); return true; } return false; }
async public override System.Threading.Tasks.Task BtnSearchClickAsync () { _interessenten = await BusinessLayer.Interessent.GetInteressentenAsync (_edSearch.Text, Utilities.GetCurrentLanguage(_mainActivity),MainActivity.User); _adapter = new InteressentViewAdapter (_mainActivity, _interessenten); if (_mainActivity._activityData == null) { _mainActivity._activityData = new MainActivityData (); } _mainActivity._activityData.Interessenten = _interessenten; _list.Adapter = _adapter; _edMainName.Text = ""; _tvEmail.Text = ""; _tvNummer.Text = ""; _tvTelefon.Text = ""; _tvUmsatz.Text = ""; _fragmentState.BtnSearchClick (); }
async public override Task<bool> BtnSaveClickAsync () { bool bInserting = false; if (_person.ID == null) bInserting = true; if ( await _fragmentState.BtnSaveClickAsync () == false) return false; if (bInserting) { // INSERT statement _interessenten.Add ((BusinessLayer.Interessent)_person); _selectedIndex = _interessenten.Count - 1; } else { // UPDATE statement _interessenten [_selectedIndex] = (BusinessLayer.Interessent)_person; } // Refresh the listview _adapter = new UI.InteressentViewAdapter(_mainActivity,_interessenten); _list.Adapter = _adapter; // Inform the user Android.Widget.Toast.MakeText(_mainActivity,_mainActivity.Resources.GetString(Resource.String.SavedSuccessfully), Android.Widget.ToastLength.Short).Show(); // refresh the general controls _edMainName.Text = _person.Name; _tvEmail.Text = _person.Email; _tvNummer.Text = _person.Nummer; _tvTelefon.Text = _person.Telefon; _tvUmsatz.Text = _person.Umsatz; return true; }
public override void BtnSearchClick() { _interessenten = BusinessLayer.Interessent.GetInteressenten (_edSearch.Text,Utilities.GetCurrentLanguage(_mainActivity),MainActivity.User); _adapter = new InteressentViewAdapter (_mainActivity,_interessenten); _list.Adapter = _adapter; _edMainName.Text = ""; _tvEmail.Text = ""; _tvNummer.Text = ""; _tvTelefon.Text = ""; _tvUmsatz.Text = ""; _fragmentState.BtnSearchClick (); }