protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.employee_details);
            string text = Intent.GetStringExtra ("emp_id") ?? "0";
            sqldb = new EmployeeDatabase ("employee_db");

            Android.Database.ICursor result =  sqldb.GetRecordCursor (text);
            if (result.Count > 0) {
                result.MoveToFirst ();
                FindViewById<TextView>(Resource.Id.emp_name).Text = result.GetString(0) + " " + result.GetString(1) ;
                FindViewById<TextView>(Resource.Id.department).Text = result.GetString(2) ;
                FindViewById<TextView>(Resource.Id.officePhone).Text = result.GetString(3) ;
                FindViewById<TextView>(Resource.Id.cellphone).Text = result.GetString(4);
                FindViewById<TextView>(Resource.Id.title).Text = result.GetString(5) ;
                FindViewById<TextView>(Resource.Id.email).Text = result.GetString(6) ;
            }
        }
예제 #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            progress = new ProgressDialog(this);

            sqldb = new EmployeeDatabase("employee_db");

            progress.Indeterminate = true;
            progress.SetProgressStyle(ProgressDialogStyle.Spinner);
            progress.SetMessage("Contacting server. Please wait...");
            progress.SetCancelable(false);
            progress.Show();
            Android.Database.ICursor sqldb_cursor = sqldb.GetRecordCursor ();
            if (sqldb_cursor.Count > 0) {
                populateListFromDB (sqldb_cursor);
            } else {
                createListView ();
            }
        }