protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); Button btnUser = FindViewById <Button>(Resource.Id.btnUser); Button btnTable = FindViewById <Button>(Resource.Id.btnTable); Button btnGraph = FindViewById <Button>(Resource.Id.btnGraph); Button btnField = FindViewById <Button>(Resource.Id.btnField); Button btnCustomField = FindViewById <Button>(Resource.Id.btnCustomField); Button btnReset = FindViewById <Button>(Resource.Id.btnReset); Button btnAdd = FindViewById <Button>(Resource.Id.btnAdd); btnUser.Click += BtnUser_Click; btnTable.Click += BtnTable_Click; btnGraph.Click += BtnGraph_Click; btnField.Click += BtnField_Click; btnCustomField.Click += BtnCustomField_Click; btnReset.Click += BtnReset_Click; btnAdd.Click += BtnAdd_Click; userTabledb = new UserTableDB(this); tableListdb = new TableListDB(this); graphTabledb = new GraphTableDB(this); fieldTable = new FieldTableDB(this); customFieldTable = new CustomFieldTableDB(this); userTabledb.CreateTable(); tableListdb.CreateTable(); graphTabledb.CreateTable(); fieldTable.CreateTable(); customFieldTable.CreateTable(); }
/// <summary> /// Creates the all the database within the app (except VariousTables) /// </summary> public void CreateDatabase() { UserTable.CreateTable(); CustomFieldTable.CreateTable(); FieldTable.CreateTable(); GraphTable.CreateTable(); TableList.CreateTable(); }
/// <summary> /// Resets all the data within the database /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnReset_Click(object sender, System.EventArgs e) { userTabledb.CreateTable(); tableListdb.CreateTable(); graphTabledb.CreateTable(); fieldTable.CreateTable(); customFieldTable.CreateTable(); Toast.MakeText(this, "All data within the databases has been reseted", ToastLength.Long).Show(); }