private void BtnCreateDB_Click(object sender, EventArgs e)
        {
            ORM.DBRepository dbr    = new ORM.DBRepository();
            string           result = dbr.CreateDB();

            Toast.MakeText(this, result, ToastLength.Long).Show();
        }
        private void BtnGetAll_Click(object sender, EventArgs e)
        {
            ORM.DBRepository dbr    = new ORM.DBRepository();
            string           result = dbr.GetAllRecords();

            Toast.MakeText(this, result, ToastLength.Short).Show();
        }
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            ORM.DBRepository dbr   = new ORM.DBRepository();
            EditText         txtId = FindViewById <EditText>(Resource.Id.txttaskid);
            string           task  = dbr.GetTaskById(int.Parse(txtId.Text));

            Toast.MakeText(this, task, ToastLength.Short).Show();
        }
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            ORM.DBRepository dbr     = new ORM.DBRepository();
            EditText         txtId   = FindViewById <EditText>(Resource.Id.txttaskid);
            EditText         txtTask = FindViewById <EditText>(Resource.Id.txttask);

            txtTask.Text = dbr.GetTaskById(int.Parse(txtId.Text));
        }
Пример #5
0
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            EditText txtTask = FindViewById <EditText>(Resource.Id.txttask);

            ORM.DBRepository dbr    = new ORM.DBRepository();
            string           result = dbr.InsertRecord(txtTask.Text);

            Toast.MakeText(this, result, ToastLength.Short).Show();
        }
        private void BtnUpdate_Click(object sender, EventArgs e)
        {
            EditText txtId   = FindViewById <EditText>(Resource.Id.txttaskid);
            EditText txtTask = FindViewById <EditText>(Resource.Id.txttask);

            ORM.DBRepository dbr    = new ORM.DBRepository();
            string           result = dbr.UpdateRecord(int.Parse(txtId.Text), txtTask.Text);

            Toast.MakeText(this, result, ToastLength.Short).Show();
        }