void getAndUpdateData() { double sumGast = 0.0; double sumIngr = 0.0; double rest = 0.0; try { sumGast = TransacPipe.getSumaGastos(); sumIngr = TransacPipe.getSumaIngresos(); rest = (sumIngr - sumGast); } catch (Exception) {; } this.tvSalidas.Text = "$" + sumGast.ToString() + " MXN"; this.tvEntrada.Text = "$" + sumIngr.ToString() + " MXN"; this.tvBalance.Text = "$" + rest.ToString() + " MXN"; if (rest < 0) { //pintar rojo this.tvBalance.SetBackgroundColor(Android.Graphics.Color.Red); } if (rest >= 0) { //pintar azul this.tvBalance.SetBackgroundColor(Android.Graphics.Color.Black); } }
private void BAgregar_Click(object sender, EventArgs e) { var pval = parseValues(); TransacPipe.InsertGasto(pval); Msg("Se agrego una salida de $" + pval.CANTIDAD + " MXN, en concepto de: " + pval.CONCEPTO); this.Finish(); }
/// protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait; //start db TransacPipe.startConection(); // inital control config initialControls(); }
private void BorrarReg_Click(object sender, EventArgs e) { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Aviso"); alert.SetMessage("¿Realmente desea borrar todos los datos?"); alert.SetPositiveButton("No", (senderAlert, args) => { // }); alert.SetNegativeButton("Si, borrar", (senderAlert, args) => { TransacPipe.deleteAllGastosYIngresos(); Msg("Datos borrados..."); this.Finish(); }); Dialog dialog = alert.Create(); dialog.Show(); }