private void Save() { if (!ValidateViews()) { return; } try { BindModel(); var Ent = new EntregaManager(); Ent.Save(entrega); Intent myIntent = new Intent(this, typeof(Activity_Menu)); myIntent.PutExtra("mensagem", Ent.mensagem); SetResult(Result.Ok, myIntent); //SendByEmail(); Finish(); } catch (Exception ex) { Toast.MakeText(this, ex.Message, ToastLength.Short).Show(); } }
private void Delete(Entrega ent) { Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this); alert.SetTitle("Tem certeza que deseja excluir esta ocorrência?"); alert.SetPositiveButton("Sim", (senderAlert, args) => { try { var entrega = new EntregaManager(); entrega.Delete(ent); //Intent myIntent = new Intent(this, typeof(Activity_Menu)); ////myIntent.PutExtra("mensagem", entrega.mensagem); //SetResult(Android.App.Result.Ok, myIntent); Toast.MakeText(this, entrega.mensagem, ToastLength.Short).Show(); FillList(dataEmissao); } catch (Exception ex) { Toast.MakeText(this, ex.Message, ToastLength.Short).Show(); } }); alert.SetNegativeButton("Não", (senderAlert, args) => { }); RunOnUiThread(() => { alert.Show(); }); }
private void Delete() { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Tem certeza que deseja excluir este registro?"); alert.SetPositiveButton("Sim", (senderAlert, args) => { try { var Ent = new EntregaManager(); Ent.Delete(entrega); Intent myIntent = new Intent(this, typeof(Activity_Menu)); myIntent.PutExtra("mensagem", Ent.mensagem); SetResult(Android.App.Result.Ok, myIntent); Finish(); } catch (Exception ex) { Toast.MakeText(this, ex.Message, ToastLength.Short).Show(); } }); alert.SetNegativeButton("Não", (senderAlert, args) => { }); RunOnUiThread(() => { alert.Show(); }); }
private void Delete(transportador.core.Model.Entrega ent) { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Tem certeza que deseja excluir esta ocorrência?"); alert.SetPositiveButton("Sim", (senderAlert, args) => { try { var entrega = new EntregaManager(); entrega.Delete(ent); Toast.MakeText(this, entrega.mensagem, ToastLength.Short).Show(); FillList(dataEmissao); } catch (Exception ex) { Toast.MakeText(this, ex.Message, ToastLength.Short).Show(); } }); alert.SetNegativeButton("Não", (senderAlert, args) => { }); RunOnUiThread(() => { alert.Show(); }); }